]> git.proxmox.com Git - pve-manager.git/commitdiff
fix #1208: add ballooning checkbox to memory edit
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 22 Nov 2016 14:28:10 +0000 (15:28 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 22 Nov 2016 15:39:12 +0000 (16:39 +0100)
when using fixed memory size, we implicitly deleted shares and
ballon, which removed a (manually) set balloon: 0,

to be able to set this via the gui, we add a checkbox to the fixed
memory edit (using variable memory always needs ballooning)

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

index 821a8ae526fc33299f2c0a601f0db3a2a5e0cf38..f979d409ac07a7edc0f816d7fbe191b95642c010 100644 (file)
@@ -12,7 +12,13 @@ Ext.define('PVE.qemu.MemoryInputPanel', {
 
        if (values.memoryType === 'fixed') {
            res = { memory: values.memory };
-           res['delete'] = "balloon,shares";
+           if (values.ballooning === '1') {
+               // if balloning is active if it is not explicitely set
+               res['delete'] = "balloon,shares";
+           } else {
+               res['delete'] = "shares";
+               res.balloon = 0;
+           }
        } else {
            res = { 
                memory: values.maxmemory,
@@ -45,6 +51,7 @@ Ext.define('PVE.qemu.MemoryInputPanel', {
                            return;
                        }
                        me.down('field[name=memory]').setDisabled(!value);
+                       me.down('field[name=ballooning]').setDisabled(!value);
                        me.down('field[name=maxmemory]').setDisabled(value);
                        me.down('field[name=balloon]').setDisabled(value);
                        me.down('field[name=shares]').setDisabled(value);
@@ -59,6 +66,15 @@ Ext.define('PVE.qemu.MemoryInputPanel', {
                labelAlign: 'right',
                labelWidth: labelWidth
            },
+           {
+               xtype: 'pvecheckbox',
+               hotplug: me.hotplug,
+               name: 'ballooning',
+               value: '1',
+               labelAlign: 'right',
+               labelWidth: labelWidth,
+               fieldLabel: gettext('Ballooning')
+           },
            {
                xtype: 'radiofield',
                name: 'memoryType',
@@ -169,6 +185,7 @@ Ext.define('PVE.qemu.MemoryEdit', {
                    memory: data.memory,
                    maxmemory: data.memory,
                    balloon: data.balloon,
+                   ballooning: data.balloon === 0 ? '0' : '1',
                    shares: data.shares,
                    memoryType: data.balloon ? 'dynamic' : 'fixed'
                };