[pve-devel] [PATCH manager] add subscription panel on dc summary

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Mar 4 12:10:16 CET 2019


On 3/1/19 2:27 PM, Dominik Csapak wrote:
> So that the users have a good and fast feedback about ther
> support and subscripttion status, especially if they have
> mistakenly different levels of susbscriptions in their cluster.
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> this is modeled after the subscription panel in the pmg dashboard,
> but differently enough, so that a refactor would be more work than
> what we would gain


works good in general, but the duration between setting a subscription key
and having a valid state here seems to be a bit long, feels even longer than
the 3 seconds of update interval here, but maybe it seems just like this.

Also I'm not sure about the wording, maybe instead of "You" we should say
"The cluster", to make it more clearer about what this is?
But if there not really better suggestions I can also apply this as is.

>  www/manager6/dc/Summary.js | 52 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
> 
> diff --git a/www/manager6/dc/Summary.js b/www/manager6/dc/Summary.js
> index d2a52ff3..55a76bf0 100644
> --- a/www/manager6/dc/Summary.js
> +++ b/www/manager6/dc/Summary.js
> @@ -59,6 +59,16 @@ Ext.define('PVE.dc.Summary', {
>  	    itemId: 'nodeview',
>  	    xtype: 'pveDcNodeView',
>  	    height: 250
> +	},
> +	{
> +	    title: gettext('Subscriptions'),
> +	    height: 220,
> +	    items: [
> +		{
> +		    itemId: 'subscriptions',
> +		    xtype: 'pveHealthWidget'
> +		}
> +	    ]
>  	}
>      ],
>  
> @@ -208,6 +218,48 @@ Ext.define('PVE.dc.Summary', {
>  	var dcHealth = me.getComponent('dcHealth');
>  	me.mon(rstore, 'load', dcHealth.updateStatus, dcHealth);
>  
> +	var subs = me.down('#subscriptions');
> +	me.mon(rstore, 'load', function(store, records, success) {
> +	    var i;
> +	    var level;
> +	    var curlevel;
> +	    for (i = 0; i < records.length; i++) {
> +		if (records[i].get('type') !== 'node') {
> +		    continue;
> +		}
> +
> +		curlevel = records[i].get('level');
> +		if (level === undefined) {
> +		    level = curlevel;
> +		    continue;
> +		}
> +
> +		if (level !== curlevel) {
> +		    break;
> +		}
> +	    }
> +
> +	    if (level === '') {
> +		subs.setData({
> +		    title: gettext('No Subscription'),
> +		    iconCls: PVE.Utils.get_health_icon('critical', true),
> +		    text: gettext('You have at least one node without subscription.')
> +		});
> +	    } else if (level !== curlevel) {
> +		subs.setData({
> +		    title: gettext('Mixed Subscriptions'),
> +		    iconCls: PVE.Utils.get_health_icon('warning', true),
> +		    text: gettext('Warning: Your subscription levels are not the same.')
> +		});
> +	    } else {
> +		subs.setData({
> +		    title: PVE.Utils.render_support_level(level),
> +		    iconCls: PVE.Utils.get_health_icon('good', true),
> +		    text: gettext('Your subscription status is valid.')
> +		});
> +	    }
> +	});
> +
>  	me.on('destroy', function(){
>  	    rstore.stopUpdate();
>  	});
> 





More information about the pve-devel mailing list