[pve-devel] [PATCH manager 2/2] fix #1629: improve min/max memory handling

Dominik Csapak d.csapak at proxmox.com
Thu Jan 25 15:55:11 CET 2018


instead of directly setting the minvalue when the maxvalue is lower
we invalidate it and only on blur we set the minvalue

without this we lose the minvalue when editing only the maxvalue

e.g.:

Max: 2048
Min: 1024

if we now edit the maxvalue to 4096, on pressing the '4', we are
setting the minvalue to '4' because 4 is lower than 1024

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/qemu/MemoryEdit.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/MemoryEdit.js b/www/manager6/qemu/MemoryEdit.js
index 1974abc4..6fda271b 100644
--- a/www/manager6/qemu/MemoryEdit.js
+++ b/www/manager6/qemu/MemoryEdit.js
@@ -101,10 +101,16 @@ Ext.define('PVE.qemu.MemoryInputPanel', {
 		    change: function(f, value) {
 			var bf = me.down('field[name=balloon]');
 			var balloon = bf.getValue();
+			bf.setMaxValue(value);
+			bf.validate();
+		    },
+		    blur: function(f) {
+			var value = f.getValue();
+			var bf = me.down('field[name=balloon]');
+			var balloon = bf.getValue();
 			if (balloon > value) {
 			    bf.setValue(value);
 			}
-			bf.setMaxValue(value);
 		    }
 		}
 	    },
-- 
2.11.0





More information about the pve-devel mailing list