mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-19 14:43:37 +00:00
StatusView: fix usage calculation for fields without valid values
Sometimes, total can be zero (e.g. for swap when it's not used), which leads to the usage being NaN. This led to the progressbar not being updated for InfoWidgets, leaving a spurious '0%' as text. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
5c7c81d39b
commit
8315a64201
@ -47,7 +47,7 @@ Ext.define('Proxmox.panel.StatusView', {
|
||||
*/
|
||||
if (used.used !== undefined &&
|
||||
used.total !== undefined) {
|
||||
return used.used/used.total;
|
||||
return used.total > 0 ? used.used/used.total : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user