mirror of https://github.com/1Panel-dev/1Panel
fix: 忽略概览页异常数据 (#971)
parent
4c18f3aa1d
commit
3a848428c3
|
@ -368,31 +368,37 @@ const onLoadCurrentInfo = async () => {
|
||||||
const res = await loadCurrentInfo(searchInfo.ioOption, searchInfo.netOption);
|
const res = await loadCurrentInfo(searchInfo.ioOption, searchInfo.netOption);
|
||||||
currentInfo.value.timeSinceUptime = res.data.timeSinceUptime;
|
currentInfo.value.timeSinceUptime = res.data.timeSinceUptime;
|
||||||
|
|
||||||
currentChartInfo.netBytesSent = Number(
|
currentChartInfo.netBytesSent =
|
||||||
((res.data.netBytesSent - currentInfo.value.netBytesSent) / 1024 / 3).toFixed(2),
|
res.data.netBytesSent - currentInfo.value.netBytesSent > 0
|
||||||
);
|
? Number(((res.data.netBytesSent - currentInfo.value.netBytesSent) / 1024 / 3).toFixed(2))
|
||||||
|
: 0;
|
||||||
netBytesSents.value.push(currentChartInfo.netBytesSent);
|
netBytesSents.value.push(currentChartInfo.netBytesSent);
|
||||||
if (netBytesSents.value.length > 20) {
|
if (netBytesSents.value.length > 20) {
|
||||||
netBytesSents.value.splice(0, 1);
|
netBytesSents.value.splice(0, 1);
|
||||||
}
|
}
|
||||||
currentChartInfo.netBytesRecv = Number(
|
|
||||||
((res.data.netBytesRecv - currentInfo.value.netBytesRecv) / 1024 / 3).toFixed(2),
|
currentChartInfo.netBytesRecv =
|
||||||
);
|
res.data.netBytesRecv - currentInfo.value.netBytesRecv > 0
|
||||||
|
? Number(((res.data.netBytesRecv - currentInfo.value.netBytesRecv) / 1024 / 3).toFixed(2))
|
||||||
|
: 0;
|
||||||
netBytesRecvs.value.push(currentChartInfo.netBytesRecv);
|
netBytesRecvs.value.push(currentChartInfo.netBytesRecv);
|
||||||
if (netBytesRecvs.value.length > 20) {
|
if (netBytesRecvs.value.length > 20) {
|
||||||
netBytesRecvs.value.splice(0, 1);
|
netBytesRecvs.value.splice(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
currentChartInfo.ioReadBytes = Number(
|
currentChartInfo.ioReadBytes =
|
||||||
((res.data.ioReadBytes - currentInfo.value.ioReadBytes) / 1024 / 1024 / 3).toFixed(2),
|
res.data.ioReadBytes - currentInfo.value.ioReadBytes > 0
|
||||||
);
|
? Number(((res.data.ioReadBytes - currentInfo.value.ioReadBytes) / 1024 / 1024 / 3).toFixed(2))
|
||||||
|
: 0;
|
||||||
ioReadBytes.value.push(currentChartInfo.ioReadBytes);
|
ioReadBytes.value.push(currentChartInfo.ioReadBytes);
|
||||||
if (ioReadBytes.value.length > 20) {
|
if (ioReadBytes.value.length > 20) {
|
||||||
ioReadBytes.value.splice(0, 1);
|
ioReadBytes.value.splice(0, 1);
|
||||||
}
|
}
|
||||||
currentChartInfo.ioWriteBytes = Number(
|
|
||||||
((res.data.ioWriteBytes - currentInfo.value.ioWriteBytes) / 1024 / 1024 / 3).toFixed(2),
|
currentChartInfo.ioWriteBytes =
|
||||||
);
|
res.data.ioWriteBytes - currentInfo.value.ioWriteBytes > 0
|
||||||
|
? Number(((res.data.ioWriteBytes - currentInfo.value.ioWriteBytes) / 1024 / 1024 / 3).toFixed(2))
|
||||||
|
: 0;
|
||||||
ioWriteBytes.value.push(currentChartInfo.ioWriteBytes);
|
ioWriteBytes.value.push(currentChartInfo.ioWriteBytes);
|
||||||
if (ioWriteBytes.value.length > 20) {
|
if (ioWriteBytes.value.length > 20) {
|
||||||
ioWriteBytes.value.splice(0, 1);
|
ioWriteBytes.value.splice(0, 1);
|
||||||
|
|
Loading…
Reference in New Issue