]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui: fix disk controllers sortByPreviousUsage iteration
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 30 Jan 2020 12:36:53 +0000 (13:36 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 30 Jan 2020 12:38:31 +0000 (13:38 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/form/ControllerSelector.js

index e1e9369baa3dd9b4a886c764e9a7ac96dd4c4a76..8ba46f17af094dd4b037c231b2dd3aa33b1e6afe 100644 (file)
@@ -8,11 +8,11 @@ Ext.define('PVE.form.ControllerSelector', {
 
     sortByPreviousUsage: function(vmconfig, controllerList) {
        let usedControllers = {};
-       for (const type of PVE.Utils.diskControllerMaxIDs) {
+       for (const type of Object.keys(PVE.Utils.diskControllerMaxIDs)) {
            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/)) {
                const foundController = property.match(PVE.Utils.bus_match)[1];
                usedControllers[foundController]++;