var result = Proxmox.Utils.IP6_cidr_match.exec(v);
// limits according to JSON Schema see
// pve-common/src/PVE/JSONSchema.pm
- return (result !== null && result[1] >= 8 && result[1] <= 120);
+ return (result !== null && result[1] >= 8 && result[1] <= 128);
},
- IP6CIDRAddressText: gettext('Example') + ': 2001:DB8::42/64' + "<br>" + gettext('Valid CIDR Range') + ': 8-120',
+ IP6CIDRAddressText: gettext('Example') + ': 2001:DB8::42/64' + "<br>" + gettext('Valid CIDR Range') + ': 8-128',
IP6CIDRAddressMask: /[A-Fa-f0-9:\/]/,
IP6PrefixLength: function(v) {
IP64AddressText: gettext('Example') + ': 192.168.1.1 2001:DB8::42',
IP64AddressMask: /[A-Fa-f0-9\.:]/,
+ IP64CIDRAddress: function(v) {
+ var result = Proxmox.Utils.IP64_cidr_match.exec(v);
+ if (result === null) {
+ return false;
+ }
+ if (result[1] !== undefined) {
+ return result[1] >= 8 && result[1] <= 128;
+ } else if (result[2] !== undefined) {
+ return result[2] >= 8 && result[2] <= 32;
+ } else {
+ return false;
+ }
+ },
+ IP64CIDRAddressText: gettext('Example') + ': 192.168.1.1/24 2001:DB8::42/64',
+ IP64CIDRAddressMask: /[A-Fa-f0-9\.:\/]/,
+
MacAddress: function(v) {
return (/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/).test(v);
},
MacAddressText: gettext('Example') + ': 01:23:45:67:89:ab',
MacPrefix: function(v) {
- return (/^[a-f0-9]{2}(?::[a-f0-9]{2}){0,2}:?$/i).test(v);
+ return (/^[a-f0-9][02468ace](?::[a-f0-9]{2}){0,2}:?$/i).test(v);
},
MacPrefixMask: /[a-fA-F0-9:]/,
- MacPrefixText: gettext('Example') + ': 02:8f',
+ MacPrefixText: gettext('Example') + ': 02:8f - ' + gettext('only unicast addresses are allowed'),
BridgeName: function(v) {
return (/^vmbr\d{1,4}$/).test(v);
},
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;
passwordText: gettext('Passwords do not match')
});
+// Firefox 52+ Touchscreen bug
+// see https://www.sencha.com/forum/showthread.php?336762-Examples-don-t-work-in-Firefox-52-touchscreen/page2
+// and https://bugzilla.proxmox.com/show_bug.cgi?id=1223
+Ext.define('EXTJS_23846.Element', {
+ override: 'Ext.dom.Element'
+}, function(Element) {
+ var supports = Ext.supports,
+ proto = Element.prototype,
+ eventMap = proto.eventMap,
+ additiveEvents = proto.additiveEvents;
+
+ if (Ext.os.is.Desktop && supports.TouchEvents && !supports.PointerEvents) {
+ eventMap.touchstart = 'mousedown';
+ eventMap.touchmove = 'mousemove';
+ eventMap.touchend = 'mouseup';
+ eventMap.touchcancel = 'mouseup';
+
+ additiveEvents.mousedown = 'mousedown';
+ additiveEvents.mousemove = 'mousemove';
+ additiveEvents.mouseup = 'mouseup';
+ additiveEvents.touchstart = 'touchstart';
+ additiveEvents.touchmove = 'touchmove';
+ additiveEvents.touchend = 'touchend';
+ additiveEvents.touchcancel = 'touchcancel';
+
+ additiveEvents.pointerdown = 'mousedown';
+ additiveEvents.pointermove = 'mousemove';
+ additiveEvents.pointerup = 'mouseup';
+ additiveEvents.pointercancel = 'mouseup';
+ }
+});
+
+Ext.define('EXTJS_23846.Gesture', {
+ override: 'Ext.event.publisher.Gesture'
+}, function(Gesture) {
+ var me = Gesture.instance;
+
+ if (Ext.supports.TouchEvents && !Ext.isWebKit && Ext.os.is.Desktop) {
+ me.handledDomEvents.push('mousedown', 'mousemove', 'mouseup');
+ me.registerEvents();
+ }
+});
+
+Ext.define('EXTJS_18900.Pie', {
+ override: 'Ext.chart.series.Pie',
+
+ // from 6.0.2
+ betweenAngle: function (x, a, b) {
+ var pp = Math.PI * 2,
+ offset = this.rotationOffset;
+
+ if (a === b) {
+ return false;
+ }
+
+ if (!this.getClockwise()) {
+ x *= -1;
+ a *= -1;
+ b *= -1;
+ a -= offset;
+ b -= offset;
+ } else {
+ a += offset;
+ b += offset;
+ }
+
+ x -= a;
+ b -= a;
+
+ // Normalize, so that both x and b are in the [0,360) interval.
+ x %= pp;
+ b %= pp;
+ x += pp;
+ b += pp;
+ x %= pp;
+ b %= pp;
+
+ // Because 360 * n angles will be normalized to 0,
+ // we need to treat b === 0 as a special case.
+ return x < b || b === 0;
+ },
+});
+
// we always want the number in x.y format and never in, e.g., x,y
Ext.define('PVE.form.field.Number', {
override: 'Ext.form.field.Number',