From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1D8FBA0FC0 for ; Fri, 10 Nov 2023 12:04:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 012141ECC3 for ; Fri, 10 Nov 2023 12:04:13 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 10 Nov 2023 12:04:12 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1B95E478F8 for ; Fri, 10 Nov 2023 12:04:12 +0100 (CET) Date: Fri, 10 Nov 2023 12:03:59 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20230614093033.820848-1-a.lauterer@proxmox.com> <20230614093033.820848-2-a.lauterer@proxmox.com> In-Reply-To: <20230614093033.820848-2-a.lauterer@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1699612956.608kpqvagx.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.067 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH widget-toolkit 2/4] fix #3892: Network: add bridge vids field for bridge_vids 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: , X-List-Received-Date: Fri, 10 Nov 2023 11:04:43 -0000 On June 14, 2023 11:30 am, Aaron Lauterer wrote: > The new optional bridge_vids field allows to set that property via the > GUI. Since the backend needs to support it, the field needs to be > explicitly enabled. >=20 > For now, Proxmox VE (PVE) is the use case. >=20 > Signed-off-by: Aaron Lauterer > --- > changes since v2: >=20 > add a new option to the NodeNetworkEdit widget called 'bridge_set_vids' > which determines if the field will be added. We need to pass it through > the NetworkView widget as well. >=20 > src/node/NetworkEdit.js | 23 +++++++++++++++++++++++ > src/node/NetworkView.js | 5 +++++ > 2 files changed, 28 insertions(+) >=20 > diff --git a/src/node/NetworkEdit.js b/src/node/NetworkEdit.js > index bb9add3..799ca1e 100644 > --- a/src/node/NetworkEdit.js > +++ b/src/node/NetworkEdit.js > @@ -2,6 +2,9 @@ Ext.define('Proxmox.node.NetworkEdit', { > extend: 'Proxmox.window.Edit', > alias: ['widget.proxmoxNodeNetworkEdit'], > =20 > + // Enable to show the VLAN ID field > + bridge_set_vids: false, > + > initComponent: function() { > let me =3D this; > =20 > @@ -57,11 +60,28 @@ Ext.define('Proxmox.node.NetworkEdit', { > } > =20 > if (me.iftype =3D=3D=3D 'bridge') { > + let vids =3D Ext.create('Ext.form.field.Text', { > + fieldLabel: gettext('Bridge VIDS'), > + name: 'bridge_vids', > + emptyText: '2-4094', > + disabled: true, > + autoEl: { > + tag: 'div', > + 'data-qtip': gettext('Space-separated list of VLANs and ranges, fo= r example: 2 4 100-200'), > + }, > + }); we might want to validate the format here as well to give feedback right away? > column2.push({ > xtype: 'proxmoxcheckbox', > fieldLabel: gettext('VLAN aware'), > name: 'bridge_vlan_aware', > deleteEmpty: !me.isCreate, > + listeners: { > + change: function(f, newVal) { > + if (me.bridge_set_vids) { > + vids.setDisabled(!newVal); > + } > + }, > + }, > }); > column2.push({ > xtype: 'textfield', > @@ -72,6 +92,9 @@ Ext.define('Proxmox.node.NetworkEdit', { > 'data-qtip': gettext('Space-separated list of interfaces, for exam= ple: enp0s0 enp1s0'), > }, > }); > + if (me.bridge_set_vids) { > + advancedColumn2.push(vids); > + } > } else if (me.iftype =3D=3D=3D 'OVSBridge') { > column2.push({ > xtype: 'textfield', > diff --git a/src/node/NetworkView.js b/src/node/NetworkView.js > index 1d67ac8..c08cbfa 100644 > --- a/src/node/NetworkView.js > +++ b/src/node/NetworkView.js > @@ -33,6 +33,9 @@ Ext.define('Proxmox.node.NetworkView', { > =20 > showApplyBtn: false, > =20 > + // decides if VLAN IDs field for bridges is shown, depends on the pr= oduct if needed > + bridge_set_vids: false, > + > initComponent: function() { > let me =3D this; > =20 > @@ -100,6 +103,7 @@ Ext.define('Proxmox.node.NetworkView', { > nodename: me.nodename, > iface: rec.data.iface, > iftype: rec.data.type, > + bridge_set_vids: me.bridge_set_vids, > listeners: { > destroy: () =3D> reload(), > }, > @@ -170,6 +174,7 @@ Ext.define('Proxmox.node.NetworkView', { > nodename: me.nodename, > iftype: iType, > iface_default: findNextFreeInterfaceId(iDefault ?? iType), > + bridge_set_vids: me.bridge_set_vids, > onlineHelp: 'sysadmin_network_configuration', > listeners: { > destroy: () =3D> reload(), > --=20 > 2.39.2 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20