mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-26 23:12:34 +03:00
4.1.0
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<meta charset='utf-8'>
|
<meta charset='utf-8'>
|
||||||
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
||||||
|
|
||||||
<title>IoT Manager 4.0.8</title>
|
<title>IoT Manager 4.1.0</title>
|
||||||
|
|
||||||
<link rel='icon' type='image/png' href='/favicon.ico'>
|
<link rel='icon' type='image/png' href='/favicon.ico'>
|
||||||
<link rel='stylesheet' href='/build/bundle.css'>
|
<link rel='stylesheet' href='/build/bundle.css'>
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
|
|
||||||
//****************************************************variable section**********************************************************/
|
//****************************************************variable section**********************************************************/
|
||||||
//******************************************************************************************************************************/
|
//******************************************************************************************************************************/
|
||||||
let myip = document.location.hostname;
|
//let myip = document.location.hostname;
|
||||||
//let myip = "192.168.88.224";
|
let myip = "192.168.88.224";
|
||||||
|
|
||||||
//Flags
|
//Flags
|
||||||
let firstDevListRequest = true;
|
let firstDevListRequest = true;
|
||||||
@@ -82,7 +82,6 @@
|
|||||||
let layoutJsonParced = false;
|
let layoutJsonParced = false;
|
||||||
|
|
||||||
let settingsJson = {};
|
let settingsJson = {};
|
||||||
let settingsJsonFlag = false;
|
|
||||||
let settingsJsonParced = false;
|
let settingsJsonParced = false;
|
||||||
|
|
||||||
let errorsJson = {};
|
let errorsJson = {};
|
||||||
@@ -97,7 +96,7 @@
|
|||||||
let statusJsonParced = false;
|
let statusJsonParced = false;
|
||||||
|
|
||||||
let incDeviceList = [];
|
let incDeviceList = [];
|
||||||
let incDeviceListParced = false;
|
let deviceListParced = false;
|
||||||
|
|
||||||
let scenarioTxt = "";
|
let scenarioTxt = "";
|
||||||
let scenarioTxtFlag = false;
|
let scenarioTxtFlag = false;
|
||||||
@@ -163,6 +162,7 @@
|
|||||||
router.subscribe(handleNavigation);
|
router.subscribe(handleNavigation);
|
||||||
|
|
||||||
function handleNavigation() {
|
function handleNavigation() {
|
||||||
|
console.log("[i]", "handle navigation");
|
||||||
clearData();
|
clearData();
|
||||||
currentPageName = $router.path.toString();
|
currentPageName = $router.path.toString();
|
||||||
//название страницы служит заголовком, поэтому отметим конец заголовка "|"
|
//название страницы служит заголовком, поэтому отметим конец заголовка "|"
|
||||||
@@ -181,6 +181,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//*******************************************************initialisation********************************************************************/
|
||||||
|
onMount(async () => {
|
||||||
|
console.log("[i]", "mounted");
|
||||||
|
whenDeviceListWasUpdated();
|
||||||
|
firstDevListRequest = true;
|
||||||
|
connectToAllDevices();
|
||||||
|
wsTestMsgTask();
|
||||||
|
findNewPage();
|
||||||
|
});
|
||||||
|
|
||||||
//****************************************************web sockets section******************************************************/
|
//****************************************************web sockets section******************************************************/
|
||||||
function connectToAllDevices() {
|
function connectToAllDevices() {
|
||||||
//closeAllConnection();
|
//closeAllConnection();
|
||||||
@@ -279,9 +289,6 @@
|
|||||||
if (IsJsonParse(data)) {
|
if (IsJsonParse(data)) {
|
||||||
incDeviceList = JSON.parse(data);
|
incDeviceList = JSON.parse(data);
|
||||||
incDeviceList = incDeviceList;
|
incDeviceList = incDeviceList;
|
||||||
incDeviceListParced = true;
|
|
||||||
if (debug) console.log("✔", "incDeviceList json parced");
|
|
||||||
onParced("devicelist");
|
|
||||||
if (firstDevListRequest) {
|
if (firstDevListRequest) {
|
||||||
deviceList = incDeviceList;
|
deviceList = incDeviceList;
|
||||||
deviceList[0].status = true;
|
deviceList[0].status = true;
|
||||||
@@ -289,16 +296,21 @@
|
|||||||
deviceList = combineArrays(deviceList, incDeviceList);
|
deviceList = combineArrays(deviceList, incDeviceList);
|
||||||
}
|
}
|
||||||
firstDevListRequest = false;
|
firstDevListRequest = false;
|
||||||
//deviceList.sort(function (a, b) {
|
|
||||||
// if (a.name < b.name) {
|
// deviceList.sort(function (a, b) {
|
||||||
// return -1;
|
// if (a.name < b.name) {
|
||||||
// }
|
// return -1;
|
||||||
// if (a.name > b.name) {
|
// }
|
||||||
// return 1;
|
// if (a.name > b.name) {
|
||||||
// }
|
// return 1;
|
||||||
// return 0;
|
// }
|
||||||
//});
|
// return 0;
|
||||||
|
// });
|
||||||
|
|
||||||
deviceList = deviceList;
|
deviceList = deviceList;
|
||||||
|
deviceListParced = true;
|
||||||
|
if (debug) console.log("✔", "deviceList json parced");
|
||||||
|
onParced();
|
||||||
whenDeviceListWasUpdated();
|
whenDeviceListWasUpdated();
|
||||||
connectToAllDevices();
|
connectToAllDevices();
|
||||||
}
|
}
|
||||||
@@ -311,7 +323,7 @@
|
|||||||
wigetsUpdate();
|
wigetsUpdate();
|
||||||
if (debug) console.log("✔", "statusJson parced");
|
if (debug) console.log("✔", "statusJson parced");
|
||||||
statusJsonParced = true;
|
statusJsonParced = true;
|
||||||
onParced("status");
|
onParced();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//сборщик paramsJson сообщений======================================
|
//сборщик paramsJson сообщений======================================
|
||||||
@@ -320,7 +332,7 @@
|
|||||||
paramsJson = JSON.parse(data);
|
paramsJson = JSON.parse(data);
|
||||||
if (debug) console.log("✔", "paramsJson parced", ws);
|
if (debug) console.log("✔", "paramsJson parced", ws);
|
||||||
paramsJsonParced = true;
|
paramsJsonParced = true;
|
||||||
onParced("params");
|
onParced();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//сборщик ssidJson сообщений======================================
|
//сборщик ssidJson сообщений======================================
|
||||||
@@ -330,7 +342,7 @@
|
|||||||
ssidJson = ssidJson;
|
ssidJson = ssidJson;
|
||||||
if (debug) console.log("✔", "ssidJson parced");
|
if (debug) console.log("✔", "ssidJson parced");
|
||||||
ssidJsonParced = true;
|
ssidJsonParced = true;
|
||||||
onParced("ssid");
|
onParced();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//сборщик errorsJson сообщений======================================
|
//сборщик errorsJson сообщений======================================
|
||||||
@@ -340,7 +352,7 @@
|
|||||||
errorsJson = errorsJson;
|
errorsJson = errorsJson;
|
||||||
errorsJsonParced = true;
|
errorsJsonParced = true;
|
||||||
if (debug) console.log("✔", "errorsJson json parced");
|
if (debug) console.log("✔", "errorsJson json parced");
|
||||||
onParced("errors");
|
onParced();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//сборщик settingsJson сообщений======================================
|
//сборщик settingsJson сообщений======================================
|
||||||
@@ -351,7 +363,7 @@
|
|||||||
wigetsUpdate();
|
wigetsUpdate();
|
||||||
settingsJsonParced = true;
|
settingsJsonParced = true;
|
||||||
if (debug) console.log("✔", "settingsJson json parced");
|
if (debug) console.log("✔", "settingsJson json parced");
|
||||||
onParced("settings");
|
onParced();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,12 +386,11 @@
|
|||||||
let scenarioTxtReader = new FileReader();
|
let scenarioTxtReader = new FileReader();
|
||||||
scenarioTxtReader.readAsText(bb);
|
scenarioTxtReader.readAsText(bb);
|
||||||
scenarioTxtReader.onload = () => {
|
scenarioTxtReader.onload = () => {
|
||||||
let scenarioTxtResult = scenarioTxtReader.result;
|
scenarioTxt = scenarioTxtReader.result;
|
||||||
scenarioTxt = scenarioTxtResult;
|
|
||||||
scenarioTxt = scenarioTxt;
|
scenarioTxt = scenarioTxt;
|
||||||
scenarioTxtParced = true;
|
scenarioTxtParced = true;
|
||||||
if (debug) console.log("✔", "scenarioTxt parced");
|
if (debug) console.log("✔", "scenarioTxt parced");
|
||||||
onParced("scenario");
|
onParced();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
//сборщик configJson пакетов========================================
|
//сборщик configJson пакетов========================================
|
||||||
@@ -398,7 +409,7 @@
|
|||||||
configJson = configJson;
|
configJson = configJson;
|
||||||
configJsonParced = true;
|
configJsonParced = true;
|
||||||
if (debug) console.log("✔", "configJson parced");
|
if (debug) console.log("✔", "configJson parced");
|
||||||
onParced("config");
|
onParced();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -418,7 +429,7 @@
|
|||||||
widgetsJson = widgetsJson;
|
widgetsJson = widgetsJson;
|
||||||
widgetsJsonParced = true;
|
widgetsJsonParced = true;
|
||||||
if (debug) console.log("✔", "widgetsJson parced");
|
if (debug) console.log("✔", "widgetsJson parced");
|
||||||
onParced("widgets");
|
onParced();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -438,7 +449,7 @@
|
|||||||
itemsJson = itemsJson;
|
itemsJson = itemsJson;
|
||||||
itemsJsonParced = true;
|
itemsJsonParced = true;
|
||||||
if (debug) console.log("✔", "itemsJson parced");
|
if (debug) console.log("✔", "itemsJson parced");
|
||||||
onParced("items");
|
onParced();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -459,7 +470,7 @@
|
|||||||
wigetsUpdate();
|
wigetsUpdate();
|
||||||
layoutJsonParced = true;
|
layoutJsonParced = true;
|
||||||
if (debug) console.log("✔", "layoutJson parced", ws);
|
if (debug) console.log("✔", "layoutJson parced", ws);
|
||||||
onParced("layout");
|
onParced();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -489,7 +500,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onParced(file) {
|
function onParced() {
|
||||||
if (currentPageName === "/|" && layoutJsonParced && paramsJsonParced) {
|
if (currentPageName === "/|" && layoutJsonParced && paramsJsonParced) {
|
||||||
clearParcedFlags();
|
clearParcedFlags();
|
||||||
if (debug) console.log("✔✔", "dashboard data parced");
|
if (debug) console.log("✔✔", "dashboard data parced");
|
||||||
@@ -507,7 +518,7 @@
|
|||||||
if (debug) console.log("✔✔", "connection data parced");
|
if (debug) console.log("✔✔", "connection data parced");
|
||||||
connectionReady = true;
|
connectionReady = true;
|
||||||
}
|
}
|
||||||
if (currentPageName === "/list|" && incDeviceListParced) {
|
if (currentPageName === "/list|" && deviceListParced) {
|
||||||
clearParcedFlags();
|
clearParcedFlags();
|
||||||
if (debug) console.log("✔✔", "list data parced");
|
if (debug) console.log("✔✔", "list data parced");
|
||||||
listReady = true;
|
listReady = true;
|
||||||
@@ -618,15 +629,13 @@
|
|||||||
layoutJson = [];
|
layoutJson = [];
|
||||||
layoutJsonBlob.clear();
|
layoutJsonBlob.clear();
|
||||||
|
|
||||||
settingsJson = {};
|
|
||||||
|
|
||||||
errorsJson = {};
|
|
||||||
|
|
||||||
coreMessages = [];
|
|
||||||
|
|
||||||
scenarioTxt = "";
|
scenarioTxt = "";
|
||||||
scenarioTxtBlob.clear();
|
scenarioTxtBlob.clear();
|
||||||
|
|
||||||
|
settingsJson = {};
|
||||||
|
errorsJson = {};
|
||||||
|
coreMessages = [];
|
||||||
|
|
||||||
dashReady = false;
|
dashReady = false;
|
||||||
configReady = false;
|
configReady = false;
|
||||||
connectionReady = false;
|
connectionReady = false;
|
||||||
@@ -648,7 +657,7 @@
|
|||||||
ssidJsonParced = false;
|
ssidJsonParced = false;
|
||||||
paramsJsonParced = false;
|
paramsJsonParced = false;
|
||||||
statusJsonParced = false;
|
statusJsonParced = false;
|
||||||
incDeviceListParced = false;
|
deviceListParced = false;
|
||||||
scenarioTxtParced = false;
|
scenarioTxtParced = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -963,6 +972,7 @@
|
|||||||
|
|
||||||
function rebootingTask() {
|
function rebootingTask() {
|
||||||
clearTimeout(myTimeout);
|
clearTimeout(myTimeout);
|
||||||
|
clearData();
|
||||||
connectToAllDevices();
|
connectToAllDevices();
|
||||||
rebootingInProgress = false;
|
rebootingInProgress = false;
|
||||||
}
|
}
|
||||||
@@ -1020,16 +1030,6 @@
|
|||||||
window.alert("Версия не выбрана или сервер недоступен");
|
window.alert("Версия не выбрана или сервер недоступен");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//*******************************************************initialisation********************************************************************/
|
|
||||||
onMount(async () => {
|
|
||||||
console.log("[i]", "mounted");
|
|
||||||
whenDeviceListWasUpdated();
|
|
||||||
firstDevListRequest = true;
|
|
||||||
connectToAllDevices();
|
|
||||||
wsTestMsgTask();
|
|
||||||
findNewPage();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col h-screen bg-gray-50">
|
<div class="flex flex-col h-screen bg-gray-50">
|
||||||
|
|||||||
Reference in New Issue
Block a user