[pbs-devel] [PATCH widget-toolkit v3 1/9] form: include vlan field widget from PVE

Folke Gleumes f.gleumes at proxmox.com
Thu Apr 18 11:40:11 CEST 2024


Just found that the patch was posted again with the same version, found
a small bug, will elaborate there.

On Thu, 2024-04-18 at 11:26 +0200, Folke Gleumes wrote:
> Retested the series against the current master on the request of
> Lukas.
> 
> 
> 
> Tested-by: Folke Gleumes <f.gleumes at proxmox.com>
> 
> On Thu, 2024-04-04 at 11:51 +0200, Stefan Lendl wrote:
> > Copied from PVE to use in PBS network configuration.
> > 
> > Signed-off-by: Stefan Lendl <s.lendl at proxmox.com>
> > Tested-by: Lukas Wagner <l.wagner at proxmox.com>
> > Reviewed-by: Lukas Wagner <l.wagner at proxmox.com>
> > ---
> >  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 89f9962..0b1e88c 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..71b580d
> > --- /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;
> > +    },
> > +
> > +    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: '',
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel



More information about the pbs-devel mailing list