Commit Graph

85 Commits

Author SHA1 Message Date
Aaron Lauterer
a1e25c47f3 ui: qemu/HardwareView: fix CDRom permission checkss
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>
2021-02-19 17:22:30 +01:00
Thomas Lamprecht
96da47ba51 ui: vm/hardware: cleanup and constify variables
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-19 17:22:30 +01:00
Aaron Lauterer
f8205155e9 ui: qemu/HardwareView: eslint: enforce "no-shadow" rule
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>
2021-02-19 16:45:19 +01:00
Aaron Lauterer
87f53aa85e ui: qemu/HardwareView: eslint: enforce "no-useless-concat" rule
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-02-19 16:45:19 +01:00
Thomas Lamprecht
7fcad9ebfb ui: vm/hardware: adapt maxlen fix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-19 16:45:19 +01:00
Aaron Lauterer
f87ddae57b ui: qemu/HardwareView: eslint: enforce "max-len" rule
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-02-19 16:41:52 +01:00
Aaron Lauterer
90b8c62255 ui: qemu/HardwareView: check EFI Disk button permissions
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>
2021-02-03 08:36:59 +01:00
Aaron Lauterer
66abfe6a75 ui: qemu/HardwareView: change heuristic perms to const
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-02-03 08:36:59 +01:00
Aaron Lauterer
f292721c80 ui: qemu/HardwareView: eslint: enforce "no-mixed-operators" rule
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-02-03 08:36:59 +01:00
Thomas Lamprecht
fa8d397162 ui: eslint: some more trailing comma fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:48:50 +01:00
Thomas Lamprecht
399ffa767f ui: eslint: enforce "dot-notation" rule
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:45:01 +01:00
Thomas Lamprecht
53e3ea8488 ui: eslint: enforce "no-extra-parens" rule
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:42:36 +01:00
Thomas Lamprecht
ef725143c6 ui: eslint: enforce "no-unneeded-ternary" rule
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:41:11 +01:00
Thomas Lamprecht
8058410f40 ui: eslint: fix various spacing related issues
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:39:15 +01:00
Thomas Lamprecht
f6710aac38 ui: eslint: fix trailing comma and comma related whitespaces errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:31:03 +01:00
Thomas Lamprecht
2a4971d8c9 ui: eslint: fix trailing spaces
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:29:55 +01:00
Thomas Lamprecht
3bbce3b8cd drop jslint lines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 18:11:47 +02:00
Thomas Lamprecht
6386068d0e ui: call more update store functions in the store scope
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-09 16:45:22 +02:00
Stefan Reiter
4ba4c7c616 qemu: change virtio-rng icon to die
'die' as in 'dice', not what Perl does

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-03-06 18:19:39 +01:00
Stefan Reiter
6c1d8ead7a qemu: add virtio-rng option to GUI
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>
2020-03-06 18:19:39 +01:00
Stefan Reiter
e08c232118 qemu: fix icon alignment in "Add Hardware" menu
It was ever so slightly off.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-03-06 18:19:39 +01:00
Dominik Csapak
67847d54fa gui: qemu: HardwareView: improve button disable code
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>
2020-01-24 10:10:48 +01:00
Dominik Csapak
9d8553982d gui: qemu HardwareView: specify hardware counts in Utils
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>
2020-01-24 10:10:48 +01:00
Thomas Lamprecht
4b07ffdd1f ui: vm/hw: be more specific what VM state this is
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-30 18:14:33 +01:00
Thomas Lamprecht
59bce2875c ui: vm/hw: order VM state last and add extra warning
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-30 18:12:28 +01:00
Thomas Lamprecht
b2a5aa1812 ui: vm/hw: make extra message from deletion flexible
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-30 18:12:08 +01:00
Dominik Csapak
23dfddc637 gui: qemu/HardwareView: show vmstate and allow removal
so that a user can remove the 'suspended' state without resuming it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-30 17:50:10 +01:00
Dominik Csapak
18f57a2319 gui: qemu/HardwareView: use builtin reload function
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>
2019-11-06 21:12:35 +01:00
Thomas Lamprecht
417f904f78 ui: pending revert: detect parent pending grid automatically
but cache it to avoid frequent, potential costly, up() calls

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-30 15:49:31 +01:00
Thomas Lamprecht
3ee15859b2 ui: pending revert: rename baseurl config to apiurl
makes more sense and avoids confusion

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-30 15:48:33 +01:00
Thomas Lamprecht
591efb6725 ui: factor out pending changes revert button
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>
2019-10-30 11:48:03 +01:00
Oguz Bektas
141aba6b62 ui: qemu: update grid button status with events from correct store
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>
2019-10-30 09:00:50 +01:00
Dominik Csapak
4143529241 gui: qemu: allow move disk for EFI Disk again
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>
2019-10-11 12:22:50 +02:00
Thomas Lamprecht
c570b6a96e ui: vm/efi: always allow to add EFI disk even if OVMF is not yet set
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>
2019-10-01 09:30:06 +02:00
Thomas Lamprecht
0ea3b8499b ui: vm/Hardware: do not depent mapping of cdrom, cloudinit, .. on the CSS class
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>
2019-07-24 18:08:12 +02:00
Thomas Lamprecht
a032a91a48 ui: vm/Hardware: convert more icons from bitmap to font awesome
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>
2019-07-24 10:48:19 +02:00
Thomas Lamprecht
fa9cdaa135 ui: vm/HW: use more font awesome icons and fix color
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-23 19:18:15 +02:00
Aaron Lauterer
171ca270a0 Add audio device to HardwareView
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>
2019-07-23 18:29:05 +02:00
Thomas Lamprecht
7b7ca5e1f8 ui: qemu/HWView: cloudinit: use the font-awesome provided cloud symbol
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-17 13:28:20 +02:00
Thomas Lamprecht
83b4bfc314 ui: qemu/HWView: small code cleanup for remove dialog
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-17 13:27:35 +02:00
Thomas Lamprecht
03558174ef ui: qemu/HWView: only render icon when in grid
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-17 13:26:59 +02:00
Dominik Csapak
2e1a8291d6 fix #2223: fix set_button_status isCDRom
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>
2019-05-31 11:03:58 +02:00
Thomas Lamprecht
10525ed71e fix #2197: ui: editing CDROM doesn't require VM.Config.Disk rights
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>
2019-05-13 17:27:49 +00:00
Dominik Csapak
d35b5b2afb fix #1814: do not enable disk related buttons for audit user
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-04-10 09:50:05 +02:00
Christian Ebner
b29918337e fix: #1145 enable CT/VM firewall by default on creation via WebUI
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-04-03 11:25:25 +02:00
Dominik Csapak
aae2273c61 gui: qemu/HardwareView: add machine to HardwareView
so the user can edit this via the gui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-28 17:04:06 +01:00
Dominik Csapak
439d78210a gui: qemu/HardwareView: move scsihw and bios to HardwareView
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>
2019-03-28 17:04:06 +01:00
Dominik Csapak
755f4e5469 gui: qemu/HardwareView: remove Keyboard setting
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>
2019-03-28 17:04:06 +01:00
Dominik Csapak
8d554444e6 gui: qemu/HardwareView: add space between groups
so that we can add items between them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-28 17:04:06 +01:00
Dominik Csapak
6a040799f4 gui: qemu/HardwareView: prepare Hardwareview for font-awesome icons
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>
2019-03-28 17:04:06 +01:00