all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Timothy Nicholson <t.nicholson@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] fix #5879: ui: add tooltip to security group comments
Date: Mon, 18 Nov 2024 12:44:03 +0100	[thread overview]
Message-ID: <20241118114403.69941-1-t.nicholson@proxmox.com> (raw)

This patch adds a tooltip in the security group selector for group
comments that are too long to fit within the column width.

Signed-off-by: Timothy Nicholson <t.nicholson@proxmox.com>
---
 www/manager6/form/SecurityGroupSelector.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/www/manager6/form/SecurityGroupSelector.js b/www/manager6/form/SecurityGroupSelector.js
index 64db7542..8b1b4b1e 100644
--- a/www/manager6/form/SecurityGroupSelector.js
+++ b/www/manager6/form/SecurityGroupSelector.js
@@ -34,7 +34,13 @@ Ext.define('PVE.form.SecurityGroupsSelector', {
 		    {
 			header: gettext('Comment'),
 			dataIndex: 'comment',
-			renderer: Ext.String.htmlEncode,
+			renderer: function(value, metaData) {
+			    let comment = Ext.String.htmlEncode(value) || '';
+			    if (comment.length * 12 > metaData.column.cellWidth) {
+				comment = `<span data-qtip="${comment}">${comment}</span>`;
+			    }
+			    return comment;
+			},
 			flex: 1,
 		    },
 		],
-- 
2.39.5


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


             reply	other threads:[~2024-11-18 11:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 11:44 Timothy Nicholson [this message]
2024-11-18 21:26 ` [pve-devel] applied: " 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=20241118114403.69941-1-t.nicholson@proxmox.com \
    --to=t.nicholson@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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal