From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: tree: show tooltips for all entries that have sensible information
Date: Thu, 14 Nov 2024 09:04:35 +0100 [thread overview]
Message-ID: <20241114080435.241891-1-d.csapak@proxmox.com> (raw)
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
next reply other threads:[~2024-11-14 8:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 8:04 Dominik Csapak [this message]
2024-11-14 18:09 ` [pve-devel] applied: " Thomas Lamprecht
2024-11-15 6:37 ` Dominik Csapak
2024-11-15 7:08 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241114080435.241891-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.