mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-26 15:02:21 +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.5.1</title>
|
<title>IoT Manager 4.5.2</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?4511" />
|
<link rel="stylesheet" href="/build/bundle.css?4520" />
|
||||||
|
|
||||||
<script defer src="/build/bundle.js?4511"></script>
|
<script defer src="/build/bundle.js?4520"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body></body>
|
<body></body>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
//****************************************************variable section**********************************************************/
|
//****************************************************variable section**********************************************************/
|
||||||
//******************************************************************************************************************************/
|
//******************************************************************************************************************************/
|
||||||
let myip = document.location.hostname;
|
let myip = document.location.hostname;
|
||||||
if (devMode) myip = "192.168.1.232";
|
if (devMode) myip = "192.168.1.228";
|
||||||
|
|
||||||
//Flags
|
//Flags
|
||||||
let firstDevListRequest = true;
|
let firstDevListRequest = true;
|
||||||
@@ -154,10 +154,7 @@
|
|||||||
|
|
||||||
console.log("[i]", "user on page:", currentPageName);
|
console.log("[i]", "user on page:", currentPageName);
|
||||||
|
|
||||||
//не нужно очищать переменные когда переходим на страницу разработчика
|
|
||||||
// if (currentPageName != "/dev|") {
|
|
||||||
clearData();
|
clearData();
|
||||||
//}
|
|
||||||
|
|
||||||
//если мы на странице dashboard то рассылаем всем устройствам запрос данных
|
//если мы на странице dashboard то рассылаем всем устройствам запрос данных
|
||||||
if (currentPageName === "/|") {
|
if (currentPageName === "/|") {
|
||||||
@@ -413,15 +410,6 @@
|
|||||||
if (await getPayloadAsJson(blob, size, out)) {
|
if (await getPayloadAsJson(blob, size, out)) {
|
||||||
errorsJson = out.json;
|
errorsJson = out.json;
|
||||||
parsed.errorsJson = true;
|
parsed.errorsJson = true;
|
||||||
//когда запустили обновление предотвращаем попытки проверки связи
|
|
||||||
//if (errorsJson.upd === 1) {
|
|
||||||
// preventReconnect = true;
|
|
||||||
//}
|
|
||||||
//когда устройство обновилось переподключимся через 5ть секунд
|
|
||||||
//if (errorsJson.upd === 5) {
|
|
||||||
// preventReconnect = false;
|
|
||||||
// reconnectTimeout = 20;
|
|
||||||
//}
|
|
||||||
if (blobDebug) console.log("[✔]", "errorsJson: ", errorsJson);
|
if (blobDebug) console.log("[✔]", "errorsJson: ", errorsJson);
|
||||||
} else {
|
} else {
|
||||||
parsed.errorsJson = false;
|
parsed.errorsJson = false;
|
||||||
@@ -595,6 +583,8 @@
|
|||||||
pageReady.config = true;
|
pageReady.config = true;
|
||||||
if (debug) console.log("✔✔", "config page parced");
|
if (debug) console.log("✔✔", "config page parced");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//&& parsed.widgetsJson && parsed.configJson - добавить когда 451 прошивка уйдет в прошлое
|
||||||
if (currentPageName === "/connection|" && parsed.ssidJson && parsed.settingsJson && parsed.errorsJson) {
|
if (currentPageName === "/connection|" && parsed.ssidJson && parsed.settingsJson && parsed.errorsJson) {
|
||||||
clearParcedFlags();
|
clearParcedFlags();
|
||||||
if (debug) console.log("✔✔", "connection page parced");
|
if (debug) console.log("✔✔", "connection page parced");
|
||||||
@@ -840,7 +830,7 @@
|
|||||||
|
|
||||||
function saveMqtt() {
|
function saveMqtt() {
|
||||||
var size = Object.keys(settingsJson).length;
|
var size = Object.keys(settingsJson).length;
|
||||||
//console.log("[i]", "settingsJson length: " + size);
|
wsSendMsg(selectedWs, "/tuoyal|" + JSON.stringify(generateLayout()));
|
||||||
if (size > 5) {
|
if (size > 5) {
|
||||||
wsSendMsg(selectedWs, "/sgnittes|" + JSON.stringify(settingsJson));
|
wsSendMsg(selectedWs, "/sgnittes|" + JSON.stringify(settingsJson));
|
||||||
} else {
|
} else {
|
||||||
@@ -881,14 +871,13 @@
|
|||||||
let widget = Object.assign({}, widgetsJson[w]);
|
let widget = Object.assign({}, widgetsJson[w]);
|
||||||
widget.page = config.page;
|
widget.page = config.page;
|
||||||
widget.descr = config.descr;
|
widget.descr = config.descr;
|
||||||
|
widget.topic = settingsJson.mqttPrefix + "/" + settingsJson.id + "/" + config.id;
|
||||||
widget.topic = settingsJson.root + "/" + config.id;
|
|
||||||
if (setWidget !== "nil") layout.push(widget);
|
if (setWidget !== "nil") layout.push(widget);
|
||||||
//создаем графики с окнами ввода
|
//создаем графики с окнами ввода
|
||||||
if (widget.widget === "chart" && widget.type !== "bar") {
|
if (widget.widget === "chart" && widget.type !== "bar") {
|
||||||
let input = getInput();
|
let input = getInput();
|
||||||
input.page = config.page;
|
input.page = config.page;
|
||||||
input.topic = settingsJson.root + "/" + config.id + "-date";
|
widget.topic = settingsJson.mqttPrefix + "/" + settingsJson.id + "/" + config.id + "-date";
|
||||||
input.descr = config.descr;
|
input.descr = config.descr;
|
||||||
//console.log("[i]", "topic ", widget.topic);
|
//console.log("[i]", "topic ", widget.topic);
|
||||||
layout.push(input);
|
layout.push(input);
|
||||||
@@ -947,14 +936,6 @@
|
|||||||
for (const [key, value] of Object.entries(parsed)) {
|
for (const [key, value] of Object.entries(parsed)) {
|
||||||
parsed[key] = false;
|
parsed[key] = false;
|
||||||
}
|
}
|
||||||
clearFlags();
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearFlags() {
|
|
||||||
//for (let i = 0; i < deviceList.length; i++) {
|
|
||||||
//deviceList[i].pp = false;
|
|
||||||
//deviceList[i].lp = false;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function wsPush(ws, topic, status) {
|
function wsPush(ws, topic, status) {
|
||||||
|
|||||||
Reference in New Issue
Block a user