mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-04 22:57:20 +02:00
Update network data instead of assigning new variables.
This commit is contained in:
parent
d5cc6a6859
commit
6dd62f509d
@ -583,14 +583,14 @@
|
|||||||
url: '/api/stats/netstatgraph?array=true',
|
url: '/api/stats/netstatgraph?array=true',
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if (rxValues.length == 0){
|
if (rxValues.length == 0){
|
||||||
rxValues = JSON.parse(JSON.stringify(data.Rx));
|
rxValues.push(...data.Rx);
|
||||||
}else{
|
}else{
|
||||||
rxValues.push(data.Rx[dataCount-1]);
|
rxValues.push(data.Rx[dataCount-1]);
|
||||||
rxValues.shift();
|
rxValues.shift();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txValues.length == 0){
|
if (txValues.length == 0){
|
||||||
txValues = JSON.parse(JSON.stringify(data.Tx));
|
txValues.push(...data.Tx);
|
||||||
}else{
|
}else{
|
||||||
txValues.push(data.Tx[dataCount-1]);
|
txValues.push(data.Tx[dataCount-1]);
|
||||||
txValues.shift();
|
txValues.shift();
|
||||||
@ -698,8 +698,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateChart() {
|
function updateChart() {
|
||||||
networkStatisticChart.data.datasets[0].data = rxValues;
|
//networkStatisticChart.data.datasets[0].data = rxValues;
|
||||||
networkStatisticChart.data.datasets[1].data = txValues;
|
//networkStatisticChart.data.datasets[1].data = txValues;
|
||||||
if (networkStatisticChart != undefined){
|
if (networkStatisticChart != undefined){
|
||||||
networkStatisticChart.update();
|
networkStatisticChart.update();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user