[pve-devel] [PATCH manager 2/3] ui: pool members: avoid sharing object for extra request parameters

Friedrich Weber f.weber at proxmox.com
Wed Apr 3 11:10:09 CEST 2024


Currently, all instances of `PVE.pool.AddVM` in a session share the
same `extraRequestParams` object. Right now, this does not cause any
problems because only one window can be active at a time, and all
relevant keys are always overwritten.

Still, in order to avoid hard-to-catch bugs due to the shared object
in the future, create a new `extraRequestParams` object for each
instance of `PVE.pool.AddVM`.

Signed-off-by: Friedrich Weber <f.weber at proxmox.com>
---

Notes:
    new in v2

 www/manager6/grid/PoolMembers.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/www/manager6/grid/PoolMembers.js b/www/manager6/grid/PoolMembers.js
index af6af1bd..4ffcde7f 100644
--- a/www/manager6/grid/PoolMembers.js
+++ b/www/manager6/grid/PoolMembers.js
@@ -6,10 +6,6 @@ Ext.define('PVE.pool.AddVM', {
     isAdd: true,
     isCreate: true,
 
-    extraRequestParams: {
-	'allow-move': 1,
-    },
-
     initComponent: function() {
 	var me = this;
 
@@ -19,7 +15,10 @@ Ext.define('PVE.pool.AddVM', {
 
 	me.url = '/pools/';
 	me.method = 'PUT';
-	me.extraRequestParams.poolid = me.pool;
+	me.extraRequestParams = {
+	    'allow-move': 1,
+	    poolid: me.pool,
+	};
 
 	var vmsField = Ext.create('Ext.form.field.Text', {
 	    name: 'vms',
-- 
2.39.2





More information about the pve-devel mailing list