cpuset: test only the regex

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-11-10 10:51:56 +01:00
parent 9109c39202
commit 5ef8d10da6

View File

@ -122,22 +122,7 @@ Ext.apply(Ext.form.field.VTypes, {
HttpProxyText: gettext('Example') + ": http://username:password&#64;host:port/",
CpuSet: function(v) {
if (!Proxmox.Utils.CpuSet_match.test(v)) {
return false;
}
let groups = v.split(",");
for (let i = 0; i < groups.length; i++) {
if (!groups[i].includes("-")) {
continue;
}
let values = groups[i].split("-");
let left = parseInt(values[0], 10);
let right = parseInt(values[1], 10);
if (left > right) {
return false;
}
}
return true;
return Proxmox.Utils.CpuSet_match.test(v);
},
CpuSetText: gettext('This is not a valid CpuSet'),