убираем баги

This commit is contained in:
Dmitry Borisenko
2022-09-11 14:14:16 +02:00
parent 189538741a
commit 5f97fa13e2
4 changed files with 27 additions and 19 deletions

View File

@@ -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.2.5</title> <title>IoT Manager 4.2.6</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" />

View File

@@ -38,7 +38,7 @@
let updatingTimeout = 80000; let updatingTimeout = 80000;
let opened = false; let opened = false;
let preventMove = false; let preventMove = false;
let devMode = false; let devMode = true;
//****************************************************variable section**********************************************************/ //****************************************************variable section**********************************************************/
//******************************************************************************************************************************/ //******************************************************************************************************************************/
@@ -445,7 +445,7 @@
if (data === "/st/layout.json") { if (data === "/st/layout.json") {
} }
if (data === "/end/layout.json") { if (data === "/end/layout.json") {
createLayoutUnderLoading(ws); //createLayoutUnderLoading(ws);
} }
//сборщик paramsJson сообщений //сборщик paramsJson сообщений
if (data.includes('"params":"')) { if (data.includes('"params":"')) {
@@ -456,6 +456,8 @@
...JSON.parse(data), ...JSON.parse(data),
}; };
paramsJson = paramsJson; paramsJson = paramsJson;
console.log("[i] paramsJson:", paramsJson);
createLayoutUnderLoading(ws);
onParced(); onParced();
} }
} }
@@ -518,7 +520,7 @@
devLayout[i].ws = ws; devLayout[i].ws = ws;
topic = topic.substring(topic.lastIndexOf("/") + 1, topic.length); topic = topic.substring(topic.lastIndexOf("/") + 1, topic.length);
if (key === topic) { if (key === topic) {
console.log("[i]", "value " + topic + " updated"); console.log("[i]", "updated " + topic, value);
devLayout[i].status = value; devLayout[i].status = value;
break; break;
} }
@@ -615,16 +617,17 @@
wsSendMsg(selectedWs, "/mqtt|"); wsSendMsg(selectedWs, "/mqtt|");
} }
let input = {}; function getInput() {
let input = {
input = { name: "inputDate",
name: "inputDate", descr: "Выберите дату",
descr: "Выберите дату", widget: "input",
widget: "input", size: "small",
size: "small", color: "orange",
color: "orange", type: "date",
type: "date", };
}; return input;
}
function generateLayout() { function generateLayout() {
let layout = []; let layout = [];
@@ -639,11 +642,15 @@
widget.descr = config.descr; widget.descr = config.descr;
//widget.id = config.id; //widget.id = config.id;
//widget.ws = selectedWs; //widget.ws = selectedWs;
widget.topic = settingsJson.root + "/" + config.id; widget.topic = settingsJson.root + "/" + config.id;
layout.push(widget); layout.push(widget);
if (widget.widget === "chart") { if (widget.widget === "chart") {
let input = getInput();
input.page = config.page; input.page = config.page;
input.topic = settingsJson.root + "/" + config.id + "-date"; let topic = settingsJson.root + "/" + config.id + "-date";
input.topic = topic;
console.log("[i]", "topic ", topic);
layout.push(input); layout.push(input);
} }
error = false; error = false;

View File

@@ -81,6 +81,7 @@
} }
function clearCart() { function clearCart() {
collectingDataArray = [];
datachart = { datachart = {
labels: [0], labels: [0],
datasets: [ datasets: [

View File

@@ -6,9 +6,9 @@
//$: widget.status, calc(); //$: widget.status, calc();
function selectFromMarkerToMarker(str, tofind, number) { function selectFromMarkerToMarker(str, tofind, number) {
if (str.indexOf(tofind) == -1) { //if (str.indexOf(tofind) == -1) {
return "not found"; // return "not found";
} //}
str += tofind; str += tofind;
let i = 0; let i = 0;
do { do {
@@ -32,7 +32,7 @@
return str.substring(p); return str.substring(p);
} }
let bindValue; let bindValue = "";
//данная функция вызывается когда в вебе поменяли значение и его нужно отправить в сокеты //данная функция вызывается когда в вебе поменяли значение и его нужно отправить в сокеты
//а также периписать в переменной виджета //а также периписать в переменной виджета