[pve-devel] [RFC manager 6/9] gui: CPUModelSelector: fix dirty state on default

Stefan Reiter s.reiter at proxmox.com
Thu Oct 28 13:41:47 CEST 2021


"originalValue" is set to "null" in case it's the default, but
getValue() returns an empty string. This means that when editing a VM's
CPU config when the model is "default", the form would always be marked
dirty.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 www/manager6/form/CPUModelSelector.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/www/manager6/form/CPUModelSelector.js b/www/manager6/form/CPUModelSelector.js
index a30dd1fb..a4d883a4 100644
--- a/www/manager6/form/CPUModelSelector.js
+++ b/www/manager6/form/CPUModelSelector.js
@@ -45,6 +45,12 @@ Ext.define('PVE.form.CPUModelSelector', {
 	width: 360,
     },
 
+    getValue: function() {
+	let me = this;
+	let val = me.callParent();
+	return val === "" ? null : val;
+    },
+
     store: {
 	autoLoad: true,
 	model: 'PVE.data.CPUModel',
-- 
2.30.2






More information about the pve-devel mailing list