From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v2] ui: resource mappings: fix editing of mapping for non first node
Date: Fri, 26 Jul 2024 09:40:17 +0200 [thread overview]
Message-ID: <20240726074017.503172-1-d.csapak@proxmox.com> (raw)
when editing the pci mapping, we set the nodename of the pci/usbselector
to the selected node. At the same time we disable and hide the node
selector, but it still changes it's value to the 'first' node
(alphabetically sorted) and that triggers a change event.
To prevent that we accidentally set the node of the pci/usbselector
too, we need to check here if the field is disabled.
There seems to be a race when loading the nodes for the nodeselector
which leads to inconsistent behaviour, so this was only encountered for
the pciselector, but theoretically it could also happen for the
usbselector so adding that condition to both.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
changes from v1:
* also fixed it for usbselector, but mention in the commit message that
this is just a safety measure and was never encountered there
www/manager6/window/PCIMapEdit.js | 6 ++++--
www/manager6/window/USBMapEdit.js | 8 +++++---
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/www/manager6/window/PCIMapEdit.js b/www/manager6/window/PCIMapEdit.js
index d43f04eb..faf58255 100644
--- a/www/manager6/window/PCIMapEdit.js
+++ b/www/manager6/window/PCIMapEdit.js
@@ -126,8 +126,10 @@ Ext.define('PVE.window.PCIMapEditWindow', {
this.lookup('pciselector').setMdev(value);
},
- nodeChange: function(_field, value) {
- this.lookup('pciselector').setNodename(value);
+ nodeChange: function(field, value) {
+ if (!field.isDisabled()) {
+ this.lookup('pciselector').setNodename(value);
+ }
},
pciChange: function(_field, value) {
diff --git a/www/manager6/window/USBMapEdit.js b/www/manager6/window/USBMapEdit.js
index 358f0778..69a40026 100644
--- a/www/manager6/window/USBMapEdit.js
+++ b/www/manager6/window/USBMapEdit.js
@@ -101,9 +101,11 @@ Ext.define('PVE.window.USBMapEditWindow', {
usbsel.setDisabled(!value);
},
- nodeChange: function(_field, value) {
- this.lookup('id').setNodename(value);
- this.lookup('path').setNodename(value);
+ nodeChange: function(field, value) {
+ if (!field.isDisabled()) {
+ this.lookup('id').setNodename(value);
+ this.lookup('path').setNodename(value);
+ }
},
--
2.39.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next reply other threads:[~2024-07-26 7:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-26 7:40 Dominik Csapak [this message]
2024-07-26 9:10 ` [pve-devel] applied: " Fiona Ebner
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=20240726074017.503172-1-d.csapak@proxmox.com \
--to=d.csapak@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox