[pve-devel] [PATCH manager 2/5] ui: qemu/lxc: cpu edit: fix 'create' parameter for delete_if_default()

Fiona Ebner f.ebner at proxmox.com
Fri Oct 7 14:41:53 CEST 2022


For lxc, commit 3f40bc29 ("lxc/ResoureEdit: move some cpu fields to
advanced options") made the fields available in the create wizard, so
the comment is also wrong.

Both wizards do a 'delete kv.delete' in their onSubmit() function, so
it didn't actually matter in practice.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 www/manager6/lxc/ResourceEdit.js   | 5 ++---
 www/manager6/qemu/ProcessorEdit.js | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/www/manager6/lxc/ResourceEdit.js b/www/manager6/lxc/ResourceEdit.js
index f926d784..7b0d6886 100644
--- a/www/manager6/lxc/ResourceEdit.js
+++ b/www/manager6/lxc/ResourceEdit.js
@@ -46,9 +46,8 @@ Ext.define('PVE.lxc.CPUInputPanel', {
     onGetValues: function(values) {
 	var me = this;
 
-	// cpu{limit,unit} aren't in the wizard so create is always false
-	PVE.Utils.delete_if_default(values, 'cpulimit', '0', 0);
-	PVE.Utils.delete_if_default(values, 'cpuunits', '1024', 0);
+	PVE.Utils.delete_if_default(values, 'cpulimit', '0', me.insideWizard);
+	PVE.Utils.delete_if_default(values, 'cpuunits', '1024', me.insideWizard);
 
 	return values;
     },
diff --git a/www/manager6/qemu/ProcessorEdit.js b/www/manager6/qemu/ProcessorEdit.js
index 1bed2877..7bb4cc60 100644
--- a/www/manager6/qemu/ProcessorEdit.js
+++ b/www/manager6/qemu/ProcessorEdit.js
@@ -27,8 +27,8 @@ Ext.define('PVE.qemu.ProcessorInputPanel', {
 	    values.delete = values.delete.join(',');
 	}
 
-	PVE.Utils.delete_if_default(values, 'cpulimit', '0', 0);
-	PVE.Utils.delete_if_default(values, 'cpuunits', '1024', 0);
+	PVE.Utils.delete_if_default(values, 'cpulimit', '0', me.insideWizard);
+	PVE.Utils.delete_if_default(values, 'cpuunits', '1024', me.insideWizard);
 
 	// build the cpu options:
 	me.cpu.cputype = values.cputype;
-- 
2.30.2






More information about the pve-devel mailing list