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 775A51FF13B for ; Wed, 20 May 2026 17:45:28 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B0505E936; Wed, 20 May 2026 17:45:25 +0200 (CEST) Message-ID: <784e6ae6-fb07-4074-aada-ed893d23b359@proxmox.com> Date: Wed, 20 May 2026 17:45:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH manager] sdn: fabrics: show node address fields only for configured prefixes To: Gabriel Goller , pve-devel@lists.proxmox.com References: <20260520151236.395956-1-g.goller@proxmox.com> From: Hannes Laimer Content-Language: en-US In-Reply-To: <20260520151236.395956-1-g.goller@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1779291905207 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.083 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: BTM3V2XMWX4BXFZ52W33YCOVXPVFX2PE X-Message-ID-Hash: BTM3V2XMWX4BXFZ52W33YCOVXPVFX2PE X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Tested-by: Hannes Laimer On 2026-05-20 17:12, Gabriel Goller wrote: > Only show the IPv4 or IPv6 address field for a fabric node when the > fabric has the matching prefix configured. > > Suggested-by: Dominik Csapak > Signed-off-by: Gabriel Goller > --- > www/manager6/sdn/FabricsView.js | 13 +++++++++++-- > www/manager6/sdn/fabrics/NodeEdit.js | 9 +++++++-- > 2 files changed, 18 insertions(+), 4 deletions(-) > > diff --git a/www/manager6/sdn/FabricsView.js b/www/manager6/sdn/FabricsView.js > index 4676266d0413..f2b8456a7720 100644 > --- a/www/manager6/sdn/FabricsView.js > +++ b/www/manager6/sdn/FabricsView.js > @@ -305,6 +305,11 @@ Ext.define('PVE.sdn.Fabric.View', { > return NODE_PANELS[protocol]; > }, > > + getFabricPrefix: function (fabric, prefixKey) { > + let prefix = fabric?.[prefixKey]; > + return prefix === 'deleted' ? undefined : prefix; > + }, > + > addWireGuard: function () { > let me = this; > me.openFabricAddWindow('wireguard'); > @@ -370,6 +375,8 @@ Ext.define('PVE.sdn.Fabric.View', { > autoShow: true, > fabricId: fabric.id, > protocol: fabric.protocol, > + fabricIpPrefix: me.getFabricPrefix(fabric, 'ip_prefix'), > + fabricIp6Prefix: me.getFabricPrefix(fabric, 'ip6_prefix'), > disallowedNodes, > addAnotherCallback: () => { > let successCallback = () => { > @@ -404,7 +411,7 @@ Ext.define('PVE.sdn.Fabric.View', { > window.on('destroy', () => me.reload()); > }, > > - openNodeEditWindow: function (node) { > + openNodeEditWindow: function (node, fabric) { > let me = this; > > let component = me.getNodeEditPanel(node.protocol); > @@ -414,6 +421,8 @@ Ext.define('PVE.sdn.Fabric.View', { > fabricId: node.fabric_id, > nodeId: node.node_id, > protocol: node.protocol, > + fabricIpPrefix: me.getFabricPrefix(fabric, 'ip_prefix'), > + fabricIp6Prefix: me.getFabricPrefix(fabric, 'ip6_prefix'), > }); > > window.on('destroy', () => me.reload()); > @@ -425,7 +434,7 @@ Ext.define('PVE.sdn.Fabric.View', { > if (rec.data.type === 'fabric') { > me.openFabricEditWindow(rec.data); > } else if (rec.data.type === 'node') { > - me.openNodeEditWindow(rec.data); > + me.openNodeEditWindow(rec.data, rec.parentNode.data); > } else { > console.warn(`unknown type ${rec.data.type}`); > } > diff --git a/www/manager6/sdn/fabrics/NodeEdit.js b/www/manager6/sdn/fabrics/NodeEdit.js > index 2ed5336b3b49..ef4577cb67ba 100644 > --- a/www/manager6/sdn/fabrics/NodeEdit.js > +++ b/www/manager6/sdn/fabrics/NodeEdit.js > @@ -14,6 +14,9 @@ Ext.define('PVE.sdn.Fabric.Node.Edit', { > hasIpv4Support: true, > hasIpv6Support: true, > > + fabricIpPrefix: undefined, > + fabricIp6Prefix: undefined, > + > disallowedNodes: [], > > baseUrl: '/cluster/sdn/fabrics/node', > @@ -45,12 +48,13 @@ Ext.define('PVE.sdn.Fabric.Node.Edit', { > me.url = `${me.baseUrl}/${me.fabricId}`; > } > > - if (me.hasIpv4Support) { > + if (me.hasIpv4Support && me.fabricIpPrefix) { > me.items.push({ > xtype: 'proxmoxtextfield', > fieldLabel: gettext('IPv4'), > labelWidth: 120, > name: 'ip', > + vtype: 'IPAddress', > allowBlank: true, > skipEmptyText: true, > cbind: { > @@ -59,12 +63,13 @@ Ext.define('PVE.sdn.Fabric.Node.Edit', { > }); > } > > - if (me.hasIpv6Support) { > + if (me.hasIpv6Support && me.fabricIp6Prefix) { > me.items.push({ > xtype: 'proxmoxtextfield', > fieldLabel: gettext('IPv6'), > labelWidth: 120, > name: 'ip6', > + vtype: 'IP6Address', > allowBlank: true, > skipEmptyText: true, > cbind: {