Commit 1fcc2d4b authored by Dietmar Maurer's avatar Dietmar Maurer

implement and use new DnsName vtype

parent 24e48ad4
...@@ -62,7 +62,12 @@ Ext.apply(Ext.form.field.VTypes, { ...@@ -62,7 +62,12 @@ Ext.apply(Ext.form.field.VTypes, {
HttpProxy: function(v) { HttpProxy: function(v) {
return (/^http:\/\/.*$/).test(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! // we dont want that a displayfield set the form dirty flag!
......
...@@ -28,6 +28,7 @@ Ext.define('PVE.qemu.Options', { ...@@ -28,6 +28,7 @@ Ext.define('PVE.qemu.Options', {
items: { items: {
xtype: 'textfield', xtype: 'textfield',
name: 'name', name: 'name',
vtype: 'DnsName',
value: '', value: '',
fieldLabel: gettext('Name'), fieldLabel: gettext('Name'),
allowBlank: true allowBlank: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment