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>
we want to change the maxIds value even when not rendered, since
in the wizard, the controller can change from a different panel in the
tabpanel
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
there we implemented deleteEmpty, which we can use in some cases.
this also fixes a bug in the ControllerSelector where
an empty field would be allowed (but should not)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This property is only used for CDEdit, so we can deduce this from
the fact that autoselect is set to 'cdrom'
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
The bus selector is displayed when we add a Hard Disk or CD Drive.
When it is displayed, we *always* preselect the next available
slot on the controller of our choice.
So this test is not needed.
We keep the test on the string value of 'autoselect' to select
a bus position when adding a CD Drive.
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
The bus tye selector gets now 2/3 of the space and the bus number
spinner gets 1/3.
It looked a bit strange with both of them getting half of the space,
as on a lot of GUIs the spinner get less space (its just a number
(max 13) vs a wider text).
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
this adds a subclass of Ext.form.field.Number with the settings for
Integers (allowDecimals: false and allowExponential: false and default
step size 1)
and use it where we only accept integers
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
sortedList was defined twice in the function
remove the declaration at the beginning of function as declaring a var
just before using it is more similar to the rest of code
This is a complementary fix for #1105 (Create Linux VM Wizard: use scsi
as default bus/device) and add some logic to the list of controllers
presented in the ControllerSelector combo box
Since we can have IDE, SCSI, Virtio(blk) as a controller during installation,
based on OS detection and personal preferences, we can reasonably assume
on 80 % of cases it will be the same controller we want to use for the
next time we add a hardisk.
This allows backward compatibility for Linux guests which were proposed a
virtio-blk as first choice, and also helps newly created Linux VMs by proposing
SCSI.
this is ExtJS recommended practise, follows most of our
conventions and is necessary for querying
components with Ext.ComponentQuery.query() without escaping the
dots in the component widget name.