#
vincent
2020-06-02 b5d61b944f4822e59bcaf3f825fac1b6683f29e9
src/main/webapp/views/pipeline.html
@@ -11,7 +11,7 @@
    <link rel="stylesheet" type="text/css" href="../static/css/pipeline.css">
    <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../static/js/common.js"></script>
    <script type="text/javascript" src="../static/js/layer/layer.js"></script>
    <script type="text/javascript" src="../static/js/handlebars/handlebars-v4.5.3.js"></script>
    <style>
    </style>
@@ -43,6 +43,7 @@
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
@@ -413,8 +414,22 @@
    <textarea id="output"></textarea>
</footer>
</body>
<script type="text/template" id="plcErrorTable">
    {{#each data}}
    <tr>
        <td>{{no}}</td>
        <td>{{plcDesc}}</td>
        <td>{{error}}</td>
    </tr>
    {{/each}}
</script>
<script>
    // 初始化
    var outputDom = document.getElementById("output");
    // 实时访问
    setInterval(function () {
        getPlcError();
    }, 500);
    // 空白表格渲染
    $(document).ready(function() {
@@ -431,9 +446,10 @@
                "     </tr>\n";
        }
        $('#plc-error-table tbody').after(html);
        getPlcError();
    });
    getPlcError();
    // plc异常信息表获取
    function getPlcError() {
        $.ajax({
@@ -442,8 +458,10 @@
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    console.log(res.data);
                    addPlcError(res.data);
                    var tpl = $("#plcErrorTable").html();
                    var template = Handlebars.compile(tpl);
                    var html = template(res);
                    $('#plc-error-table').append(html);
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/login";
                }  else {
@@ -451,11 +469,6 @@
                }
            }
        });
    }
    // plc异常输入
    function addPlcError(val) {
    }
    // 日志输出框