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 '-';
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,
extend: 'Ext.panel.Panel',
alias: 'widget.pveQemuSummary',
- tbar: [ '->', { xtype: 'pveRRDTypeSelector' } ],
scrollable: true,
bodyPadding: 10,
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
});
- var rrdstore = Ext.create('PVE.data.RRDStore', {
- rrdurl: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/rrddata"
- });
+ if (template) {
- Ext.apply(me, {
- plugins: {
- ptype: 'lazyitems',
- items: [
- {
- xtype: 'container',
- layout: {
- type: 'column'
- },
- defaults: {
- padding: '0 10 10 0'
- },
- items: [
- {
+ Ext.apply(me, {
+ plugins: {
+ ptype: 'lazyitems',
+ items: [
+ {
+ xtype: 'container',
+ layout: {
+ type: 'column'
+ },
+ defaults: {
+ padding: '0 10 10 0'
+ },
+ items: [{
width: 800,
- height: 300,
layout: {
- type: 'hbox',
+ type: 'vbox',
align: 'stretch'
},
border: false,
items: [ statusview, notesview ]
+ }]
+ }
+ ]
+ },
+ listeners: {
+ activate: function() { notesview.load(); }
+ }
+ });
+
+ } else {
+ var rrdstore = Ext.create('PVE.data.RRDStore', {
+ rrdurl: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/rrddata"
+ });
+
+ Ext.apply(me, {
+ tbar: [ '->', { xtype: 'pveRRDTypeSelector' } ],
+ plugins: {
+ ptype: 'lazyitems',
+ items: [
+ {
+ xtype: 'container',
+ layout: {
+ type: 'column'
},
- {
- 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
+ defaults: {
+ padding: '0 10 10 0'
},
- {
- xtype: 'pveRRDChart',
- title: gettext('Disk IO'),
- pveSelNode: me.pveSelNode,
- fields: ['diskread','diskwrite'],
- store: rrdstore
- }
- ]
- }
- ]
- },
- listeners: {
- activate: function() {notesview.load(); rrdstore.startUpdate();},
- hide: rrdstore.stopUpdate,
- destroy: rrdstore.stopUpdate
- }
- });
+ 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
+ }
+ ]
+ }
+ ]
+ },
+ listeners: {
+ activate: function() {notesview.load(); rrdstore.startUpdate();},
+ hide: rrdstore.stopUpdate,
+ destroy: rrdstore.stopUpdate
+ }
+ });
+ }
me.callParent();
}