From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager] sdn: fabrics: require at least one prefix
Date: Wed, 20 May 2026 17:12:24 +0200 [thread overview]
Message-ID: <20260520151236.395956-3-g.goller@proxmox.com> (raw)
In-Reply-To: <20260520151236.395956-1-g.goller@proxmox.com>
Prevent removing the last remaining fabric prefix by requiring either an
IPv4 prefix or an IPv6 prefix. Again this is enforced by the API, but
improve the UX by validating in the frontend.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
www/manager6/sdn/fabrics/FabricEdit.js | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/www/manager6/sdn/fabrics/FabricEdit.js b/www/manager6/sdn/fabrics/FabricEdit.js
index ddecbdc83df3..e9e0d1fa6286 100644
--- a/www/manager6/sdn/fabrics/FabricEdit.js
+++ b/www/manager6/sdn/fabrics/FabricEdit.js
@@ -67,6 +67,18 @@ Ext.define('PVE.sdn.Fabric.Fabric.Edit', {
vtype: 'IPCIDRAddress',
skipEmptyText: true,
deleteEmpty: !me.isCreate,
+ validator: function (value) {
+ let ip6Prefix = this.up('window').down('[name=ip6_prefix]')?.getValue();
+ if (!me.hasIpv6Support || value || ip6Prefix) {
+ return true;
+ }
+ return gettext('Either IPv4 Prefix or IPv6 Prefix is required');
+ },
+ listeners: {
+ change: function (field) {
+ field.up('window').down('[name=ip6_prefix]')?.validate();
+ },
+ },
});
}
@@ -90,10 +102,19 @@ Ext.define('PVE.sdn.Fabric.Fabric.Edit', {
vtype: 'IP6CIDRAddress',
skipEmptyText: true,
deleteEmpty: !me.isCreate,
+ validator: function (value) {
+ let ipPrefix = this.up('window').down('[name=ip_prefix]')?.getValue();
+ if (value || ipPrefix) {
+ return true;
+ }
+ return gettext('Either IPv4 Prefix or IPv6 Prefix is required');
+ },
listeners: {
change: function (textbox, value) {
- let vm = textbox.up('window').getViewModel();
+ let win = textbox.up('window');
+ let vm = win.getViewModel();
vm.set('showIpv6ForwardingHint', !!value);
+ win.down('[name=ip_prefix]')?.validate();
},
},
},
--
2.47.3
next prev parent reply other threads:[~2026-05-20 15:13 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 ` [PATCH manager] sdn: fabrics: disable prefix editing when nodes exist Gabriel Goller
2026-05-20 15:45 ` Hannes Laimer
2026-05-20 15:12 ` Gabriel Goller [this message]
2026-05-20 15:45 ` [PATCH manager] sdn: fabrics: require at least one prefix 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-3-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.