[pve-devel] [PATCH manager 2/8] add IP64AddressList vtype

Dominik Csapak d.csapak at proxmox.com
Thu Mar 15 16:21:30 CET 2018


this can be used for DNS Server list

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Toolkit.js | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/www/manager6/Toolkit.js b/www/manager6/Toolkit.js
index 6fd40106..0c9364bd 100644
--- a/www/manager6/Toolkit.js
+++ b/www/manager6/Toolkit.js
@@ -8,6 +8,22 @@ Ext.apply(Ext.form.field.VTypes, {
     QemuStartDate: function(v) {
 	return (/^(now|\d{4}-\d{1,2}-\d{1,2}(T\d{1,2}:\d{1,2}:\d{1,2})?)$/).test(v);
     },
-    QemuStartDateText: gettext('Format') + ': "now" or "2006-06-17T16:01:21" or "2006-06-17"'
+    QemuStartDateText: gettext('Format') + ': "now" or "2006-06-17T16:01:21" or "2006-06-17"',
+    IP64AddressList: function(v) {
+	var list = v.split(/[\ \,\;]+/);
+	var i;
+	for (i = 0; i < list.length; i++) {
+	    if (list[i] == '') {
+		continue;
+	    }
 
+	    if (!Proxmox.Utils.IP64_match.test(list[i])) {
+		return false;
+	    }
+	}
+
+	return true;
+    },
+    IP64AddressListText: gettext('Example') + ': 192.168.1.1,192.168.1.2',
+    IP64AddressListMask: /[A-Fa-f0-9\,\:\.\;\ ]/
 });
-- 
2.11.0





More information about the pve-devel mailing list