[pve-devel] applied: [PATCH manager v2 1/3] add optional icon to InfoWidget

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Feb 22 14:44:37 CET 2018


applied

On 2/22/18 2:32 PM, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/panel/InfoWidget.js | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/www/manager6/panel/InfoWidget.js b/www/manager6/panel/InfoWidget.js
> index fe1f87d3..829ee112 100644
> --- a/www/manager6/panel/InfoWidget.js
> +++ b/www/manager6/panel/InfoWidget.js
> @@ -16,9 +16,16 @@ Ext.define('PVE.widget.Info',{
>  	    itemId: 'label',
>  	    data: {
>  		title: '',
> -		usage: ''
> +		usage: '',
> +		iconCls: undefined
>  	    },
> -	    tpl: '<div class="left-aligned">{title}</div><div class="right-aligned">{usage}</div>'
> +	    tpl: [
> +		'<div class="left-aligned">',
> +		'<tpl if="iconCls">',
> +		'<i class="{iconCls}"></i> ',
> +		'</tpl>',
> +		'{title}</div> <div class="right-aligned">{usage}</div>'
> +	    ]
>  	},
>  	{
>  	    height: 2,
> @@ -42,6 +49,11 @@ Ext.define('PVE.widget.Info',{
>  	me.getComponent('progress').setVisible(enable);
>      },
>  
> +    setIconCls: function(iconCls) {
> +	var me = this;
> +	me.getComponent('label').data.iconCls = iconCls;
> +    },
> +
>      updateValue: function(text, usage) {
>  	var me = this;
>  	var label = me.getComponent('label');
> @@ -78,6 +90,7 @@ Ext.define('PVE.widget.Info',{
>  	me.getComponent('progress').setVisible(me.printBar);
>  
>  	me.updateValue(me.text, me.value);
> +	me.setIconCls(me.iconCls);
>      }
>  
>  });
> 





More information about the pve-devel mailing list