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 2920A1FF13B for ; Wed, 20 May 2026 17:45:35 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F0446EAA2; Wed, 20 May 2026 17:45:34 +0200 (CEST) Message-ID: <73b18509-90b8-405a-8fe5-210ffc259615@proxmox.com> Date: Wed, 20 May 2026 17:45:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH manager] sdn: fabrics: disable prefix editing when nodes exist To: Gabriel Goller , pve-devel@lists.proxmox.com References: <20260520151236.395956-1-g.goller@proxmox.com> <20260520151236.395956-2-g.goller@proxmox.com> From: Hannes Laimer Content-Language: en-US In-Reply-To: <20260520151236.395956-2-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: 1779291915730 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: AN2DE66UHX4YAVOU7CMZL6XHEICCYNA3 X-Message-ID-Hash: AN2DE66UHX4YAVOU7CMZL6XHEICCYNA3 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: > Do not allow editing the fabric IPv4 or IPv6 prefix while the fabric > still has configured nodes. The API will throw an error, but this > improves the UX. > > Suggested-by: Hannes Laimer > Signed-off-by: Gabriel Goller > --- > www/manager6/sdn/FabricsView.js | 5 +++++ > www/manager6/sdn/fabrics/FabricEdit.js | 4 ++++ > 2 files changed, 9 insertions(+) > > diff --git a/www/manager6/sdn/FabricsView.js b/www/manager6/sdn/FabricsView.js > index f2b8456a7720..88926462df11 100644 > --- a/www/manager6/sdn/FabricsView.js > +++ b/www/manager6/sdn/FabricsView.js > @@ -310,6 +310,10 @@ Ext.define('PVE.sdn.Fabric.View', { > return prefix === 'deleted' ? undefined : prefix; > }, > > + fabricHasConfiguredNodes: function (fabric) { > + return (fabric.children ?? []).some((node) => node.state !== 'deleted'); > + }, > + > addWireGuard: function () { > let me = this; > me.openFabricAddWindow('wireguard'); > @@ -406,6 +410,7 @@ Ext.define('PVE.sdn.Fabric.View', { > let window = Ext.create(component, { > autoShow: true, > fabricId: fabric.id, > + disableIpPrefixEdit: me.fabricHasConfiguredNodes(fabric), > }); > > window.on('destroy', () => me.reload()); > diff --git a/www/manager6/sdn/fabrics/FabricEdit.js b/www/manager6/sdn/fabrics/FabricEdit.js > index 740719b1cc62..ddecbdc83df3 100644 > --- a/www/manager6/sdn/fabrics/FabricEdit.js > +++ b/www/manager6/sdn/fabrics/FabricEdit.js > @@ -9,6 +9,8 @@ Ext.define('PVE.sdn.Fabric.Fabric.Edit', { > hasIpv4Support: true, > hasIpv6Support: true, > > + disableIpPrefixEdit: false, > + > baseUrl: '/cluster/sdn/fabrics/fabric', > > viewModel: { > @@ -60,6 +62,7 @@ Ext.define('PVE.sdn.Fabric.Fabric.Edit', { > fieldLabel: gettext('IPv4 Prefix'), > labelWidth: 120, > name: 'ip_prefix', > + disabled: me.disableIpPrefixEdit, > allowBlank: me.hasIpv6Support, > vtype: 'IPCIDRAddress', > skipEmptyText: true, > @@ -82,6 +85,7 @@ Ext.define('PVE.sdn.Fabric.Fabric.Edit', { > fieldLabel: gettext('IPv6 Prefix'), > labelWidth: 120, > name: 'ip6_prefix', > + disabled: me.disableIpPrefixEdit, > allowBlank: true, > vtype: 'IP6CIDRAddress', > skipEmptyText: true,