diff --git a/Frontend/_dashboard.html b/Frontend/_dashboard.html index 6ef899b..d0b67d7 100644 --- a/Frontend/_dashboard.html +++ b/Frontend/_dashboard.html @@ -146,62 +146,12 @@
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
+
+
+
+
@@ -340,7 +290,8 @@ ]; $(document).ready(function () { - + getSubList(); + /* init datatables */ $('#dt-basic-example').dataTable( { @@ -725,4 +676,38 @@ $("#js-page-content").load("_sysMonAll.html", loadCallback); } + function getSubList() { + let url = baseApiUrl + "/api/Device/GetMainSub"; + let sendData = { + building_tag: pageAct.buiTag, + }; + objSendData.Data = sendData; + ytAjax = new YourTeam.Ajax(url, objSendData, function (res) { + if (!res || res.code != "0000" || !res.data) { + + } else { + let strHtml = ``; + $.each(res.data.history_Main_Systems, (index, mainSysObj) => { + $.each(mainSysObj.history_Sub_systems, (index2, subSysObj) => { + strHtml += `
+ + +
`; + }) + }) + $("#sysSubBtnList").html(strHtml); + getAlarmSub(); + } + }, null, "POST").send(); + } + + function getAlarmSub() { + $(".dev-group").each((idx, ele) => { + let path = $(ele).data("id"); + getOneSystemStateByBaja(path, (data) => { + console.log(data) + }) + }) + + } \ No newline at end of file diff --git a/Frontend/index.html b/Frontend/index.html index ebed679..d8da4e7 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -2559,7 +2559,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li /*$('#js-page-content').smartPanel();*/ var jwt = localStorage.getItem("JWT-Authorization"); var pageAct = {}; //記錄全頁面已選擇項目 - + pageAct.AreaTag = "TPE"; if (location.href.indexOf("ord") != -1) { location.href = "/file/index.html" } @@ -2615,6 +2615,9 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li function loadedJsPack() { loadEvent(); if (!jwt) { + if (location.href.indexOf("localhost:5966") != -1) { + location.href = "login.html"; + } myBaja = new MyBaja(); myBaja.setMyUserAccount(Login); } else { diff --git a/Frontend/js/yourteam/yourteam.ajax.class.js b/Frontend/js/yourteam/yourteam.ajax.class.js index 9f17d06..5c115bf 100644 --- a/Frontend/js/yourteam/yourteam.ajax.class.js +++ b/Frontend/js/yourteam/yourteam.ajax.class.js @@ -58,8 +58,13 @@ class Ajax { */ successFunction = function (data,callback) { if (data && data.unauthorized == 401) { + let href = location.href; localStorage.removeItem("JWT-Authorization"); - location.href = "/login"; + if (href.indexOf("localhost:5966") == -1) { + location.href = "/login"; + } else { + location.href = "login.html"; + } } if (callback) { callback(data);