Signed-off-by: Aaron Lauterer <[email protected]>
---
 www/manager6/Utils.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index aafe359a..5190f750 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -1803,6 +1803,23 @@ Ext.define('PVE.Utils', {
 
        return undefined;
     },
+
+    nextFreeMP: function(type, config) {
+       let mptype = type === "mp" ? "mps" : type;
+
+       for (let i = 0; i < PVE.Utils.mp_counts[mptype]; i++) {
+           let confid = `${type}${i}`;
+           if (!Ext.isDefined(config[confid])) {
+               return {
+                   type,
+                   id: i,
+                   confid,
+               };
+           }
+       }
+
+       return undefined;
+    },
 },
 
     singleton: true,
-- 
2.30.2



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to