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>
value is not always a string (depending on the value that changed),
so we have to convert it to a string to have a 'match' function
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
A user which just has the default role PVEVMUser on a VM is able to
edit the CDROM, either to no media or if storage permissions are
available also to other ISOs, through the API. So reflect this again
for the WebUI. We could add a check for "VM.Config.CDROM", but that's
not really worth, if we keep in mind that the Ext.Caps state is
heuristically only.
fixes commit d35b5b2afb
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
it is guest hardware and not really an option, and we have it now
in the wizard, so it makes sense to have it here
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
this is deprecated and should not be necessary anymore, since
qemu and novnc can handle this better if no keyboard layout is set
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
we want to be able to use fontawesome icons directly instead of having
to use extracted png in css classes
this patch makes it possible to use 'iconCls' with the font-awesome icon name
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>