[pve-devel] applied: [PATCH manager 2/2] ui: FirewallRules: Add tooltip to comments

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Feb 22 14:41:33 CET 2021


On 22.02.21 11:16, Aaron Lauterer wrote:
> The comment columns might not be wide enough for longer comments. Since
> it is the most right columns, it can be tricky to grab the right pixel
> to drag it wider.
> 
> A tooltip that shows up on hover should be okay.
> 
> Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
> ---
> 
> As an additional patch as I realized that the comment column can be a
> bit hard to use on smaller screens.

I fixed a style nit and bug and added a heuristic to only add it when
required (i.e., text length is ~ longer than cell width) in a followup.

> 
>  www/manager6/grid/FirewallRules.js | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js
> index 5a2241a0..f7f304b8 100644
> --- a/www/manager6/grid/FirewallRules.js
> +++ b/www/manager6/grid/FirewallRules.js
> @@ -763,8 +763,10 @@ Ext.define('PVE.FirewallRules', {
>  		dataIndex: 'comment',
>  		flex: 6,
>  		renderer: function(value, metaData, record) {
> -		    return render_errors('comment', Ext.util.Format.htmlEncode(value), metaData, record);
> -		},
> +		    let comment = render_errors('comment', Ext.util.Format.htmlEncode(value), metaData, record);
> +		    return `<span data-qtip="${comment}">${comment}</span>`;

returned literally "undefined" if no comment was set

> +},


bad indentation

> +
>  	    },
>  	);
>  
> 






More information about the pve-devel mailing list