all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager] sdn: fabrics: disable prefix editing when nodes exist
Date: Wed, 20 May 2026 17:12:23 +0200	[thread overview]
Message-ID: <20260520151236.395956-2-g.goller@proxmox.com> (raw)
In-Reply-To: <20260520151236.395956-1-g.goller@proxmox.com>

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 <h.laimer@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 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,
-- 
2.47.3





  reply	other threads:[~2026-05-20 15:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 15:12 [PATCH manager] sdn: fabrics: show node address fields only for configured prefixes Gabriel Goller
2026-05-20 15:12 ` Gabriel Goller [this message]
2026-05-20 15:45   ` [PATCH manager] sdn: fabrics: disable prefix editing when nodes exist Hannes Laimer
2026-05-20 15:12 ` [PATCH manager] sdn: fabrics: require at least one prefix Gabriel Goller
2026-05-20 15:45   ` Hannes Laimer
2026-05-20 15:45 ` [PATCH manager] sdn: fabrics: show node address fields only for configured prefixes Hannes Laimer
2026-05-21  9:24 ` applied: " 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=20260520151236.395956-2-g.goller@proxmox.com \
    --to=g.goller@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal