]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
cpuset: test only the regex
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 10 Nov 2022 09:51:56 +0000 (10:51 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 10 Nov 2022 09:51:56 +0000 (10:51 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/Toolkit.js

index 9a13ba5ddc516e0d4320af98ba120707c775af61..4381f46c88c6793592170c9e704db8dc5ea3c442 100644 (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'),