[pve-devel] [RFC manager 5/9] gui: VMCPUFlagSelector: fix unknownFlags behaviour

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


...and typo in name.

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

diff --git a/www/manager6/form/VMCPUFlagSelector.js b/www/manager6/form/VMCPUFlagSelector.js
index ace3c531..a6d17930 100644
--- a/www/manager6/form/VMCPUFlagSelector.js
+++ b/www/manager6/form/VMCPUFlagSelector.js
@@ -14,7 +14,7 @@ Ext.define('PVE.form.VMCPUFlagSelector', {
     scrollable: 'y',
     height: 200,
 
-    unkownFlags: [],
+    unknownFlags: [],
 
     store: {
 	type: 'store',
@@ -59,7 +59,7 @@ Ext.define('PVE.form.VMCPUFlagSelector', {
 	    }
 	});
 
-	flags += me.unkownFlags.join(';');
+	flags += (flags.length > 0 ? ';' : '') + me.unknownFlags.join(';');
 
 	return flags;
     },
@@ -70,7 +70,7 @@ Ext.define('PVE.form.VMCPUFlagSelector', {
 
 	me.value = value || '';
 
-	me.unkownFlags = [];
+	me.unknownFlags = [];
 
 	me.getStore().queryBy(Ext.returnTrue).each(function(rec) {
 	    rec.set('state', '=');
@@ -79,13 +79,13 @@ Ext.define('PVE.form.VMCPUFlagSelector', {
 	var flags = value ? value.split(';') : [];
 	flags.forEach(function(flag) {
 	    var sign = flag.substr(0, 1);
-	    flag = flag.substr(1);
+	    let flagName = flag.substr(1);
 
-	    var rec = store.findRecord('flag', flag, 0, false, true, true);
+	    var rec = store.findRecord('flag', flagName, 0, false, true, true);
 	    if (rec !== null) {
 		rec.set('state', sign);
 	    } else {
-		me.unkownFlags.push(flag);
+		me.unknownFlags.push(flag);
 	    }
 	});
 	store.reload();
-- 
2.30.2





More information about the pve-devel mailing list