From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 1F7A91FF165 for ; Thu, 22 May 2025 18:35:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 86B49C459; Thu, 22 May 2025 18:35:46 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Thu, 22 May 2025 18:17:29 +0200 Message-Id: <20250522161731.537011-74-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250522161731.537011-1-s.hanreich@proxmox.com> References: <20250522161731.537011-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.213 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH pve-manager v3 18/18] ui: sdn: vxlan: add fabric property X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" VXLAN zones can now use fabrics instead of having to specify peers manually. Since the network selector doesn't implement deleteEmpty, we have to manually handle deleted properties in the VXLAN input panel. Signed-off-by: Stefan Hanreich --- www/manager6/sdn/zones/VxlanEdit.js | 52 +++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/www/manager6/sdn/zones/VxlanEdit.js b/www/manager6/sdn/zones/VxlanEdit.js index b556790df..575dd867f 100644 --- a/www/manager6/sdn/zones/VxlanEdit.js +++ b/www/manager6/sdn/zones/VxlanEdit.js @@ -8,8 +8,25 @@ Ext.define('PVE.sdn.zones.VxlanInputPanel', { if (me.isCreate) { values.type = me.type; + delete values.delete; } else { delete values.zone; + + for (const [key, value] of Object.entries(values)) { + if (value === null || value === undefined || value === "") { + delete values[key]; + + if (values.delete) { + if (Array.isArray(values.delete)) { + values.delete.push(key); + } else { + values.delete = [values.delete, key]; + } + } else { + values.delete = [key]; + } + } + } } delete values.mode; @@ -22,10 +39,41 @@ Ext.define('PVE.sdn.zones.VxlanInputPanel', { me.items = [ { - xtype: 'textfield', + xtype: 'proxmoxtextfield', name: 'peers', fieldLabel: gettext('Peer Address List'), - allowBlank: false, + allowBlank: true, + deleteEmpty: true, + }, + { + xtype: 'proxmoxNetworkSelector', + name: 'fabric', + type: 'fabric', + valueField: 'iface', + displayField: 'iface', + fieldLabel: 'SDN Fabric', + skipEmptyText: true, + allowBlank: true, + autoSelect: false, + emptyText: gettext('used as underlay network'), + nodename: 'localhost', + listConfig: { + width: 600, + columns: [ + { + header: gettext('Fabric'), + width: 90, + dataIndex: 'iface', + }, + { + + header: gettext('CIDR'), + dataIndex: 'cidr', + hideable: false, + flex: 1, + }, + ], + }, }, ]; -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel