ui: resource tree: add usage percentage to storage tooltip

it is a bit more verbose than the usage bar

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-11-10 11:13:00 +01:00 committed by Thomas Lamprecht
parent 1ed8e0096b
commit 872e9978fd

View File

@ -146,6 +146,12 @@ Ext.define('PVE.tree.ResourceTree', {
if (info.hastate !== 'unmanaged') {
qtips.push(gettext('HA State') + ": " + info.hastate);
}
if (info.type === 'storage') {
let usage = info.disk / info.maxdisk;
if (usage >= 0.0 && usage <= 1.0) {
qtips.push(Ext.String.format(gettext("Usage: {0}%"), (usage*100).toFixed(2)));
}
}
let tip = qtips.join(', ');
info.tip = tip;