[pve-devel] [PATCH manager 3/7] add GuestStatusView and TemplateStatusView

Emmanuel Kasper e.kasper at proxmox.com
Thu Aug 18 11:34:20 CEST 2016



On 07/11/2016 03:46 PM, Dominik Csapak wrote:
> this implements the new StatusView class for
> guests and templates
> 
> using the new pveStatusView, we do not split the status
> panels per lxc/qemu, but for Template/Guest
> 
> this makes more sense, since the information which lxc
> and qemu guests have are more similar than what you want
> to display for templates/guests
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/panel/GuestStatusView.js    | 90 ++++++++++++++++++++++++++++++++
>  www/manager6/panel/TemplateStatusView.js | 69 ++++++++++++++++++++++++
>  2 files changed, 159 insertions(+)
>  create mode 100644 www/manager6/panel/GuestStatusView.js
>  create mode 100644 www/manager6/panel/TemplateStatusView.js
> 
> diff --git a/www/manager6/panel/GuestStatusView.js b/www/manager6/panel/GuestStatusView.js
> new file mode 100644
> index 0000000..f0178dd
> --- /dev/null
> +++ b/www/manager6/panel/GuestStatusView.js
> @@ -0,0 +1,90 @@
> +Ext.define('PVE.panel.GuestStatusView', {
> +    extend: 'PVE.panel.StatusView',
> +    alias: 'widget.pveGuestStatusView',
> +
> +    height: 300,
> +
> +    defaults: {
> +	xtype: 'pveInfoWidget',
> +	padding: '0 30 5 30',
> +	width: 394
> +    },


PVE.panel.TemplateStatusView has here a default widget width of
400. It this difference on purpose ? If yes can we have a comment for
explaining how do we come to this value ?

> +    items: [
> +	{
> +	    xtype: 'box',
> +	    height: 30
> +	},
> +	{
> +	    itemId: 'status',
> +	    title: gettext('Status'),
> +	    printBar: false,
> +	    textField: 'status'
> +	},
> +	{
> +	    itemId: 'hamanaged',
> +	    title: gettext('Managed by HA'),
> +	    printBar: false,
> +	    textField: 'ha',
> +	    renderer: PVE.Utils.format_ha
> +	},
> +	{
> +	    itemId: 'node',
> +	    title: gettext('Node'),
> +	    printBar: false
> +	},
> +	{
> +	    xtype: 'box',
> +	    height: 20
> +	},
> +	{
> +	    itemId: 'cpu',
> +	    title: gettext('CPU usage'),
> +	    valueField: 'cpu',
> +	    maxField: 'cpus',
> +	    renderer: PVE.Utils.render_cpu_usage,
> +	    calculate: Ext.identityFn
> +	},

I understand this work around is needed because the usage value is
already provided by the API contrary to the other widgets where we
calculate that. It is not obvious until we inspect the data returned by
the API call.

A comment would here help the future generations too.






More information about the pve-devel mailing list