]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: resource mappings: fix editing of mapping for non first node
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 26 Jul 2024 07:40:17 +0000 (09:40 +0200)
committerFiona Ebner <f.ebner@proxmox.com>
Fri, 26 Jul 2024 09:08:07 +0000 (11:08 +0200)
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>
www/manager6/window/PCIMapEdit.js
www/manager6/window/USBMapEdit.js

index d43f04eb2f7e2468cbc08955904804ac98f5c996..faf58255fb8ac29c48ef238e2ec084077388f829 100644 (file)
@@ -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) {
index 358f0778bb57e18b7a4b9fbc29669345820a442b..69a40026604f5a2b6ae85d1ebd64cf649fbe6e8f 100644 (file)
@@ -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);
+           }
        },