]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/panel/GuestStatusView.js
ui: move NotesView panel and NotesEdit window to widget kit
[pve-manager.git] / www / manager6 / panel / GuestStatusView.js
index 2a17869a30878839a944d6c417710c79efe3451f..8db1f492c37330f81648170bdb4b8fa5a9169135 100644 (file)
@@ -1,38 +1,45 @@
 Ext.define('PVE.panel.GuestStatusView', {
-    extend: 'PVE.panel.StatusView',
+    extend: 'Proxmox.panel.StatusView',
     alias: 'widget.pveGuestStatusView',
     mixins: ['Proxmox.Mixin.CBind'],
 
-    height: 300,
-
-    cbindData: function (initialConfig) {
+    cbindData: function(initialConfig) {
        var me = this;
        return {
            isQemu: me.pveSelNode.data.type === 'qemu',
-           isLxc: me.pveSelNode.data.type === 'lxc'
+           isLxc: me.pveSelNode.data.type === 'lxc',
        };
     },
 
     layout: {
        type: 'vbox',
-       align: 'stretch'
+       align: 'stretch',
     },
 
     defaults: {
-       xtype: 'pveInfoWidget',
-       padding: '2 25'
+       xtype: 'pmxInfoWidget',
+       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',
@@ -40,51 +47,49 @@ Ext.define('PVE.panel.GuestStatusView', {
            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'),
            cbind: {
-               text: '{pveSelNode.data.node}'
+               text: '{pveSelNode.data.node}',
            },
-           printBar: false
+           printBar: false,
        },
        {
            xtype: 'box',
-           height: 15
+           height: 15,
        },
        {
            itemId: 'cpu',
-           iconCls: 'fa fa-fw pve-itype-icon-processor pve-icon',
+           iconCls: 'fa fa-fw pmx-itype-icon-processor pmx-icon',
            title: gettext('CPU usage'),
            valueField: 'cpu',
            maxField: 'cpus',
-           renderer: PVE.Utils.render_cpu_usage,
+           renderer: Proxmox.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',
+           iconCls: 'fa fa-fw pmx-itype-icon-memory pmx-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',
            cbind: {
                hidden: '{isQemu}',
-               disabled: '{isQemu}'
-           }
+               disabled: '{isQemu}',
+           },
        },
        {
            itemId: 'rootfs',
@@ -97,15 +102,15 @@ Ext.define('PVE.panel.GuestStatusView', {
                var me = this;
                me.setPrintBar(used > 0);
                if (used === 0) {
-                   return PVE.Utils.render_size(max);
+                   return Proxmox.Utils.render_size(max);
                } else {
-                   return PVE.Utils.render_size_usage(used,max);
+                   return Proxmox.Utils.render_size_usage(used, max);
                }
-           }
+           },
        },
        {
            xtype: 'box',
-           height: 15
+           height: 15,
        },
        {
            itemId: 'ips',
@@ -114,9 +119,9 @@ Ext.define('PVE.panel.GuestStatusView', {
                rstore: '{rstore}',
                pveSelNode: '{pveSelNode}',
                hidden: '{isLxc}',
-               disabled: '{isLxc}'
-           }
-       }
+               disabled: '{isLxc}',
+           },
+       },
     ],
 
     updateTitle: function() {
@@ -130,5 +135,5 @@ Ext.define('PVE.panel.GuestStatusView', {
        }
 
        me.setTitle(me.getRecordValue('name') + text);
-    }
+    },
 });