[pmg-devel] applied: [PATCH widget-toolkit 1/1] add DnsOrIp vtype

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Mar 14 07:44:14 CET 2019


On 3/13/19 3:17 PM, Dominik Csapak wrote:
> this is useful for options that can be dns names or ips (e.g. ldap servers)
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  Toolkit.js | 11 +++++++++++
>  1 file changed, 11 insertions(+)

applied, thanks!

> 
> diff --git a/Toolkit.js b/Toolkit.js
> index 4f1b623..bb9157f 100644
> --- a/Toolkit.js
> +++ b/Toolkit.js
> @@ -108,6 +108,17 @@ Ext.apply(Ext.form.field.VTypes, {
>      },
>      proxmoxMailText: gettext('Example') + ": user at 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;
> 




More information about the pmg-devel mailing list