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

Dominik Csapak d.csapak at proxmox.com
Wed Feb 27 12:32:36 CET 2019


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

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/tree/ResourceTree.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index e928c4bb..bf97adf6 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -131,12 +131,29 @@ Ext.define('PVE.tree.ResourceTree', {
 	info.text = status + info.text;
     },
 
+    setToolTip: function(info) {
+	if (info.type === 'pool') {
+	    return;
+	}
+
+	var qtips = [gettext('Status') + ': ' + (info.qmpstatus || info.status)];
+	if (info.lock) {
+	    qtips.push(gettext('Lock') + ': ' + info.lock);
+	}
+	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) {
@@ -306,6 +323,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