[pve-devel] [PATCH manager 5/5] remove unnecessary information on template summary

Dominik Csapak d.csapak at proxmox.com
Wed Jun 15 15:21:09 CEST 2016


please ignore this patch (only the 5/5), i will send a better version
(removing also the tbar and the rrdstore)

On 06/15/2016 03:13 PM, Dominik Csapak wrote:
> since most of the information on the summary page is
> irrelevant for templates (e.g. status,ha,using memory,graphs, etc),
> we only show just the information which is available and helpful
>
> since we then have the vertical space, we move the notes panel
> below the statuspanel, to allow visually more space for the description
> (which makes sense for a template)
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/qemu/StatusView.js |  35 ++++++++-----
>  www/manager6/qemu/Summary.js    | 106 +++++++++++++++++++++++-----------------
>  2 files changed, 86 insertions(+), 55 deletions(-)
>
> diff --git a/www/manager6/qemu/StatusView.js b/www/manager6/qemu/StatusView.js
> index 3a2ac93..67e54d4 100644
> --- a/www/manager6/qemu/StatusView.js
> +++ b/www/manager6/qemu/StatusView.js
> @@ -16,6 +16,8 @@ Ext.define('PVE.qemu.StatusView', {
>  	    throw "no VM ID specified";
>  	}
>
> +	var template = !!me.pveSelNode.data.template;
> +
>  	var render_cpu = function(value, metaData, record, rowIndex, colIndex, store) {
>  	    if (!me.getObjectValue('uptime')) {
>  		return '-';
> @@ -40,17 +42,28 @@ Ext.define('PVE.qemu.StatusView', {
>  	    return text;
>  	};
>
> -	var rows = {
> -	    name: { header: gettext('Name'), defaultValue: 'no name specified' },
> -	    qmpstatus: { header: gettext('Status'), defaultValue: 'unknown' },
> -	    cpu: { header: gettext('CPU usage'), required: true,  renderer: render_cpu },
> -	    cpus: { visible: false },
> -	    mem: { header: gettext('Memory usage'), required: true,  renderer: render_mem },
> -	    maxmem: { visible: false },
> -	    maxdisk: { header: gettext('Bootdisk size'), renderer: PVE.Utils.render_size, required: true},
> -	    uptime: { header: gettext('Uptime'), required: true, renderer: PVE.Utils.render_uptime },
> -	    ha: { header: gettext('Managed by HA'), required: true, renderer: PVE.Utils.format_ha }
> -	};
> +	var rows = {};
> +
> +	if (template) {
> +	    rows = {
> +		name: { header: gettext('Name'), defaultValue: 'no name specified' },
> +		cpus: { header: gettext('Processors'), required: true},
> +		maxmem: { header: gettext('Memory'), renderer: PVE.Utils.render_size, required: true},
> +		maxdisk: { header: gettext('Bootdisk size'), renderer: PVE.Utils.render_size, required: true}
> +	    };
> +	} else {
> +	    rows = {
> +		name: { header: gettext('Name'), defaultValue: 'no name specified' },
> +		qmpstatus: { header: gettext('Status'), defaultValue: 'unknown' },
> +		cpu: { iconCls: 'fa fa-up', header: gettext('CPU usage'), required: true,  renderer: render_cpu },
> +		cpus: { visible: false },
> +		mem: { header: gettext('Memory usage'), required: true,  renderer: render_mem },
> +		maxmem: { visible: false },
> +		maxdisk: { header: gettext('Bootdisk size'), renderer: PVE.Utils.render_size, required: true},
> +		uptime: { header: gettext('Uptime'), required: true, renderer: PVE.Utils.render_uptime },
> +		ha: { header: gettext('Managed by HA'), required: true, renderer: PVE.Utils.format_ha }
> +	    };
> +	}
>
>  	Ext.applyIf(me, {
>  	    cwidth1: 150,
> diff --git a/www/manager6/qemu/Summary.js b/www/manager6/qemu/Summary.js
> index 5de8f79..be4193a 100644
> --- a/www/manager6/qemu/Summary.js
> +++ b/www/manager6/qemu/Summary.js
> @@ -27,18 +27,19 @@ Ext.define('PVE.qemu.Summary', {
>  	    throw "no status storage specified";
>  	}
>
> +	var template = !!me.pveSelNode.data.template;
>  	var rstore = me.statusStore;
>
>  	var statusview = Ext.create('PVE.qemu.StatusView', {
>  	    title: gettext('Status'),
>  	    pveSelNode: me.pveSelNode,
> -	    width: 400,
> +	    width: template ? 800 : 400,
>  	    rstore: rstore
>  	});
>
>  	var notesview = Ext.create('PVE.panel.NotesView', {
>  	    pveSelNode: me.pveSelNode,
> -	    padding: '0 0 0 10',
> +	    padding: template? '10 0 0 0' : '0 0 0 10',
>  	    flex: 1
>  	});
>
> @@ -46,6 +47,64 @@ Ext.define('PVE.qemu.Summary', {
>  	    rrdurl: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/rrddata"
>  	});
>
> +	var items = [];
> +	if (template) {
> +	    items.push({
> +		width: 800,
> +		layout: {
> +		    type: 'vbox',
> +		    align: 'stretch'
> +		},
> +		border: false,
> +		items: [ statusview, notesview ]
> +	    });
> +
> +
> +	} else {
> +	    items.push(
> +		{
> +		    width: 800,
> +		    height: 300,
> +		    layout: {
> +			type: 'hbox',
> +			align: 'stretch'
> +		    },
> +		    border: false,
> +		    items: [ statusview, notesview ]
> +		},
> +		{
> +		    xtype: 'pveRRDChart',
> +		    title: gettext('CPU usage'),
> +		    pveSelNode: me.pveSelNode,
> +		    fields: ['cpu'],
> +		    fieldTitles: [gettext('CPU usage')],
> +		    store: rrdstore
> +		},
> +		{
> +		    xtype: 'pveRRDChart',
> +		    title: gettext('Memory usage'),
> +		    pveSelNode: me.pveSelNode,
> +		    fields: ['maxmem', 'mem'],
> +		    fieldTitles: [gettext('Total'), gettext('RAM usage')],
> +		    store: rrdstore
> +		},
> +		{
> +		    xtype: 'pveRRDChart',
> +		    title: gettext('Network traffic'),
> +		    pveSelNode: me.pveSelNode,
> +		    fields: ['netin','netout'],
> +		    store: rrdstore
> +		},
> +		{
> +		    xtype: 'pveRRDChart',
> +		    title: gettext('Disk IO'),
> +		    pveSelNode: me.pveSelNode,
> +		    fields: ['diskread','diskwrite'],
> +		    store: rrdstore
> +		}
> +	    );
> +	}
> +
>  	Ext.apply(me, {
>  	    plugins: {
>  		ptype: 'lazyitems',
> @@ -58,48 +117,7 @@ Ext.define('PVE.qemu.Summary', {
>  			defaults: {
>  			    padding: '0 10 10 0'
>  			},
> -			items: [
> -			    {
> -				width: 800,
> -				height: 300,
> -				layout: {
> -				    type: 'hbox',
> -				    align: 'stretch'
> -				},
> -				border: false,
> -				items: [ statusview, notesview ]
> -			    },
> -			    {
> -				xtype: 'pveRRDChart',
> -				title: gettext('CPU usage'),
> -				pveSelNode: me.pveSelNode,
> -				fields: ['cpu'],
> -				fieldTitles: [gettext('CPU usage')],
> -				store: rrdstore
> -			    },
> -			    {
> -				xtype: 'pveRRDChart',
> -				title: gettext('Memory usage'),
> -				pveSelNode: me.pveSelNode,
> -				fields: ['maxmem', 'mem'],
> -				fieldTitles: [gettext('Total'), gettext('RAM usage')],
> -				store: rrdstore
> -			    },
> -			    {
> -				xtype: 'pveRRDChart',
> -				title: gettext('Network traffic'),
> -				pveSelNode: me.pveSelNode,
> -				fields: ['netin','netout'],
> -				store: rrdstore
> -			    },
> -			    {
> -				xtype: 'pveRRDChart',
> -				title: gettext('Disk IO'),
> -				pveSelNode: me.pveSelNode,
> -				fields: ['diskread','diskwrite'],
> -				store: rrdstore
> -			    }
> -			]
> +			items: items
>  		    }
>  		]
>  	    },
>




More information about the pve-devel mailing list