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 AA27FC0948 for ; Thu, 11 Jan 2024 17:01:42 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7A3B118004 for ; Thu, 11 Jan 2024 17:01:12 +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 ; Thu, 11 Jan 2024 17:01:11 +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 9E688490D2 for ; Thu, 11 Jan 2024 17:01:11 +0100 (CET) Message-ID: <9d7c868c-2a72-460b-8045-61d05f991547@proxmox.com> Date: Thu, 11 Jan 2024 17:01:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: de-AT, en-US To: Proxmox Backup Server development discussion , Stefan Lendl References: <20240111155303.1072675-1-s.lendl@proxmox.com> <20240111155303.1072675-21-s.lendl@proxmox.com> From: Lukas Wagner In-Reply-To: <20240111155303.1072675-21-s.lendl@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.004 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: [pbs-devel] [PATCH widget-toolkit 10/10] form: include VlanField from PVE X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jan 2024 16:01:42 -0000 Not a full review, just something that I spotted ;) See comment inline. On 1/11/24 16:53, Stefan Lendl wrote: > copied from PVE > > Signed-off-by: Stefan Lendl > --- > src/Makefile | 1 + > src/form/VlanField.js | 40 ++++++++++++++++++++++++++++++++++++++++ > src/node/NetworkEdit.js | 6 +++--- > 3 files changed, 44 insertions(+), 3 deletions(-) > create mode 100644 src/form/VlanField.js > > diff --git a/src/Makefile b/src/Makefile > index 01145b1..6c65763 100644 > --- a/src/Makefile > +++ b/src/Makefile > @@ -31,6 +31,7 @@ JSSRC= \ > form/ExpireDate.js \ > form/IntegerField.js \ > form/TextField.js \ > + form/VlanField.js \ > form/DateTimeField.js \ > form/Checkbox.js \ > form/KVComboBox.js \ > diff --git a/src/form/VlanField.js b/src/form/VlanField.js > new file mode 100644 > index 0000000..c30fa72 > --- /dev/null > +++ b/src/form/VlanField.js > @@ -0,0 +1,40 @@ > +Ext.define('Proxmox.form.field.VlanField', { > + extend: 'Ext.form.field.Number', > + alias: ['widget.proxmoxvlanfield'], > + > + deleteEmpty: false, > + > + emptyText: gettext('no VLAN'), > + > + fieldLabel: gettext('VLAN Tag'), > + > + allowBlank: true, > + > + getSubmitData: function() { > + var me = this, > + data = null, > + val; > + if (!me.disabled && me.submitValue) { > + val = me.getSubmitValue(); > + if (val) { > + data = {}; > + data[me.getName()] = val; > + } else if (me.deleteEmpty) { > + data = {}; > + data.delete = me.getName(); > + } > + } > + return data; > + }, Indentation seems to be off in this hunk (spaces instead of tabs+spaces) > + > + initComponent: function() { > + var me = this; > + > + Ext.apply(me, { > + minValue: 1, > + maxValue: 4094, > + }); > + > + me.callParent(); > + }, > +}); > diff --git a/src/node/NetworkEdit.js b/src/node/NetworkEdit.js > index bb9add3..b81a21d 100644 > --- a/src/node/NetworkEdit.js > +++ b/src/node/NetworkEdit.js > @@ -97,7 +97,7 @@ Ext.define('Proxmox.node.NetworkEdit', { > name: 'ovs_bridge', > }); > column2.push({ > - xtype: 'pveVlanField', > + xtype: 'proxmoxvlanfield', > deleteEmpty: !me.isCreate, > name: 'ovs_tag', > value: '', > @@ -140,7 +140,7 @@ Ext.define('Proxmox.node.NetworkEdit', { > }); > > column2.push({ > - xtype: 'pveVlanField', > + xtype: 'proxmoxvlanfield', > name: 'vlan-id', > value: me.vlanidvalue, > disabled: me.disablevlanid, > @@ -211,7 +211,7 @@ Ext.define('Proxmox.node.NetworkEdit', { > name: 'ovs_bridge', > }); > column2.push({ > - xtype: 'pveVlanField', > + xtype: 'proxmoxvlanfield', > deleteEmpty: !me.isCreate, > name: 'ovs_tag', > value: '', -- - Lukas