From 9563b43bd94b9d92b9c75842999f6c733a56f81a Mon Sep 17 00:00:00 2001
From: IoT Manager <67171972+IoTManagerProject@users.noreply.github.com>
Date: Fri, 6 Oct 2023 01:36:13 +0200
Subject: [PATCH] =?UTF-8?q?541=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D1=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/index.html | 6 +++---
rollup.config.js | 2 +-
src/App.svelte | 45 +++++++++++++++++++--------------------------
3 files changed, 23 insertions(+), 30 deletions(-)
diff --git a/public/index.html b/public/index.html
index cc7dd90..be1bcea 100644
--- a/public/index.html
+++ b/public/index.html
@@ -4,12 +4,12 @@
-
IoT Manager 4.5.0
+ IoT Manager 4.5.1
-
+
-
+
diff --git a/rollup.config.js b/rollup.config.js
index a832614..2e43462 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -49,7 +49,7 @@ export default {
module: true,
toplevel: true,
unsafe_arrows: true,
- drop_console: false,
+ drop_console: true,
drop_debugger: true,
},
output: { quote_style: 1 },
diff --git a/src/App.svelte b/src/App.svelte
index 6092a0d..3713174 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -44,18 +44,15 @@
const LOG_MAX_MESSAGES = 100;
let reconnectTimeout = 60; //период проверки соединения с устройством
let remainingTimeout = reconnectTimeout;
- let connecting = true;
- let tickerTask;
let preventReconnect = false;
const waitingAckTimeout = 18000; //время ожидания ответа от устройства
- const rebootingTimeout = 30000;
- const updatingTimeout = 130000;
+ let rebootOrUpdateProcess = false;
let rebootTimer;
let opened = true;
let preventMove = false;
let screenSize;
const blobDebug = false;
- const devMode = true;
+ const devMode = false;
let percent;
@@ -977,7 +974,12 @@
tickerTask = setTimeout(wsTestMsgTask, 1000);
if (!preventReconnect) {
remainingTimeout--;
- if (socketConnected) showAwaitingCircle = false;
+ if (rebootOrUpdateProcess && socketConnected) {
+ rebootOrUpdateProcess = false;
+ showAwaitingCircle = false;
+ reconnectTimeout = 60;
+ remainingTimeout = reconnectTimeout;
+ }
percent = scale(remainingTimeout, reconnectTimeout, 0, 0, 100);
if (remainingTimeout <= 0) {
if (debug) console.log("[i]", "----timer tick----");
@@ -988,10 +990,6 @@
wsConnect(device.ws);
wsEventAdd(device.ws);
} else {
- if (device.ws === selectedWs) {
- //clearInterval(tickerTask);
- connecting = true;
- }
wsSendMsg(device.ws, "/tst|");
ack(device.ws, false);
}
@@ -1149,6 +1147,7 @@
}
function rebootEsp() {
+ rebootOrUpdateProcess = true;
if (debug) console.log("[i]", "reboot...");
wsSendMsg(selectedWs, "/reboot|");
markDeviceStatus(selectedWs, false);
@@ -1158,6 +1157,16 @@
remainingTimeout = reconnectTimeout;
}
+ function updateBuild(path) {
+ rebootOrUpdateProcess = true;
+ console.log(path);
+ wsSendMsg(selectedWs, "/update|" + path);
+ showAwaitingCircle = true;
+ socketConnected = false;
+ reconnectTimeout = 20;
+ remainingTimeout = reconnectTimeout;
+ }
+
function applicationReboot() {
console.log("[i]", "reboot svelte...");
for (const [key, value] of Object.entries(pageReady)) {
@@ -1169,13 +1178,6 @@
}, 1000);
}
- function rebootingTask() {
- clearTimeout(rebootTimer);
- clearData();
- connectToAllDevices();
- showAwaitingCircle = false;
- }
-
function cancelAlarm(alarmKey) {
console.log("[x]", alarmKey);
errorsJson[alarmKey] = 0;
@@ -1213,15 +1215,6 @@
}
}
- function updateBuild(path) {
- console.log(path);
- wsSendMsg(selectedWs, "/update|" + path);
- showAwaitingCircle = true;
- socketConnected = false;
- reconnectTimeout = 10;
- //rebootTimer = setTimeout(rebootingTask, updatingTimeout);
- }
-
function moduleOrder(id, key, value) {
console.log("order: ", id, key, value);
let json = {