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

Dominik Csapak d.csapak at proxmox.com
Mon Mar 25 16:36:36 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>
---
this is a similar patch to that from my 'lock in resources' series,
but without the lock part

this way we can have the tooltips now and add the locks later if we want

 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..db868262 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') {
+	    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