implement and use new DnsName vtype

This commit is contained in:
Dietmar Maurer 2012-03-13 07:14:00 +01:00
parent 24e48ad4e1
commit 1fcc2d4bed
2 changed files with 7 additions and 1 deletions

View File

@ -62,7 +62,12 @@ Ext.apply(Ext.form.field.VTypes, {
HttpProxy: function(v) {
return (/^http:\/\/.*$/).test(v);
},
HttpProxyText: gettext('Example') + ": http://username:password@host:port/"
HttpProxyText: gettext('Example') + ": http://username:password@host:port/",
DnsName: function(v) {
return (/^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$/).test(v);
},
DnsNameText: gettext('This is not a valid DNS name')
});
// we dont want that a displayfield set the form dirty flag!

View File

@ -28,6 +28,7 @@ Ext.define('PVE.qemu.Options', {
items: {
xtype: 'textfield',
name: 'name',
vtype: 'DnsName',
value: '',
fieldLabel: gettext('Name'),
allowBlank: true