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 ED7B01FF165 for ; Thu, 22 May 2025 18:21:56 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 78C91AE50; Thu, 22 May 2025 18:18:25 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Thu, 22 May 2025 18:17:28 +0200 Message-Id: <20250522161731.537011-73-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.219 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 17/18] ui: sdn: add evpn controller fabric integration 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" Expose the new fabric field added to the EVPN controller in the UI. Users can now select any fabric in the EVPN controller, instead of having to specify peers manually. This simplifies setting up an EVPN zone via SDN fabrics considerably. Since the peers field can now be empty, we have to adapt the existing field to allow empty values and properly send the delete property when updating a controller. Signed-off-by: Stefan Hanreich --- www/manager6/sdn/controllers/Base.js | 17 ++++++++++++ www/manager6/sdn/controllers/EvpnEdit.js | 35 ++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/www/manager6/sdn/controllers/Base.js b/www/manager6/sdn/controllers/Base.js index fd8bd9a05..f75080e4e 100644 --- a/www/manager6/sdn/controllers/Base.js +++ b/www/manager6/sdn/controllers/Base.js @@ -8,8 +8,25 @@ Ext.define('PVE.panel.SDNControllerBase', { if (me.isCreate) { values.type = me.type; + delete values.delete; } else { delete values.controller; + + 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]; + } + } + } } return values; diff --git a/www/manager6/sdn/controllers/EvpnEdit.js b/www/manager6/sdn/controllers/EvpnEdit.js index d04b3e544..f9fa0215c 100644 --- a/www/manager6/sdn/controllers/EvpnEdit.js +++ b/www/manager6/sdn/controllers/EvpnEdit.js @@ -25,10 +25,41 @@ Ext.define('PVE.sdn.controllers.EvpnInputPanel', { allowBlank: false, }, { - xtype: 'textfield', + xtype: 'proxmoxNetworkSelector', + name: 'fabric', + type: 'fabric', + valueField: 'iface', + displayField: 'iface', + fieldLabel: 'SDN Fabric', + allowBlank: true, + skipEmptyText: 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, + }, + ], + }, + }, + { + xtype: 'proxmoxtextfield', name: 'peers', fieldLabel: gettext('Peers'), - allowBlank: false, + allowBlank: true, + deleteEmpty: true, }, ]; -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel