mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
修复直接100%的问题
This commit is contained in:
parent
41c4e2c1a0
commit
0b8e7aca65
@ -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);
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user