Commit Graph

294 Commits

Author SHA1 Message Date
Dominik Csapak
01740cb2f7 ui: factor out standalone node check
into Utils and use it where we manually checked that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-13 11:19:46 +01:00
Dominik Csapak
ca97f6301a ui: wizards: allow adding tags in the qemu/lxc create wizard
in the general tab in the advanced section.

For that to work, we introduce a new option for the TagEditContainer
named 'editOnly', which controls now the cancel/finish buttons,
automatically enter edit mode and disable enter/escape keypresses.

We also prevent now the loading of tags while in edit mode, so the tags
don't change while editing (this can be jarring and unexpected).

Then we wrap that all in a FieldSet that implements the Field mixin, so
we can easily use that in the wizard. There we set a maxHeight so that
the field can grow so that it still fits in the wizard.

To properly align the input with the '+' button, we have to add a custom
css class there. (In the hbox we could set the alignment, but this is
not possible in the 'column' layout)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-06 17:02:08 +01:00
Dominik Csapak
ba7002f5e6 fix #4758: ui: lxc wizard: allow multiple ssh keys
by converting the textfield into a textarea and validate the value
line wise (if there is more than one line)

also create a 'MultiFileButton' (mostly copied from extjs) that allows
to select multiple files at once

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-07-15 23:26:34 +02:00
Noel Ullreich
f9b888b055 fix #4551: ui: use gettext on hardcoded byte units
Since some languages translate byte units like 'GiB' or write them in their
own script, this patch wraps units in the `gettext` function.

While most occurrences of byte strings can be translated within the
`format_size` function in `proxmox-widget-toolkit/src/Utils.js`, this patch
catches those instances that are not translated.

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
2023-07-05 09:12:57 +02:00
Alexandre Derumier
2c12348881 ui: qemu|lxc : fix firewall menu caps
The current VM.Console cap is wrong.

Only log panel needs VM.Console, the other ones only need VM.Audit.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
[ D: rewrite commit message a bit ]
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-07 13:21:48 +02:00
Christoph Heiss
4c6c99cc66 lxc: Add Disconnect option for network interfaces
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-03-16 16:04:10 +01:00
Dominik Csapak
1b48b8b7a1 ui: hide 'no tags' field and edit icon without VM.Config.Options
they cannot edit them anyway, so no point in showing them that
there is no tag

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-18 16:37:46 +01:00
Dominik Csapak
366558a79d ui: tree/ResourceTree: show Tags in tree
and update the treenodes when the tags change.
since we change the vm node text (which we pass through to the config
panel), we have to change how we generate the text there slightly
(otherwise that would include the rendered tags)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:21:23 +01:00
Dominik Csapak
d70be8cd73 ui: {lxc, qemu}/Config: show Tags and make them editable
add the tags in the status line, and add a button for adding new ones

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 18:21:23 +01:00
Daniel Tschlatscher
37985d657c gui: move rate limit field to advanced section
The new MTU field and the rate limit field are now in the advanced
section of the NetworkInputPanel to parallel the layout of the
NetworkEdit for VMs.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Reviewed-by:  Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by:  Stefan Hanreich <s.hanreich@proxmox.com>
2022-11-16 20:07:29 +01:00
Daniel Tschlatscher
4e192f9df8 fix #3719: gui: expose LXC MTU option in web UI
The option to set the mtu parameter for lxc containers already exists
in the backend. It just has to be exposed in the web UI as well.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Reviewed-by:  Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by:  Stefan Hanreich <s.hanreich@proxmox.com>
2022-11-16 20:07:22 +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
Fiona Ebner
a3b5c220f9 ui: lxc/qemu: cpu edit: use emptyText for cpuunits
This makes it slightly clearer that it's a default value (not being
written to the config explicitly). It's also in preparation to bind
the default based on the cgroup version, where it's a bit nicer to
bind the emptyText instead of the value (or a user set value would be
overwritten when the binding updates).

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-08 16:24:49 +01:00
Fiona Ebner
61c0338790 ui: qemu/lxc: cpu edit: fix 'create' parameter for delete_if_default()
For lxc, commit 53395db1 ("lxc/ResoureEdit: move some cpu fields to
advanced options") made the fields available in the create wizard, so
the comment is also wrong.

Both wizards do a 'delete kv.delete' in their onSubmit() function, so
it didn't actually matter in practice.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-08 16:24:49 +01:00
Fiona Ebner
aafc29e9f7 ui: lxc: cpu edit: drop superfluous delete_if_default
Commit bf96f60d ("use IntegerField from widget toolkit") switched to
using an Promxox IntegerField with 'deleteEmpty: true'. This means
that a value of '' already is removed from 'values' and added to
'delete' before onGetValues() is called here.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-08 16:24:49 +01:00
Thomas Lamprecht
16875928d3 ui: lxc: fix alias definition of PVE.lxc.Config
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-09-12 17:00:58 +02:00
Thomas Lamprecht
716c30438b ui: lxc resources: modernize & simplify
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-14 07:50:25 +02: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
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
Aaron Lauterer
5747fef3d9 ui: utils: refactor mps to mp
Using the actual config key instead of the pluralization, makes it
easier in the situations where we need to match against it.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-07 15:32:44 +02:00
Fabian Ebner
4ad3a7cc2c ui: lxc: resources: consider rootfs as a disk again
Commit 809f6b6e ("ui: lxc resources: switch to vector based font
awesome icons") seems like an innocent change, but it broke the
(very brittle) logic here by removing the tdCls for rootfs.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-07 15:28:33 +02:00
Thomas Lamprecht
163d9f17cb ui: lxc resources: refactor add menu handler
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-01 13:35:10 +02:00
Thomas Lamprecht
809f6b6ef5 ui: lxc resources: switch to vector based font awesome icons
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-01 11:20:54 +02:00
Thomas Lamprecht
02ecbc9817 ui: lxc resources: support font awesome icons directly
like we do for the VMs hardware view

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-01 10:44:03 +02:00
Fabian Ebner
2bc71fd9c3 ui: lxc options: disable features edit as non-root when container is privileged
The backend won't allow any edits in this case, so better just disable
the edit button altogether.

Co-developed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-03-16 16:23:49 +01:00
Oguz Bektas
0ffa230e17 lxc: add lazytime mount option
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2021-12-01 16:28:21 +01: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
Aaron Lauterer
986ccfe4de ui: lxc: resources: add Detach text for mountpoints
Instead of showing 'Remove' for a mountpoint, change the text to
'Detach' and only show 'Remove' for unused volumes.

This aligns the behaviour with VMs and will make it clear, that a
mountpoint first needs to be detached before it can be fully removed.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-09 10:50:35 +01:00
Dominik Csapak
af07d3d3d6 ui: add lxc/MultiMPEdit and use in lxc/CreateWizard
uses the MultiDiskPanel as a base and implements the necessary
functions/values

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-05 09:50:36 +01:00
Dominik Csapak
87161abf38 ui: lxc/MPEdit: add selectFree toggle
that sets the given vmconfig at the start and selects the first
free mpid

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-05 09:50:36 +01:00
Dominik Csapak
143a507181 ui: lxc/MPEdit: fire diskidchange event
when the diskid changes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-05 09:50:36 +01:00
Dominik Csapak
09e7ac8b63 ui: lxc/MPEdit: add updateVMConfig
helper for the upcoming MultiMPEdit

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-05 09:50:36 +01:00
Aaron Lauterer
a040ecafb7 ui: lxc options: change CIFS to SMB/CIFS
For consistency with the Storage panel and it might also help people to
make the connection if they are not aware that CIFS is a name used for
SMB.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-10-05 07:37:22 +02:00
Dominik Csapak
75b0b1321a ui: lxc/CreateWizard: add a 'nesting' checkbox and enable it by default
but only enable the field for unprivileged containers.
We do this, since newer containers need this feature for basic
functions.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-08-04 13:40:53 +02:00
Dominik Csapak
8b74ec06eb ui: lxc/Options: allow opening features window for VM.Allocate
since VM.Allocate can at least change the nesting value

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-08-04 13:40:42 +02:00
Thomas Lamprecht
56bc50b8a8 ui: adapt task-history icon, use same as in PBS
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-03 02:41:02 +02:00
Dominik Csapak
c313af0f6d {qemu, lxc}/Config: adapt to new proxmoxNodeTasks
by adding a preFilter and extraFilter

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-28 17:51:50 +02:00
Thomas Lamprecht
b1b0fcbcd3 ui: lxc/context cmd: factor out confirmed CT command
unifying CT and VM command menu would be pretty easy now, but I need
to wrap the eslint stuff up, so cannot chase all tails..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 10:19:08 +02:00
Thomas Lamprecht
23ebe427ec ui: lxc/context cmd: code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 10:14:18 +02:00
Thomas Lamprecht
c511ca9cec ui: lxc/Network: eslint fixes and code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 08:46:35 +02:00
Thomas Lamprecht
7aaa492bbd ui: lxc/Mountpoints: eslint fixes and code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 08:45:46 +02:00
Thomas Lamprecht
4fd034b13e ui: lxc/CreateWizard: eslint fixes and code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 08:45:03 +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
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
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