]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: add tooltip to datastore in maintenance mode
authorHannes Laimer <h.laimer@proxmox.com>
Tue, 26 Apr 2022 06:23:35 +0000 (06:23 +0000)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 27 Apr 2022 17:21:19 +0000 (19:21 +0200)
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
www/NavigationTree.js

index c8ba234fc838cf51cecb11b82e9b0aa54b31f1dc..eea1d158d166583201b325a6857c2baf3c42b361 100644 (file)
@@ -127,9 +127,26 @@ Ext.define('PBS.store.NavigationStore', {
     },
 });
 
+Ext.define('CustomTreeListItem', {
+    extend: 'Ext.list.TreeItem',
+    xtype: 'qtiptreelistitem',
+    updateNode: function(node, oldNode) {
+       const qtip = node ? node.get('qtip') : null;
+       this.callParent([node, oldNode]);
+       if (qtip) {
+           this.element.dom.setAttribute('data-qtip', qtip);
+       } else {
+           this.element.dom.removeAttribute('data-qtip');
+       }
+    },
+});
+
 Ext.define('PBS.view.main.NavigationTree', {
     extend: 'Ext.list.Tree',
     xtype: 'navigationtree',
+    defaults: {
+       xtype: 'qtiptreelistitem',
+    },
 
     controller: {
        xclass: 'Ext.app.ViewController',
@@ -236,14 +253,17 @@ Ext.define('PBS.view.main.NavigationTree', {
                    j++;
                }
 
-               let iconCls = 'fa fa-database';
+               let [qtip, iconCls] = ['', 'fa fa-database'];
                const maintenance = records[i].data.maintenance;
                if (maintenance) {
+                   const [type, message] = PBS.Utils.parseMaintenanceMode(maintenance);
+                   qtip = `${type}${message ? ': ' + message : ''}`;
                    iconCls = 'fa fa-database pmx-tree-icon-custom maintenance';
                }
 
                const child = {
                    text: name,
+                   qtip,
                    path: `DataStore-${name}`,
                    iconCls,
                    leaf: true,