[pve-devel] applied: [PATCH manager] gui: ceph pools: fix pool % used display

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jul 2 10:46:20 CEST 2019


On 7/2/19 9:44 AM, Dominik Csapak wrote:
> nautilus uses values from 0 to 1 instead of 0 to 100
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/ceph/Pool.js | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
> index 522445f8..f0569425 100644
> --- a/www/manager6/ceph/Pool.js
> +++ b/www/manager6/ceph/Pool.js
> @@ -124,10 +124,14 @@ Ext.define('PVE.node.CephPoolList', {
>  		    width: 80,
>  		    sortable: true,
>  		    align: 'right',
> -		    renderer: Ext.util.Format.numberRenderer('0.00'),
> +		    renderer: function(val) {
> +			return Ext.util.Format.percent(val, '0.00');
> +		    },

applied, thanks!
Maybe we want to start using arrow functions more? E.g., here:

renderer: (val) => Ext.util.Format.percent(val, '0.00'),

would had done the trick to, and is IMO a little bit nicer/quicker to read.

>  		    dataIndex: 'percent_used',
>  		    summaryType: 'sum',
> -		    summaryRenderer: Ext.util.Format.numberRenderer('0.00')
> +		    summaryRenderer: function(val) {
> +			return Ext.util.Format.percent(val, '0.00');
> +		    },
>  		},
>  		{
>  		    header: gettext('Total'),
> 





More information about the pve-devel mailing list