ui: utils: add nextFreeMP

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Aaron Lauterer 2022-04-05 14:30:13 +02:00 committed by Thomas Lamprecht
parent 5747fef3d9
commit 000b5537fc

View File

@ -1800,6 +1800,21 @@ Ext.define('PVE.Utils', {
return undefined;
},
nextFreeMP: function(type, config) {
for (let i = 0; i < PVE.Utils.mp_counts[type]; i++) {
let confid = `${type}${i}`;
if (!Ext.isDefined(config[confid])) {
return {
type,
id: i,
confid,
};
}
}
return undefined;
},
},
singleton: true,