pve-manager/www/manager6/form/VLanField.js
Dominik Csapak c92d382579 change minValue of VLAN tag to 2
since linux bridges have untagged traffic on vlan1,
we cannot set this value

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-08 16:58:48 +02:00

41 lines
789 B
JavaScript

Ext.define('PVE.form.VlanField', {
extend: 'Ext.form.field.Number',
alias: ['widget.pveVlanField'],
deleteEmpty: false,
emptyText: '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: 2,
maxValue: 4094
});
me.callParent();
}
});