Commit Graph

22 Commits

Author SHA1 Message Date
Thomas Lamprecht
3bbce3b8cd drop jslint lines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 18:11:47 +02:00
Dominik Csapak
7dc5c40c26 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>
2020-02-12 12:34:53 +01:00
Thomas Lamprecht
96ed94ad6f ui: fix disk controllers sortByPreviousUsage iteration
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 13:38:31 +01:00
Thomas Lamprecht
ca0e7e802c ui: controller selector: use OSDefaults.getDefaults
it does the fallback for us already

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-24 10:10:48 +01:00
Thomas Lamprecht
c7139315e8 ui: controller selector: refactor and cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-24 10:10:48 +01:00
Thomas Lamprecht
8c4ec8c711 ui: avoid duplication of guest disc controller maxIDs definition
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-24 10:10:48 +01:00
Dominik Csapak
369e3ecd0a fix #1635: correctly change maxIds in ControllerSelector in wizard
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>
2018-01-31 14:03:39 +01:00
Dominik Csapak
bf96f60deb use IntegerField from widget toolkit
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>
2018-01-25 13:36:37 +01:00
Emmanuel Kasper
5034f7833c Do not use the noVirtIO property to build the controller list
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>
2017-10-19 11:46:23 +02:00
Emmanuel Kasper
0e09929dfe Save the components we found via down() in a variable for later reuse.
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-10-19 11:46:23 +02:00
Emmanuel Kasper
f5aea3f018 Remove unused noScsi parameter
SCSI is a valid bus for Disks and CD drives, so it should always
be appear in the bus list.

Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-10-19 11:46:23 +02:00
Emmanuel Kasper
7206af4b04 Do not use 'autoselect' as a boolean when preselecting a bus
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>
2017-10-19 11:46:23 +02:00
Thomas Lamprecht
a1fe04b65d disk/controllerselector: adapt flex
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>
2017-09-01 11:07:43 +02:00
Dominik Csapak
8a7e5598f1 add pveIntegerField and use it
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>
2016-11-02 17:14:06 +01:00
Emmanuel Kasper
88ecfbdbda Fix jslint warning: 'sortedList' is already defined
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
2016-10-11 07:02:57 +02:00
Emmanuel Kasper
e2d725633e Move bus priority list to OSDefaults
So a field container does not need to know if Linux likes SCSI.
2016-10-11 07:02:33 +02:00
Dietmar Maurer
f6735a886a simplify code, improve sort order 2016-10-07 08:12:52 +02:00
Emmanuel Kasper
31345b9c28 When adding a new hard disk, use the most used controller as suggested value
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.
2016-10-07 07:05:53 +02:00
Emmanuel Kasper
39c06c6925 USe PVE.qemu.OSDefaults statics to get defaults for NIC and Storage Controller 2016-07-21 12:50:27 +02:00
Emmanuel Kasper
42902182c0 Rename Wizard Component aliases using camelCase
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.
2016-07-21 12:44:13 +02:00
Dominik Csapak
5ca0c804c6 remove displayfield height hack
this did not work anymore,
instead overwrite css for displayfields to have correct
min-height

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-06 16:29:35 +02:00
Dietmar Maurer
bac5bd135c rename manager5 to manager6 2016-01-22 11:24:10 +01:00