drop only partially used intermediate value, use template strings,
reduce line bloat while trying to keep it readable.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Inspired by HDEfi for efidisks. Extends the DiskStorageSelector to allow
hiding the format, since tpmstate can only be stored in 'raw' format
(even on directory storages).
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
The default is not just "i440fx", this hides the fact that the version
will be pinned to 5.1, unless one deliberately opens the editor.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
There are several types of drives that use the same config keys. Most
notably CDRom and regular VM disks (EFI and cloudinit exist as well).
Since there is a dedicated permission for CDRom drives we need to check
permissions in more detail, depending on what type of drive it actually
is for things like the edit, remove and Add -> CDRom buttons.
The permission check in the row definition itself which only checked for
'VM.Config.Disk' permissions (never_delete) had to be removed and finer
grained checks added for the individual buttons. This also meant a bit
of reshuffling in the checks what kind of disk the current one is.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
By removing global vars 'i' and 'confid' and declaring them with let in the needed
context.
'i' wasn't necessary but had to be touched anyway.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Make sure that the `Add EFI Disk` button is disabled if the user does
not have the needed permissions.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Warn the user when selecting /dev/random or disabling speed limits.
'hardware_counts' is used since technically more than one RNG could be
attached to a QEMU machine. It is limited to 1 however, since the
usefulness of such a setup is more than questionable, considering the
linux kernel only ever uses one hwrng at a time anyway.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
this improves following behaviours:
* do not loop over items multiple times
(we iterated one time extra for efidisk)
* do not check every item for cloudinit
(we even checked non-disk types)
* make the counts more generic using an object
* also disable cloudinit button when you have one pending
* also disable serial/net button when at limit or the user has
not the right priviliges
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
this also fixes the issue that we only showed 4 hostpci devices in
the gui despite raising the limit in the backend to 16
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
ObjectGrid (an ancestor of PendingObjectGrid) does already have
a 'reload' function which does exactly the same, so get rid
of the local one here
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
makes no sense to have the, more or less, exact same 25 line method 5
times..
could be moved to widget TK, but that's for another time.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
as we noticed at the container side, we should use diffStore in order
to update the button status without delay.
Effectively alls ObjectGrids, and thus their descendants,
PendingObjectGrids use a DiffStore, where we have two effective
stores, a remote store and a local, in-memory, proxy store.
Co-developed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
with commit 0ea3b8499b we changed how
we define isUsedDisk, which was true for efidisks before, but not
after
use the existing 'isEfi' varable to include them for the move_btn
(but not the resize_btn)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
As this is annoying else, especially if the change from default to
ovmf BIOS is already a pending change..
A simple hint is enough, we do not do anything with the EFI disk if
OVMF is not set to be used anyway.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This was pretty brittle to begin with, on should not attach logic to
CSS class names or the like, if possible.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
since commit 03558174ef we can use the
Font Awesome icons without them being shown in the remove dialog, so
convert more to them - they are vectors and look a bit better.
Also ensure that all icons are rendered as fixed width, with fa-fw
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Adds the following:
* Menu entry to create a new audio device
only clickable if:
* permissions are there
* no audio device exists
* listing in the hardwarew view
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>