mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-07 14:15:18 +00:00
ui: fix disk controllers sortByPreviousUsage iteration
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
4415d038c0
commit
96ed94ad6f
@ -8,11 +8,11 @@ Ext.define('PVE.form.ControllerSelector', {
|
|||||||
|
|
||||||
sortByPreviousUsage: function(vmconfig, controllerList) {
|
sortByPreviousUsage: function(vmconfig, controllerList) {
|
||||||
let usedControllers = {};
|
let usedControllers = {};
|
||||||
for (const type of PVE.Utils.diskControllerMaxIDs) {
|
for (const type of Object.keys(PVE.Utils.diskControllerMaxIDs)) {
|
||||||
usedControllers[type] = 0;
|
usedControllers[type] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const property of vmconfig) {
|
for (const property of Object.keys(vmconfig)) {
|
||||||
if (property.match(PVE.Utils.bus_match) && !vmconfig[property].match(/media=cdrom/)) {
|
if (property.match(PVE.Utils.bus_match) && !vmconfig[property].match(/media=cdrom/)) {
|
||||||
const foundController = property.match(PVE.Utils.bus_match)[1];
|
const foundController = property.match(PVE.Utils.bus_match)[1];
|
||||||
usedControllers[foundController]++;
|
usedControllers[foundController]++;
|
||||||
|
Loading…
Reference in New Issue
Block a user