[pve-devel] [PATCH manager] ui: tree: show tooltips for all entries that have sensible information
Dominik Csapak
d.csapak at proxmox.com
Thu Nov 14 09:04:35 CET 2024
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 at 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
More information about the pve-devel
mailing list