]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: resource tree: add usage percentage to storage tooltip
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 10 Nov 2023 10:13:00 +0000 (11:13 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 12 Nov 2023 17:12:59 +0000 (18:12 +0100)
it is a bit more verbose than the usage bar

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/tree/ResourceTree.js

index ed51ac32e21d5078b42c49ff4790bb4b7ab9897d..acfa545aeac3e74ea46954f98ee995c71c493e55 100644 (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;