]> git.proxmox.com Git - pve-manager.git/commitdiff
use correct multiKey and getObjectValue calls for memory line
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 10 Apr 2018 14:36:17 +0000 (16:36 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 23 Apr 2018 10:12:47 +0000 (12:12 +0200)
also show shares and if ballooning is off

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/qemu/HardwareView.js

index 8017f84aba78692a241db3f41a8ade4a634a7ae6..17e755a8cdfbd7d783310b22fb93cce41ff4e3be 100644 (file)
@@ -50,14 +50,26 @@ Ext.define('PVE.qemu.HardwareView', {
                never_delete: true,
                defaultValue: '512',
                tdCls: 'pve-itype-icon-memory',
-               renderer: function(value, metaData, record) {
-                   var balloon =  me.getObjectValue('balloon');
-                   if (balloon) {
-                       return Proxmox.Utils.format_size(balloon*1024*1024) + "/" + 
-                           Proxmox.Utils.format_size(value*1024*1024);
-
-                   } 
-                   return Proxmox.Utils.format_size(value*1024*1024);
+               multiKey: ['memory', 'balloon', 'shares'],
+               renderer: function(value, metaData, record, ri, ci, store, pending) {
+                   var res = '';
+
+                   var max = me.getObjectValue('memory', 512, pending);
+                   var balloon =  me.getObjectValue('balloon', undefined, pending);
+                   var shares = me.getObjectValue('shares', undefined, pending);
+
+                   res  = Proxmox.Utils.format_size(max*1024*1024);
+
+                   if (balloon !== undefined && balloon > 0) {
+                       res = Proxmox.Utils.format_size(balloon*1024*1024) + "/" + res;
+
+                       if (shares) {
+                           res += ' [shares=' + shares +']';
+                       }
+                   } else if (balloon === 0) {
+                       res += ' [balloon=0]';
+                   }
+                   return res;
                }
            },
            sockets: {
@@ -146,8 +158,10 @@ Ext.define('PVE.qemu.HardwareView', {
            },
            bios: {
                visible: false
+           },
+           shares: {
+               visible: false
            }
-
        };
 
        PVE.Utils.forEachBus(undefined, function(type, id) {