исправление багов графика

This commit is contained in:
Dmitry Borisenko
2022-09-08 23:35:58 +02:00
parent 83ac3a51b7
commit 91bee654bc
3 changed files with 31 additions and 28 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.2</title> <title>IoT Manager 4.2.3</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,12 +38,12 @@
let opened = false; let opened = false;
let preventMove = false; let preventMove = false;
let showWidjetJson = false; let showWidjetJson = false;
let devMode = true; let devMode = false;
//****************************************************variable section**********************************************************/ //****************************************************variable section**********************************************************/
//******************************************************************************************************************************/ //******************************************************************************************************************************/
let myip = document.location.hostname; let myip = document.location.hostname;
if (devMode) myip = "192.168.88.225"; if (devMode) myip = "192.168.1.196";
//Flags //Flags
let firstDevListRequest = true; let firstDevListRequest = true;
@@ -1270,7 +1270,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
position: fixed; position: fixed;
z-index: 1; z-index: 2;
top: 10px; top: 10px;
left: 20px; left: 20px;
width: 20px; width: 20px;
@@ -1301,6 +1301,7 @@
display: block; display: block;
position: fixed; position: fixed;
visibility: hidden; visibility: hidden;
z-index: 1;
top: 0; top: 0;
left: -100%; left: -100%;
width: 150px; /* размер выхода бокового меню */ width: 150px; /* размер выхода бокового меню */

View File

@@ -32,8 +32,7 @@
$: widget.status, collectDataToArr(); $: widget.status, collectDataToArr();
function collectDataToArr() { function collectDataToArr() {
if (widget.status) { if (widget.status && Array.isArray(widget.status)) {
if (Array.isArray(widget.status)) {
//отсекаем лишние события изменения переменной widget //отсекаем лишние события изменения переменной widget
if (prevSatus !== widget.status) { if (prevSatus !== widget.status) {
console.log("[i]", "collecting chart data to array, topic:", widget.topic); console.log("[i]", "collecting chart data to array, topic:", widget.topic);
@@ -60,7 +59,8 @@
prevSatus = widget.status; prevSatus = widget.status;
datachart = datachart; datachart = datachart;
} }
} } else {
console.log("[i]", "skipping event, topic:", widget.topic);
} }
} }
@@ -70,4 +70,6 @@
} }
</script> </script>
<!-- svelte-ignore a11y-label-has-associated-control -->
<label class="wgt-dscr-stl">{!widget.descr ? "" : widget.descr}</label>
<Chart data={datachart} type="line" lineOptions={lineOptions} axisOptions={axisOptions} /> <Chart data={datachart} type="line" lineOptions={lineOptions} axisOptions={axisOptions} />