From 2997f60bcb60e3960ae6665cb5dfa97be2fedfd0 Mon Sep 17 00:00:00 2001 From: vincent <1341870251@qq.com> Date: 星期二, 02 六月 2020 13:16:22 +0800 Subject: [PATCH] # --- src/main/webapp/views/pipeline.html | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/views/pipeline.html b/src/main/webapp/views/pipeline.html index 34a483c..384f97d 100644 --- a/src/main/webapp/views/pipeline.html +++ b/src/main/webapp/views/pipeline.html @@ -84,8 +84,6 @@ // 瀹為檯琛屾暟 var plcErrorTableFullRows = 0; var siteTableFullRows = 0; - - var outputDom = document.getElementById("output"); $(document).ready(function() { initPlcErrorTable(); @@ -99,7 +97,7 @@ getSite(); }, 1000); setInterval(function () { - output("\n" +new Date().toLocaleString() + "銆�2020-5-29 13:14:22銆戞壂鎻弍lcA 鐩爣绔�--27328372372832763643234323432342"); + getSiteOutput(); },500); @@ -132,7 +130,6 @@ // 绔欑偣淇℃伅琛ㄨ幏鍙� function getSite() { var tableEl = $('#site-table'); - // tableEl.children("tr").children("td").html(""); $.ajax({ url: baseUrl+ "/site/table/site", headers: {'token': localStorage.getItem('token')}, @@ -177,6 +174,24 @@ }); } + // 杈撻�佽澶囨棩蹇楄緭鍑� + function getSiteOutput() { + $.ajax({ + url: baseUrl + "/site/output/site", + headers: {'token': localStorage.getItem('token')}, + method: 'POST', + success: function (res) { + if (res.code === 200) { + output(res.data); + } else if (res.code === 403) { + top.location.href = baseUrl + "/login"; + } else { + alert(res.msg); + } + } + }) + } + // 鏃ュ織杈撳嚭妗� function output(content){ outputDom.value += content; -- Gitblit v1.9.1