public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: tree: show tooltips for all entries that have sensible information
@ 2024-11-14  8:04 Dominik Csapak
  2024-11-14 18:09 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2024-11-14  8:04 UTC (permalink / raw)
  To: pve-devel

instead of filtering pools and groups out manually, simply accumulate
the info we want to to have (status/hastate/etc.) and if any of those
exist, show the tooltip.

This results in the nodes also having a tooltip, including their hastate
(such as online/maintenance), and automatically would show such things
in the future if we add those fields to other entries.

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

diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index 312f958f..a7acdf93 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -148,11 +148,10 @@ Ext.define('PVE.tree.ResourceTree', {
     },
 
     getToolTip: function(info) {
-	if (info.type === 'pool' || info.groupbyid !== undefined) {
-	    return undefined;
+	let qtips = [];
+	if (info.qmpstatus || info.status) {
+	    qtips.push(gettext('Status') + ': ' + (info.qmpstatus || info.status));
 	}
-
-	let qtips = [gettext('Status') + ': ' + (info.qmpstatus || info.status)];
 	if (info.lock) {
 	    qtips.push(Ext.String.format(gettext('Config locked ({0})'), info.lock));
 	}
@@ -166,6 +165,10 @@ Ext.define('PVE.tree.ResourceTree', {
 	    }
 	}
 
+	if (qtips.length === 0) {
+	    return undefined;
+	}
+
 	let tip = qtips.join(', ');
 	info.tip = tip;
 	return tip;
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-14 18:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-14  8:04 [pve-devel] [PATCH manager] ui: tree: show tooltips for all entries that have sensible information Dominik Csapak
2024-11-14 18:09 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal