修复直接100%的问题

This commit is contained in:
奶爸 2019-12-11 15:56:47 +08:00
parent 41c4e2c1a0
commit 0b8e7aca65

View File

@ -134,6 +134,13 @@
const keys = Object.keys(statusCards.servers)
for (let i = 0; i < keys.length; 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++) {
const os = oldServers[j];
if (ns.ID == os.ID) {
@ -145,11 +152,8 @@
});
}
// 刷新进度条
const bars = [$('#' + ns.ID + ' .cpu.progress'),
$('#' + ns.ID + ' .mem.progress'),
$('#' + ns.ID + ' .swap.progress'),
$('#' + ns.ID + ' .disk.progress')]
bars.forEach(b => {
bars.forEach((b, i) => {
b.progress('set total', i == 0 ? 100 : b[0].dataset.total);
b.progress('update progress', b[0].dataset.value);
})
}