ui: QinQ: indentation and stricter limits

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-05-19 21:42:13 +02:00
parent 3f0b3e3aa2
commit 069a28ebac
2 changed files with 66 additions and 62 deletions

View File

@ -31,12 +31,12 @@ Ext.define('PVE.sdn.zones.BaseEdit', {
me.isCreate = !me.zone;
if (me.isCreate) {
me.url = '/api2/extjs/cluster/sdn/zones';
me.method = 'POST';
} else {
me.url = '/api2/extjs/cluster/sdn/zones/' + me.zone;
me.method = 'PUT';
}
me.url = '/api2/extjs/cluster/sdn/zones';
me.method = 'POST';
} else {
me.url = '/api2/extjs/cluster/sdn/zones/' + me.zone;
me.method = 'PUT';
}
var ipanel = Ext.create(me.paneltype, {
type: me.type,

View File

@ -4,68 +4,72 @@ Ext.define('PVE.sdn.zones.QinQInputPanel', {
onlineHelp: 'pvesdn_zone_plugin_qinq',
onGetValues: function(values) {
var me = this;
let me = this;
if (me.isCreate) {
values.type = me.type;
} else {
delete values.sdn;
}
if (me.isCreate) {
values.type = me.type;
} else {
delete values.sdn;
}
return values;
return values;
},
initComponent : function() {
var me = this;
me.items = [
{
xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'zone',
maxLength: 8,
value: me.zone || '',
fieldLabel: 'ID',
allowBlank: false
},
{
xtype: 'textfield',
name: 'bridge',
fieldLabel: 'Bridge',
allowBlank: false,
},
{
xtype: 'proxmoxintegerfield',
name: 'tag',
fieldLabel: gettext('Service vlan'),
allowBlank: false
},
{
xtype: 'proxmoxKVComboBox',
name: 'vlan-protocol',
fieldLabel: gettext('Service vlan protocol'),
allowBlank: true,
value: '802.1q',
comboItems: [['802.1q', '802.1q'], ['802.1ad', '802.1ad']]
},
{
xtype: 'proxmoxintegerfield',
name: 'mtu',
minValue: 100,
maxValue: 65000,
fieldLabel: 'MTU',
skipEmptyText: true,
allowBlank: true,
emptyText: 'auto'
},
{
xtype: 'pveNodeSelector',
name: 'nodes',
fieldLabel: gettext('Nodes'),
emptyText: gettext('All') + ' (' + gettext('No restrictions') +')',
multiSelect: true,
autoSelect: false
},
let me = this;
me.items = [
{
xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'zone',
maxLength: 8,
value: me.zone || '',
fieldLabel: 'ID',
allowBlank: false
},
{
xtype: 'textfield',
name: 'bridge',
fieldLabel: 'Bridge',
allowBlank: false,
},
{
xtype: 'proxmoxintegerfield',
name: 'tag',
minValue: 0,
maxValue: 4096,
fieldLabel: gettext('Service VLAN'),
allowBlank: false
},
{
xtype: 'proxmoxKVComboBox',
name: 'vlan-protocol',
fieldLabel: gettext('Service-VLAN Protocol'),
allowBlank: true,
value: '802.1q',
comboItems: [
['802.1q', '802.1q'],
['802.1ad', '802.1ad'],
],
},
{
xtype: 'proxmoxintegerfield',
name: 'mtu',
minValue: 100,
maxValue: 65000,
fieldLabel: 'MTU',
skipEmptyText: true,
allowBlank: true,
emptyText: 'auto'
},
{
xtype: 'pveNodeSelector',
name: 'nodes',
fieldLabel: gettext('Nodes'),
emptyText: gettext('All') + ' (' + gettext('No restrictions') +')',
multiSelect: true,
autoSelect: false
},
];
me.callParent();