public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: resource mappings: fix editing of mapping for non first node
@ 2024-04-26  7:17 Dominik Csapak
  2024-07-24  9:44 ` Fiona Ebner
  2024-07-26  8:06 ` Dominik Csapak
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2024-04-26  7:17 UTC (permalink / raw)
  To: pve-devel

when editing the pci mapping, we set the nodename of the pciselector
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 pciselector
too, we need to check here if the field is disabled.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/window/PCIMapEdit.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 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) {
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH manager] ui: resource mappings: fix editing of mapping for non first node
  2024-04-26  7:17 [pve-devel] [PATCH manager] ui: resource mappings: fix editing of mapping for non first node Dominik Csapak
@ 2024-07-24  9:44 ` Fiona Ebner
  2024-07-26  8:06 ` Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2024-07-24  9:44 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

Am 26.04.24 um 09:17 schrieb Dominik Csapak:
> when editing the pci mapping, we set the nodename of the pciselector
> 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.
> 

It's the first node that's not in the disallowedNodes AFAICT.

> To prevent that we accidentally set the node of the pciselector
> too, we need to check here if the field is disabled.
> 

I wondered why the USB mappings don't suffer the same issue though. The
nodeChange() callback gets called with the correct value when editing
the mapping for a specific node, even though the node selector
definition and setting of disallowedNodes is the same as for the PCI
mappings.

Looking at Javascript backtraces, it seems like there might be some kind
of race going on (whether the me.getStore().load() for
PVE.form.NodeSelector finishes early or not), but not clue why it
happens for one, but not the other.

That said, adding a similar condition for the USB mappings would still
be good IMHO.

> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>

Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>

> ---
>  www/manager6/window/PCIMapEdit.js | 6 ++++--
>  1 file changed, 4 insertions(+), 2 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) {


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH manager] ui: resource mappings: fix editing of mapping for non first node
  2024-04-26  7:17 [pve-devel] [PATCH manager] ui: resource mappings: fix editing of mapping for non first node Dominik Csapak
  2024-07-24  9:44 ` Fiona Ebner
@ 2024-07-26  8:06 ` Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2024-07-26  8:06 UTC (permalink / raw)
  To: pve-devel

sent a v2: https://lists.proxmox.com/pipermail/pve-devel/2024-July/064916.html


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-26  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26  7:17 [pve-devel] [PATCH manager] ui: resource mappings: fix editing of mapping for non first node Dominik Csapak
2024-07-24  9:44 ` Fiona Ebner
2024-07-26  8:06 ` Dominik Csapak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal