mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-30 03:49:17 +03:00
рабочие графики
This commit is contained in:
@@ -4,12 +4,12 @@
|
|||||||
<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.3.2</title>
|
<title>IoT Manager 4.3.4</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?434" />
|
||||||
|
|
||||||
<script defer src="/build/bundle.js"></script>
|
<script defer src="/build/bundle.js?434"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body></body>
|
<body></body>
|
||||||
|
|||||||
@@ -208,10 +208,6 @@
|
|||||||
append(data) {
|
append(data) {
|
||||||
if (this.flag) this.blob.append(data);
|
if (this.flag) this.blob.append(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
//set setWs(ws) {
|
|
||||||
// this.ws = ws;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let configJsonPacket = new blobToJson("/st/config.json", "/end/config.json", "config.json");
|
let configJsonPacket = new blobToJson("/st/config.json", "/end/config.json", "config.json");
|
||||||
@@ -444,13 +440,11 @@
|
|||||||
}
|
}
|
||||||
//сборщик chartJson пакетов
|
//сборщик chartJson пакетов
|
||||||
if (data.includes("/st/chart.json|")) {
|
if (data.includes("/st/chart.json|")) {
|
||||||
//let topic = deleteBeforeDelimiter(data, "|");
|
|
||||||
//console.log("[i] chart", topic);
|
|
||||||
chartJsonFlag[ws] = true;
|
chartJsonFlag[ws] = true;
|
||||||
}
|
}
|
||||||
if (data.includes("/end/chart.json|")) {
|
if (data.includes("/end/chart.json|")) {
|
||||||
let topic = deleteBeforeDelimiter(data, "|");
|
let json = JSON.parse(deleteBeforeDelimiter(data, "|"));
|
||||||
console.log("[i] chart", topic);
|
console.log("[i] chart blob", json.topic, json.maxCount);
|
||||||
chartJsonFlag[ws] = false;
|
chartJsonFlag[ws] = false;
|
||||||
var bb = chartJsonBlob.getBlob();
|
var bb = chartJsonBlob.getBlob();
|
||||||
let chartJsonReader = new FileReader();
|
let chartJsonReader = new FileReader();
|
||||||
@@ -462,15 +456,24 @@
|
|||||||
let arr = JSON.parse(chartJsonResult);
|
let arr = JSON.parse(chartJsonResult);
|
||||||
let status = {};
|
let status = {};
|
||||||
status.status = arr;
|
status.status = arr;
|
||||||
status.topic = topic;
|
status.topic = json.topic;
|
||||||
|
status.maxCount = json.maxCount;
|
||||||
apdateWidgetByArray(status);
|
apdateWidgetByArray(status);
|
||||||
if (debug) console.log("✔", "chartJson parced", status);
|
if (debug) console.log("✔ B", "chartJson parced", status);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
chartJsonBlob.clear();
|
chartJsonBlob.clear();
|
||||||
}
|
}
|
||||||
|
if (data.includes("/string/chart.json|")) {
|
||||||
|
let tmp = deleteBeforeDelimiter(data, "|");
|
||||||
|
if (IsJsonParse(tmp)) {
|
||||||
|
let json = JSON.parse(tmp);
|
||||||
|
console.log("✔ S", "chartJson parced");
|
||||||
|
apdateWidgetByArray(json);
|
||||||
|
}
|
||||||
|
}
|
||||||
//сборщик statusJson сообщений
|
//сборщик statusJson сообщений
|
||||||
if (data.includes('"status"')) {
|
if (data.includes('"status"') && !data.includes("/string/chart.json|")) {
|
||||||
if (IsJsonParse(data)) {
|
if (IsJsonParse(data)) {
|
||||||
let statusJson = JSON.parse(data);
|
let statusJson = JSON.parse(data);
|
||||||
if (Array.isArray(statusJson.status)) {
|
if (Array.isArray(statusJson.status)) {
|
||||||
@@ -530,27 +533,21 @@
|
|||||||
|
|
||||||
if (debug) console.log("✔✔", "config page parced");
|
if (debug) console.log("✔✔", "config page parced");
|
||||||
}
|
}
|
||||||
if (currentPageName === "/connection|") {
|
if (currentPageName === "/connection|" && parcedFlags.ssidJson && parcedFlags.settingsJson && parcedFlags.errorsJson) {
|
||||||
if (parcedFlags.ssidJson && parcedFlags.settingsJson && parcedFlags.errorsJson) {
|
clearParcedFlags();
|
||||||
clearParcedFlags();
|
if (debug) console.log("✔✔", "connection page parced");
|
||||||
if (debug) console.log("✔✔", "connection page parced");
|
pageReady.connection = true;
|
||||||
pageReady.connection = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (currentPageName === "/list|") {
|
if (currentPageName === "/list|" && parcedFlags.deviceListJson) {
|
||||||
if (parcedFlags.deviceListJson) {
|
clearParcedFlags();
|
||||||
clearParcedFlags();
|
if (debug) console.log("✔✔", "list page parced");
|
||||||
if (debug) console.log("✔✔", "list page parced");
|
pageReady.list = true;
|
||||||
pageReady.list = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (currentPageName === "/system|") {
|
if (currentPageName === "/system|" && parcedFlags.errorsJson && parcedFlags.settingsJson) {
|
||||||
if (parcedFlags.errorsJson && parcedFlags.settingsJson) {
|
clearParcedFlags();
|
||||||
clearParcedFlags();
|
getVersionsList();
|
||||||
getVersionsList();
|
if (debug) console.log("✔✔", "system page parced");
|
||||||
if (debug) console.log("✔✔", "system page parced");
|
pageReady.system = true;
|
||||||
pageReady.system = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (currentPageName === "/dev|" && parcedFlags.errorsJson && parcedFlags.settingsJson && configJsonPacket.isParced && itemsJsonPacket.isParced) {
|
if (currentPageName === "/dev|" && parcedFlags.errorsJson && parcedFlags.settingsJson && configJsonPacket.isParced && itemsJsonPacket.isParced) {
|
||||||
clearParcedFlags();
|
clearParcedFlags();
|
||||||
|
|||||||
@@ -41,14 +41,14 @@
|
|||||||
//console.log("[i]", "=======================================================");
|
//console.log("[i]", "=======================================================");
|
||||||
prevStatus = widget.status;
|
prevStatus = widget.status;
|
||||||
|
|
||||||
for (let i = 0; i < widget.status.length; i++) {
|
if (widget.maxCount === 0) {
|
||||||
//if (i === 0 && widget.status[i].x === 0 && widget.status[i].y1 === 0) {
|
clearCart();
|
||||||
// clearCart();
|
widget.status = [];
|
||||||
// widget.status = [];
|
console.log("[i]", "clear cart data");
|
||||||
// console.log("[i]", "clear cart data");
|
return;
|
||||||
// return;
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
|
for (let i = 0; i < widget.status.length; i++) {
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
labels[i] = getDDMM(widget.status[i].x);
|
labels[i] = getDDMM(widget.status[i].x);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user