Toolkit: add HostPort vtype

for easy checking textfield for a single host:port

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-10-01 09:57:55 +02:00 committed by Dietmar Maurer
parent a1d40d37ed
commit 5252b7f12b

View File

@ -147,6 +147,14 @@ Ext.apply(Ext.form.field.VTypes, {
},
DnsOrIpText: gettext('Not a valid DNS name or IP address.'),
HostPort: function(v) {
return Proxmox.Utils.HostPort_match.test(v) ||
Proxmox.Utils.HostPortBrackets_match.test(v) ||
Proxmox.Utils.IP6_dotnotation_match.test(v);
},
HostPortText: gettext('Not a valid hosts'),
HostList: function(v) {
let list = v.split(/[ ,;]+/);
let i;