mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-15 17:35:24 +00:00
cpuset: test only the regex
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9109c39202
commit
5ef8d10da6
@ -122,22 +122,7 @@ Ext.apply(Ext.form.field.VTypes, {
|
|||||||
HttpProxyText: gettext('Example') + ": http://username:password@host:port/",
|
HttpProxyText: gettext('Example') + ": http://username:password@host:port/",
|
||||||
|
|
||||||
CpuSet: function(v) {
|
CpuSet: function(v) {
|
||||||
if (!Proxmox.Utils.CpuSet_match.test(v)) {
|
return 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;
|
|
||||||
},
|
},
|
||||||
CpuSetText: gettext('This is not a valid CpuSet'),
|
CpuSetText: gettext('This is not a valid CpuSet'),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user