add DnsOrIp vtype

this is useful for options that can be dns names or ips (e.g. ldap servers)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2019-03-13 15:17:09 +01:00 committed by Thomas Lamprecht
parent f90c941bc6
commit ba916e58a9

View File

@ -108,6 +108,17 @@ Ext.apply(Ext.form.field.VTypes, {
},
proxmoxMailText: gettext('Example') + ": user@example.com",
DnsOrIp: function(v) {
if (!Proxmox.Utils.DnsName_match.test(v) &&
!Proxmox.Utils.IP64_match.test(v))
{
return false;
}
return true;
},
DnsOrIpText: gettext('Not a valid DNS name or IP Address.'),
HostList: function(v) {
var list = v.split(/[\ \,\;]+/);
var i;