[pve-devel] [PATCH manager v2] add tooltips to the tree

Dominik Csapak d.csapak at proxmox.com
Tue Mar 26 08:11:25 CET 2019


to give the user better feedback about the various icons (play, pause,
warning, error, etc) add a tooltip to the tree elements which
contain that information

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* check for groupbyid to not have undefined status for groups in folderview
 www/manager6/tree/ResourceTree.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index 28135d0e..74ad41b3 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -131,12 +131,26 @@ Ext.define('PVE.tree.ResourceTree', {
 	info.text = status + info.text;
     },
 
+    setToolTip: function(info) {
+	if (info.type === 'pool' || info.groupbyid !== undefined) {
+	    return;
+	}
+
+	var qtips = [gettext('Status') + ': ' + (info.qmpstatus || info.status)];
+	if (info.hastate != 'unmanaged') {
+	    qtips.push(gettext('HA State') + ": " + info.hastate);
+	}
+
+	info.qtip = qtips.join(', ');
+    },
+
     // private
     addChildSorted: function(node, info) {
 	var me = this;
 
 	me.setIconCls(info);
 	me.setText(info);
+	me.setToolTip(info);
 
 	var defaults;
 	if (info.groupbyid) {
@@ -301,6 +315,7 @@ Ext.define('PVE.tree.ResourceTree', {
 			Ext.apply(info, item.data);
 			me.setIconCls(info);
 			me.setText(info);
+			me.setToolTip(info);
 			olditem.commit();
 		    }
 		    if ((!item || moved) && olditem.isLeaf()) {
-- 
2.11.0





More information about the pve-devel mailing list