all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Friedrich Weber <f.weber@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 2/3] ui: pool members: avoid sharing object for extra request parameters
Date: Wed,  3 Apr 2024 11:10:09 +0200	[thread overview]
Message-ID: <20240403091010.11544-3-f.weber@proxmox.com> (raw)
In-Reply-To: <20240403091010.11544-1-f.weber@proxmox.com>

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@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





  parent reply	other threads:[~2024-04-03  9:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03  9:10 [pve-devel] [PATCH manager/widget-toolkit 0/3] ui: avoid UI bugs due to shared extra request params Friedrich Weber
2024-04-03  9:10 ` [pve-devel] [PATCH manager 1/3] ui: pool members: avoid setting request parameter for all edit windows Friedrich Weber
2024-04-03  9:10 ` Friedrich Weber [this message]
2024-04-03  9:10 ` [pve-devel] [PATCH widget-toolkit 3/3] window: edit: avoid shared object for extra request params Friedrich Weber
2024-04-04  8:22   ` Stefan Sterz
2024-04-04  9:01     ` Friedrich Weber
2024-04-04  9:23       ` Stefan Sterz
2024-04-04 10:10         ` Friedrich Weber
2024-04-04 10:54           ` Stefan Sterz
2024-04-04 11:04             ` Stefan Sterz
2024-04-04 10:59           ` Thomas Lamprecht
2024-04-04 11:28             ` Friedrich Weber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240403091010.11544-3-f.weber@proxmox.com \
    --to=f.weber@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal