]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/panel/GuestStatusView.js
8dab4c19b28c8d0bd77f800be14f0edd0408b0d7
1 Ext
.define('PVE.panel.GuestStatusView', {
2 extend
: 'PVE.panel.StatusView',
3 alias
: 'widget.pveGuestStatusView',
4 mixins
: ['Proxmox.Mixin.CBind'],
8 cbindData: function(initialConfig
) {
11 isQemu
: me
.pveSelNode
.data
.type
=== 'qemu',
12 isLxc
: me
.pveSelNode
.data
.type
=== 'lxc',
22 xtype
: 'pveInfoWidget',
32 title
: gettext('Status'),
33 iconCls
: 'fa fa-info fa-fw',
36 renderer: function(record
) {
38 var text
= record
.data
.status
;
39 var qmpstatus
= record
.data
.qmpstatus
;
40 if (qmpstatus
&& qmpstatus
!== record
.data
.status
) {
41 text
+= ' (' + qmpstatus
+ ')';
48 iconCls
: 'fa fa-heartbeat fa-fw',
49 title
: gettext('HA State'),
52 renderer
: PVE
.Utils
.format_ha
,
55 xtype
: 'pveInfoWidget',
57 iconCls
: 'fa fa-building fa-fw',
58 title
: gettext('Node'),
60 text
: '{pveSelNode.data.node}',
70 iconCls
: 'fa fa-fw pve-itype-icon-processor pve-icon',
71 title
: gettext('CPU usage'),
74 renderer
: PVE
.Utils
.render_cpu_usage
,
75 // in this specific api call
76 // we already have the correct value for the usage
77 calculate
: Ext
.identityFn
,
81 iconCls
: 'fa fa-fw pve-itype-icon-memory pve-icon',
82 title
: gettext('Memory usage'),
88 xtype
: 'pveInfoWidget',
89 iconCls
: 'fa fa-refresh fa-fw',
90 title
: gettext('SWAP usage'),
100 iconCls
: 'fa fa-hdd-o fa-fw',
101 title
: gettext('Bootdisk size'),
105 renderer: function(used
, max
) {
107 me
.setPrintBar(used
> 0);
109 return PVE
.Utils
.render_size(max
);
111 return PVE
.Utils
.render_size_usage(used
, max
);
121 xtype
: 'pveAgentIPView',
124 pveSelNode
: '{pveSelNode}',
131 updateTitle: function() {
133 var uptime
= me
.getRecordValue('uptime');
136 if (Number(uptime
) > 0) {
137 text
= " (" + gettext('Uptime') + ': ' + Proxmox
.Utils
.format_duration_long(uptime
)
141 me
.setTitle(me
.getRecordValue('name') + text
);