public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager 2/2] sdn: ipam: fix editing custom mappings
Date: Wed, 17 Jul 2024 15:06:03 +0200	[thread overview]
Message-ID: <20240717130603.127574-2-s.hanreich@proxmox.com> (raw)
In-Reply-To: <20240717130603.127574-1-s.hanreich@proxmox.com>

Currently custom mappings cannot be edited, due to them having no VMID
value. The VMID parameter was always sent by the frontend to the
update call - even if it was empty - leading to validation failure on
the backend. Fix this by only sending the vmid parameter when it is
actually set.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 www/manager6/tree/DhcpTree.js | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/www/manager6/tree/DhcpTree.js b/www/manager6/tree/DhcpTree.js
index d0b80803..6868bb60 100644
--- a/www/manager6/tree/DhcpTree.js
+++ b/www/manager6/tree/DhcpTree.js
@@ -156,15 +156,20 @@ Ext.define('PVE.sdn.DhcpTree', {
 	openEditWindow: function(data) {
 	    let me = this;
 
+	    let extraRequestParams = {
+		mac: data.mac,
+		zone: data.zone,
+		vnet: data.vnet,
+	    };
+
+	    if (data.vmid) {
+		extraRequestParams.vmid = data.vmid;
+	    }
+
 	    Ext.create('PVE.sdn.IpamEdit', {
 		autoShow: true,
 		mapping: data,
-		extraRequestParams: {
-		    vmid: data.vmid,
-		    mac: data.mac,
-		    zone: data.zone,
-		    vnet: data.vnet,
-		},
+		extraRequestParams,
 		listeners: {
 		    destroy: () => me.reload(),
 		},
-- 
2.39.2


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


  reply	other threads:[~2024-07-17 13:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-17 13:06 [pve-devel] [PATCH qemu-server 1/2] config: net: avoid duplicate ipam entries on nic update Stefan Hanreich
2024-07-17 13:06 ` Stefan Hanreich [this message]
2024-07-22 16:39   ` [pve-devel] applied: [PATCH pve-manager 2/2] sdn: ipam: fix editing custom mappings Thomas Lamprecht
2024-07-22 16:39 ` [pve-devel] applied: [PATCH qemu-server 1/2] config: net: avoid duplicate ipam entries on nic update Thomas Lamprecht

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=20240717130603.127574-2-s.hanreich@proxmox.com \
    --to=s.hanreich@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal