height: 300,
+ cbindData: function(initialConfig) {
+ var me = this;
+ return {
+ isQemu: me.pveSelNode.data.type === 'qemu',
+ isLxc: me.pveSelNode.data.type === 'lxc',
+ };
+ },
+
layout: {
type: 'vbox',
- align: 'stretch'
+ align: 'stretch',
},
defaults: {
xtype: 'pveInfoWidget',
- padding: '2 25'
+ padding: '2 25',
},
items: [
{
xtype: 'box',
- height: 20
+ height: 20,
},
{
itemId: 'status',
title: gettext('Status'),
iconCls: 'fa fa-info fa-fw',
printBar: false,
- textField: 'status'
+ multiField: true,
+ renderer: function(record) {
+ var me = this;
+ var text = record.data.status;
+ var qmpstatus = record.data.qmpstatus;
+ if (qmpstatus && qmpstatus !== record.data.status) {
+ text += ' (' + qmpstatus + ')';
+ }
+ return text;
+ },
},
{
itemId: 'hamanaged',
title: gettext('HA State'),
printBar: false,
textField: 'ha',
- renderer: PVE.Utils.format_ha
+ renderer: PVE.Utils.format_ha,
},
{
+ xtype: 'pveInfoWidget',
itemId: 'node',
iconCls: 'fa fa-building fa-fw',
title: gettext('Node'),
- printBar: false
+ cbind: {
+ text: '{pveSelNode.data.node}',
+ },
+ printBar: false,
},
{
xtype: 'box',
- height: 15
+ height: 15,
},
{
itemId: 'cpu',
renderer: PVE.Utils.render_cpu_usage,
// in this specific api call
// we already have the correct value for the usage
- calculate: Ext.identityFn
+ calculate: Ext.identityFn,
},
{
itemId: 'memory',
iconCls: 'fa fa-fw pve-itype-icon-memory pve-icon',
title: gettext('Memory usage'),
valueField: 'mem',
- maxField: 'maxmem'
+ maxField: 'maxmem',
},
{
itemId: 'swap',
+ xtype: 'pveInfoWidget',
iconCls: 'fa fa-refresh fa-fw',
title: gettext('SWAP usage'),
valueField: 'swap',
- maxField: 'maxswap'
+ maxField: 'maxswap',
+ cbind: {
+ hidden: '{isQemu}',
+ disabled: '{isQemu}',
+ },
},
{
itemId: 'rootfs',
if (used === 0) {
return PVE.Utils.render_size(max);
} else {
- return PVE.Utils.render_size_usage(used,max);
+ return PVE.Utils.render_size_usage(used, max);
}
- }
+ },
},
{
xtype: 'box',
- height: 15
+ height: 15,
},
{
itemId: 'ips',
xtype: 'pveAgentIPView',
cbind: {
rstore: '{rstore}',
- pveSelNode: '{pveSelNode}'
- }
- }
+ pveSelNode: '{pveSelNode}',
+ hidden: '{isLxc}',
+ disabled: '{isLxc}',
+ },
+ },
],
updateTitle: function() {
me.setTitle(me.getRecordValue('name') + text);
},
-
- initComponent: function() {
- var me = this;
-
- me.callParent();
- if (me.pveSelNode.data.type !== 'lxc') {
- me.remove(me.getComponent('swap'));
- } else {
- me.remove(me.getComponent('ips'));
- }
- me.getComponent('node').updateValue(me.pveSelNode.data.node);
- }
});