pve-manager/www/manager6/form/VLanField.js
Dominik Csapak fd42059338 allow tagging of vlan 1 in gui
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-18 11:32:15 +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: 1,
maxValue: 4094
});
me.callParent();
}
});