修复直接100%的问题
This commit is contained in:
parent
41c4e2c1a0
commit
0b8e7aca65
@ -134,6 +134,13 @@
|
|||||||
const keys = Object.keys(statusCards.servers)
|
const keys = Object.keys(statusCards.servers)
|
||||||
for (let i = 0; i < keys.length; i++) {
|
for (let i = 0; i < keys.length; i++) {
|
||||||
const ns = statusCards.servers[keys[i]];
|
const ns = statusCards.servers[keys[i]];
|
||||||
|
// 进度条
|
||||||
|
const bars = [
|
||||||
|
$('#' + ns.ID + ' .cpu.progress'),
|
||||||
|
$('#' + ns.ID + ' .mem.progress'),
|
||||||
|
$('#' + ns.ID + ' .swap.progress'),
|
||||||
|
$('#' + ns.ID + ' .disk.progress')
|
||||||
|
]
|
||||||
for (let j = 0; j < oldServers.length; j++) {
|
for (let j = 0; j < oldServers.length; j++) {
|
||||||
const os = oldServers[j];
|
const os = oldServers[j];
|
||||||
if (ns.ID == os.ID) {
|
if (ns.ID == os.ID) {
|
||||||
@ -145,11 +152,8 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 刷新进度条
|
// 刷新进度条
|
||||||
const bars = [$('#' + ns.ID + ' .cpu.progress'),
|
bars.forEach((b, i) => {
|
||||||
$('#' + ns.ID + ' .mem.progress'),
|
b.progress('set total', i == 0 ? 100 : b[0].dataset.total);
|
||||||
$('#' + ns.ID + ' .swap.progress'),
|
|
||||||
$('#' + ns.ID + ' .disk.progress')]
|
|
||||||
bars.forEach(b => {
|
|
||||||
b.progress('update progress', b[0].dataset.value);
|
b.progress('update progress', b[0].dataset.value);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user