mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-06-03 00:01:44 +00:00

we have the information, so show it this does not change the output for vms, where we do not have any information about disk usage at all if we add the 'disk' info to vms, it will magically work there then Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
104 lines
2.0 KiB
JavaScript
104 lines
2.0 KiB
JavaScript
Ext.define('PVE.panel.GuestStatusView', {
|
|
extend: 'PVE.panel.StatusView',
|
|
alias: 'widget.pveGuestStatusView',
|
|
|
|
height: 300,
|
|
|
|
defaults: {
|
|
xtype: 'pveInfoWidget',
|
|
padding: '0 30 5 30',
|
|
// parent panel is 400 wide
|
|
// minus 2 pixels for the border
|
|
width: 398
|
|
},
|
|
items: [
|
|
{
|
|
xtype: 'box',
|
|
height: 30
|
|
},
|
|
{
|
|
itemId: 'status',
|
|
title: gettext('Status'),
|
|
printBar: false,
|
|
textField: 'status'
|
|
},
|
|
{
|
|
itemId: 'hamanaged',
|
|
title: gettext('HA State'),
|
|
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,
|
|
// in this specific api call
|
|
// we already have the correct value for the usage
|
|
calculate: Ext.identityFn
|
|
},
|
|
{
|
|
itemId: 'memory',
|
|
title: gettext('Memory usage'),
|
|
valueField: 'mem',
|
|
maxField: 'maxmem'
|
|
},
|
|
{
|
|
itemId: 'swap',
|
|
title: gettext('SWAP usage'),
|
|
valueField: 'swap',
|
|
maxField: 'maxswap'
|
|
},
|
|
{
|
|
itemId: 'rootfs',
|
|
title: gettext('Bootdisk size'),
|
|
valueField: 'disk',
|
|
maxField: 'maxdisk',
|
|
printBar: false,
|
|
renderer: function(used, max) {
|
|
var me = this;
|
|
me.setPrintBar(used > 0);
|
|
if (used === 0) {
|
|
return PVE.Utils.render_size(max);
|
|
} else {
|
|
return PVE.Utils.render_size_usage(used,max);
|
|
}
|
|
}
|
|
}
|
|
],
|
|
|
|
updateTitle: function() {
|
|
var me = this;
|
|
var uptime = me.getRecordValue('uptime');
|
|
|
|
var text = "";
|
|
if (Number(uptime) > 0) {
|
|
text = " (" + gettext('Uptime') + ': ' + Proxmox.Utils.format_duration_long(uptime)
|
|
+ ')';
|
|
}
|
|
|
|
me.setTitle(me.getRecordValue('name') + text);
|
|
},
|
|
|
|
initComponent: function() {
|
|
var me = this;
|
|
|
|
me.callParent();
|
|
if (me.pveSelNode.data.type !== 'lxc') {
|
|
me.remove(me.getComponent('swap'));
|
|
}
|
|
me.getComponent('node').updateValue(me.pveSelNode.data.node);
|
|
}
|
|
});
|