fix: 看板资源cpu溢出100%
This commit is contained in:
@@ -247,11 +247,22 @@ function fnChangeData(data: any[], itemID: string) {
|
|||||||
if (info.neState.cpu) {
|
if (info.neState.cpu) {
|
||||||
nfCpuUsage = info.neState.cpu.nfCpuUsage;
|
nfCpuUsage = info.neState.cpu.nfCpuUsage;
|
||||||
if (nfCpuUsage > 100) {
|
if (nfCpuUsage > 100) {
|
||||||
nfCpuUsage = +(info.neState.cpu.nfCpuUsage / 100).toFixed(2);
|
const nfCpu = +(info.neState.cpu.nfCpuUsage / 100);
|
||||||
|
if (nfCpu > 100) {
|
||||||
|
nfCpuUsage = 100;
|
||||||
|
} else {
|
||||||
|
nfCpuUsage = +nfCpu.toFixed(2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sysCpuUsage = info.neState.cpu.sysCpuUsage;
|
sysCpuUsage = info.neState.cpu.sysCpuUsage;
|
||||||
if (sysCpuUsage > 100) {
|
if (sysCpuUsage > 100) {
|
||||||
sysCpuUsage = +(info.neState.cpu.sysCpuUsage / 100).toFixed(2);
|
const sysCpu = +(info.neState.cpu.sysCpuUsage / 100);
|
||||||
|
if (sysCpu > 100) {
|
||||||
|
sysCpuUsage = 100;
|
||||||
|
} else {
|
||||||
|
sysCpuUsage = +sysCpu.toFixed(2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user