Commit Graph

452 Commits

Author SHA1 Message Date
Thomas Lamprecht
a7ec3666b1 ui: qemu/PCI Edit: code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 12:29:29 +02:00
Dominic Jäger
61e0576823 ui: qemu: eslint fixes
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-05-19 12:12:36 +02:00
Thomas Lamprecht
978ee37981 fixup! ui: qemu/context cmd: code cleanup/refactoring/modernize 2021-05-19 10:18:48 +02:00
Thomas Lamprecht
4cb5c258d2 ui: qemu/context cmd: factor out confirmed VM command
could be also a generator (higher order fn), but it's easier to
grasp the scope and the like this way

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 10:00:40 +02:00
Thomas Lamprecht
5e83a90d81 ui: qemu/context cmd: code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 10:00:40 +02:00
Thomas Lamprecht
4f73992703 ui: qemu/OS defaults: code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 16:53:22 +02:00
Dominic Jäger
f09f1c27ad ui: eslint: Miscellaneous eslint fixes
Function syntax, raw words, string templates, no prototype builtins

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
91a47a766f ui: eslint: State equalities more precisely
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
f1374bff13 ui: eslint: Remove useless escapes
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
55ee6ba132 ui: eslint: No unused or duplicate variables
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Dominic Jäger
46d9a35c33 ui: eslint: fix usage of 'me'
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-18 15:22:05 +02:00
Lorenz Stechauner
963bb5c91f ui: cloudinit: use PVE.Parser.parseSSHKey
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-05-17 15:42:11 +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
Fabian Ebner
2452e18de4 ui: use new SafeDestroyGuest window
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-22 12:48:41 +02:00
Dominik Csapak
27cc48c212 ui: add comment about disabling spice/xterm initially
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-21 17:29:21 +02:00
Dominik Csapak
d7518964d9 ui: qemu/Config: disable xtermjs and spice until status is loaded
We enable/disable spice/xtermjs for the console button in the 'load'
callback of the statusstore, depending on the vms capabilities,
but until the first load there, the only safe option is novnc.

So we have to disable xtermjs and spice on start, else a click on
the button might open a window that cannot connect to the vm.

a forum user probably triggered this:
https://forum.proxmox.com/threads/unable-to-find-serial-interface-console-problem.87705

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-20 18:14:58 +02:00
Mira Limbeck
ac7bf67282 js: readd SLAAC option to IPConfig
Now that SLAAC is supported, we can revert commit 793f2cf4.
SLAAC requires cloud-init 19.4 or newer.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2021-03-31 15:35:59 +02:00
Fabian Ebner
23b596dce0 ui: avoid errors when 'template' property is not present in guest status
The API doesn't advertise the property as non-optional and it's safer and more
in line with the surrounding code.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-03-15 13:59:52 +01: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
43798244a9 Utils: add is_windows and use in MachineEdit
A bit more future proof and reuseable than a regex match.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-03-08 11:05:13 +01:00
Stefan Reiter
cfdb6ac69c ui/machine: fix eslint warning (unnecessary parentheses)
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-03-08 11:05:13 +01:00
Stefan Reiter
34aec3514c ui/machine: fix Windows pinning and detect "pc" as non-pinned
We need to detect "isWindows" before splitting a pinned version into
.version/.machine, otherwise .machine will always be "pc" or "q35", and
the check in "isWindows" will succeed even for pinned versions. This
resulted in "5.1" being shown even if a different version has been set
for a Windows machine.

Also alias "pc" directly to "__default__", as they have the same
meaning, but "pc" is not a valid entry in the "machine" combobox,
leading to an invalid state when editing the (valid) configuration of
"machine: pc" on a VM.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-03-08 11:05:13 +01:00
Stefan Reiter
86c112d069 ui: add onlineHelp to rng
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-03-08 11:05:13 +01:00
Thomas Lamprecht
6c2bc32631 ui: vm/machine: show autopinned version for win VM
and improve switchting machine type and keeping same version for
the windows based VMs, as we cannot do the same as for other
OS-Types, just select the "latest" magic version.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 22:23:19 +01:00
Thomas Lamprecht
432639a82a ui: vm/machine: show notice about effects of machine version change
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
1fe7de1a5e ui: vm/machine: allow blank to avoid invalidity and show Latest as empty text
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
aeb61a525b ui: vm/machine: only set advanced temporary visible for pinned machines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
c0cb5eee2e ui: vm/machine: avoid showing latest for windows VMs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
60cc233a10 ui: style followup cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
1b344da292 ui: vm/machine: adapt to API changes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Stefan Reiter
a51b2c335d ui: MachineEdit: add option for machine version pinning
Hidden behind "Advanced" options, as to not confuse inexperienced users.

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
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
d2021707e3 ui: eslint: enforce "no-extra-boolean-cast" rule
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:43:40 +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
7a077bb5ea ui: qemu/audio: improve displayed text for backend drivers
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-12 13:09:33 +01:00