applied with whitespace cleanup On Fri, Jul 15, 2016 at 10:34:37AM +0200, Wolfgang Bumiller wrote: > --- > * anchored the regex > * added regexText with an example > * changed the empty text to PVE.Util.noneText > > www/manager6/dc/OptionView.js | 37 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js > index 2149cb0..f02b870 100644 > --- a/www/manager6/dc/OptionView.js > +++ b/www/manager6/dc/OptionView.js > @@ -99,6 +99,32 @@ Ext.define('PVE.dc.EmailFromEdit', { > } > }); > > +Ext.define('PVE.dc.MacPrefixEdit', { > + extend: 'PVE.window.Edit', > + > + initComponent : function() { > + var me = this; > + > + Ext.applyIf(me, { > + subject: gettext('MAC address prefix'), > + items: { > + xtype: 'pvetextfield', > + name: 'mac_prefix', > + regex: /^[a-f0-9]{2}(?::[a-f0-9]{2}){0,2}:?$/i, > + regexText: gettext('Example') + ': 02:8f', > + emptyText: PVE.Utils.noneText, > + deleteEmpty: true, > + value: '', > + fieldLabel: gettext('MAC address prefix') > + } > + }); > + > + me.callParent(); > + > + me.load(); > + } > +}); > + > Ext.define('PVE.dc.OptionView', { > extend: 'PVE.grid.ObjectGrid', > alias: ['widget.pveDcOptionView'], > @@ -146,6 +172,17 @@ Ext.define('PVE.dc.OptionView', { > } > return value; > } > + }, > + mac_prefix: { > + header: gettext('MAC address prefix'), > + editor: 'PVE.dc.MacPrefixEdit', > + required: true, > + renderer: function(value) { > + if (!value) { > + return PVE.Utils.noneText; > + } > + return value; > + } > } > }; > > -- > 2.1.4 > > > _______________________________________________ > pve-devel mailing list > pve-devel@pve.proxmox.com > http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >
_______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel