Commit Graph

104 Commits

Author SHA1 Message Date
Thomas Lamprecht
5c63f8a1fe ui: qemu hardware: fix eslint error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-17 10:38:05 +01:00
Dominik Csapak
95f624b277 ui: cloudinit: disable remove button without VM.Config.Cloudinit
since it also needs both VM.Config.CDROM and VM.Config.Cloudinit

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 09:03:26 +01:00
Leo Nunner
ad1d539e43 fix #4321: properly check cloud-init drive permissions
Checking for only Sys.Console prevents users who actually have the
correct permissions (VM.Config.CDROM, VM.Config.Cloudinit) from adding
a new cloud-init drive. Some checks needed to be adapted so that editing
cloud-init devices was possible with VM.Config.CDROM instead of
VM.Config.Disk.

Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
2022-11-17 08:36:58 +01:00
Fiona Ebner
5a2e333c9e ui: lxc/qemu: cpu edit: make cpuunits depend on node's cgroup version
so that the default value and limits actually correspond to what will
be used. Defaults to values for cgroup v2, because that is the more
common scenario.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-15 14:08:55 +01:00
Dominik Csapak
17dcba38dd ui: qemu: increase available usb ports depending on machine and ostype
in the backend, we allow up to 14 usb ports, but only if the vm can
use the qemu-xhci controller which is only possible since machine
version 7.1 and if the ostype is l26 or windows > 7

for this we introduce two helpers:
* qemu_min_version: modeled after the signature of 'min_version' from
  qemu-server, expects two arrays of versions and returns true if
  the first parameter is equal or greater than the second version
* get_max_usb_count looks at the given ostype and machine string
  and returns the proper maximum number

since we don't currently have the actual running version of the vm in
the gui, this is only a heuristic for running vms. but since the actual
running version could only be lower if none is set (e.g. for
migrated/long-running vms) we allow more in the gui and the backend will
do the proper thing (either hotplug it, or make it a pending change)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-10 17:06:41 +01:00
Thomas Lamprecht
3bde324faf ui: move disk reassign into window/ folder
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-08 14:53:55 +02:00
Aaron Lauterer
1b42be84cf ui: hdmove: modernize/refactor
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-07 15:35:17 +02:00
Aaron Lauterer
a8d854afe2 ui: lxc/qemu: add disk reassign and action submenu
For the new HDReassign component, we follow the approach of HDMove to
have one componend for qemu and lxc.

To avoid button clutter, a new "Disk/Volume action" button is
introduced. It holds the Move, Reassign and Resize buttons in a
sub-menu.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-07 15:34:44 +02:00
Thomas Lamprecht
b49a0404be ui: vm hardware: module wide refactoring/cleanups/style changes/fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-01 16:46:30 +02:00
Thomas Lamprecht
0bb1e60d1a ui: vm hardware: fix add-menu itemId casing
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-01 16:41:44 +02:00
Thomas Lamprecht
aa8e5e7909 ui: vm: factor out add-HW menu handler to higher order fn
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-01 16:06:14 +02:00
Thomas Lamprecht
64bef8206e ui: qemu: switch memory icon to SVG
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-31 16:52:14 +02:00
Thomas Lamprecht
f9698f62cb ui: qemu: switch processor icon to SVG
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-31 15:43:40 +02:00
Thomas Lamprecht
cc80f76528 ui: guest remove: modernize code and cleanup
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>
2021-11-09 11:00:51 +01:00
Stefan Reiter
6d084964b3 ui: add support for adding TPM devices
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>
2021-10-05 07:12:19 +02:00
Thomas Lamprecht
897c1fc84c ui: qemu/HW: reformat comment to better use awailable text-width
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 11:46:01 +02:00
Dominik Csapak
a8ea1b6876 ui: use some icons from widget-toolkit
we moved them there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 18:34:34 +02:00
Stefan Reiter
4a0ccbadc3 ui/hardware: extend machine renderer to show pinned Windows versions
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>
2021-03-08 11:05:13 +01:00
Stefan Reiter
9dbddec75b ui: create MachineEdit window
no functional change intended

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
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