From d5cc6a68591ae8d49a19626dcce4ad9986ad9a0b Mon Sep 17 00:00:00 2001 From: Joker_ <1465267+JokerQyou@users.noreply.github.com> Date: Fri, 2 Aug 2024 00:07:12 +0800 Subject: [PATCH 1/2] Fix network I/O chart not rendering. Close #200. --- src/web/components/status.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/components/status.html b/src/web/components/status.html index 0e0d19b..601042e 100644 --- a/src/web/components/status.html +++ b/src/web/components/status.html @@ -698,8 +698,8 @@ } function updateChart() { - //networkStatisticChart.data.datasets[0].data = rxValues; - //networkStatisticChart.data.datasets[1].data = txValues; + networkStatisticChart.data.datasets[0].data = rxValues; + networkStatisticChart.data.datasets[1].data = txValues; if (networkStatisticChart != undefined){ networkStatisticChart.update(); } From 6dd62f509d1e55cf1af02bbe6ae3e3a316873f03 Mon Sep 17 00:00:00 2001 From: Joker_ <1465267+JokerQyou@users.noreply.github.com> Date: Fri, 2 Aug 2024 22:00:51 +0800 Subject: [PATCH 2/2] Update network data instead of assigning new variables. --- src/web/components/status.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/web/components/status.html b/src/web/components/status.html index 601042e..e783ba6 100644 --- a/src/web/components/status.html +++ b/src/web/components/status.html @@ -583,14 +583,14 @@ url: '/api/stats/netstatgraph?array=true', success: function(data){ if (rxValues.length == 0){ - rxValues = JSON.parse(JSON.stringify(data.Rx)); + rxValues.push(...data.Rx); }else{ rxValues.push(data.Rx[dataCount-1]); rxValues.shift(); } if (txValues.length == 0){ - txValues = JSON.parse(JSON.stringify(data.Tx)); + txValues.push(...data.Tx); }else{ txValues.push(data.Tx[dataCount-1]); txValues.shift(); @@ -698,8 +698,8 @@ } function updateChart() { - networkStatisticChart.data.datasets[0].data = rxValues; - networkStatisticChart.data.datasets[1].data = txValues; + //networkStatisticChart.data.datasets[0].data = rxValues; + //networkStatisticChart.data.datasets[1].data = txValues; if (networkStatisticChart != undefined){ networkStatisticChart.update(); }