gui: form/ControllerSelector: fix autoselection
changing from Ext.Array.each to a for loop and changing the return to a 'break', resulted in exiting the wrong loop (previously the outer, now the inner) resulting in wrongly looping through all controllers instead of only until we found a match using a label and labeled break, we can break the outer loop Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
cd4dde8d5c
commit
2de4c3bd34
@ -54,13 +54,14 @@ Ext.define('PVE.form.ControllerSelector', {
|
||||
clist = me.sortByPreviousUsage(me.vmconfig, clist);
|
||||
}
|
||||
|
||||
clist_loop:
|
||||
for (const controller of clist) {
|
||||
bussel.setValue(controller);
|
||||
for (let i = 0; i < PVE.Utils.diskControllerMaxIDs[controller]; i++) {
|
||||
let confid = controller + i.toString();
|
||||
if (!Ext.isDefined(me.vmconfig[confid])) {
|
||||
deviceid.setValue(i);
|
||||
break;
|
||||
break clist_loop; // we found the desired controller/id combo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user