Commit Graph

79 Commits

Author SHA1 Message Date
Michael Köppl
708de5b341 close #3181: ui: display guest name in confirm dialogs
The confirmation dialogs of the following actions are affected by this
change:
* Remove
* Clone
* Migrate
* Snapshot
* Snapshot restore
* Backup VM/CT from config view
* Restore VM/CT from config view

A combination of VM/CT id and name is added to each confirmation dialog.
The order of id and name depends on the sort field selected in the tree
settings. If "Name" is selected, the confirmation dialogs will show "VM
name (VMID)". In any other case, "VMID (VM name)" will be used.

The VM/CT name is considered optional in all handled cases. If it is
undefined, only the VMID will be displayed in the dialog window. No
exceptions are thrown in case of an undefined guest name because it
only extends the information displayed to the user and is not essential
for performing any of the actions above.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
2025-04-07 14:07:35 +02:00
Friedrich Weber
978df393cd ui: htmlEncode task information
to avoid interpreting HTML.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
2025-04-04 15:26:23 +02:00
Thomas Lamprecht
c21b4250d6 ui: resource tree: improve gettext representation of dynamic state tooltip
Some languages need to know about the argument here to allow for a
better translation (text order).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-14 18:47:45 +01:00
Dominik Csapak
a886456f30 ui: tree: show tooltips for all entries that have sensible information
instead of filtering pools and groups out manually, simply accumulate
the info we want to to have (status/hastate/etc.) and if any of those
exist, show the tooltip.

This results in the nodes also having a tooltip, including their hastate
(such as online/maintenance), and automatically would show such things
in the future if we add those fields to other entries.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-14 18:44:01 +01:00
Dominik Csapak
142f435bc9 ui: view selector: prepare filterfn to be more efficient
instead of just using the filterfn directly, return a function from
`getFilterFn`. This way, when we want to filter different things
depending on e.g. local storage values, we don't have to do that for
every element, but only once and return the finished filterFn.

while at it, rename 'filterfn' to camel case 'filterFn'.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-12 12:59:51 +01:00
Dominik Csapak
bc6b553461 ui: resource tree: fix order of types
when ordering items on the same level, we often sort first by type, but
do this via string comparison of the types.

this leads to weird results if we have e.g. lxc/node/qemu mixed in one
list, as nodes would sort in between lxc and qemu

this patch solves that issue by introducing a fixed order for types, so
we have direct control over the order when mixing types without having
to change the type names.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-12 12:59:51 +01:00
Dominik Csapak
aa54d20851 ui: implement 'Tag View' for the resource tree
and keep the functionality in ResourceTree as generic as possible.

We achieve this by having an 'itemMap' function that can split one item
from the store into multiple to add to the tree.

for the updates, we have to have an 'idMapFn' (to get the original id
back)

we also have to modify how the move checks work a bit, since we only
want to move the items when the tags changed only in the tagview case

in the ResourceGrid we have to get the id a bit differently since we now
have 'virtual' ids for the entries tag contain the tag (which can't be
found in the resource store)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-11-10 11:29:49 +01:00
Stefan Hanreich
2989f3a9b8 sdn: ipam: fix editing custom mappings
Currently custom mappings cannot be edited, due to them having no VMID
value. The VMID parameter was always sent by the frontend to the
update call - even if it was empty - leading to validation failure on
the backend. Fix this by only sending the vmid parameter when it is
actually set.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2024-07-22 18:37:32 +02:00
Dominik Csapak
b877366ade ui: resource tree: remove wrong comment
that function is not only there for the storage indicators, but
generally for adding additional information, such as tags, and for
wrapping in a span for making tooltip selection easier.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-23 09:39:19 +01:00
Dominik Csapak
fa17629b5f ui: resource tree: fix extra space inconsistency in some node elements
When a node element was updated, it was put through the 'setText'
method which accidentally added a space before it's name.

Fix this by putting the space into the status variable.

Without this patch one could observe a vertical misalignment when some
nodes had guests on them but others had none.

Fixes: 2f414c50 ("ui: resource tree: limit tooltip to icon and text")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-23 09:36:57 +01:00
Thomas Lamprecht
4a88465546 ui: drop various translations of fixed strings
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-23 09:23:23 +01:00
Stefan Hanreich
024017cffa ipam: send ip to delete endpoint
The ip parameter has been added to the delete endpoint, so only a
specific mapping gets deleted instead of all mappings for that mac
address. Reflect this change in the UI.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-11-22 14:35:49 +01:00
Stefan Hanreich
14f46dbb97 sdn: Update IPAM API endpoints
The IPAM-related API endpoints were moved, reflect those changes in
the UI as well.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-11-21 20:54:11 +01:00
Stefan Hanreich
a3c059c559 sdn: ipam: add ipam panel
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-11-21 20:27:38 +01:00
Dominik Csapak
872e9978fd ui: resource tree: add usage percentage to storage tooltip
it is a bit more verbose than the usage bar

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-12 18:12:59 +01:00
Dominik Csapak
1ed8e0096b ui: resource tree: fix showing empty tooltips
stop the tooltip show when the there is no text
this could happen for e.g. nodes that should not have a tooltip

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-12 18:12:59 +01:00
Dominik Csapak
128e8e826a ui: resource tree: don't save the tooltip
it shouldn't be called that often, and if we save it, it gets outdated,
e.g. when starting/stopping a guest

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-12 18:12:59 +01:00
Dominik Csapak
2f414c50c1 ui: resource tree: limit tooltip to icon and text
and exclude the tags for that, since we want the tags to have their own
tooltips

we use the delegate function of the tooltips for that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-09 12:12:36 +01:00
Dominik Csapak
08526cf56e ui: pci/usb mapping: rework mapping panel for better user experience
by removing the confusing buttons in the toolbar and adding them as
actions in an actioncolumn. There a only relevant actions are visible
and get a more expressive tooltip

with this, we now differentiate between 4 modes of the edit window:
* create a new mapping altogether
  - shows all fields
* edit existing mapping on top level
  - show only 'global' fields (comment, mdev), so no mappings
* add new host mapping
  - shows nodeselector, mapping (and mdev, but disabled)
    (informational only)
* edit existing host mapping
  - show selected node (displayfield) mdev and mappings, but only
    mappings are editable

we have to split the nodeselector into two fields, since the disabling
cbind does not pass through to the editconfig (and thus makes the form
invalid if we try that)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 10:03:52 +02:00
Dominik Csapak
0a571cffc0 ui: resource map tree: make 'ok' status clearer
by changing into 'mapping matches host data' which indicates that the
configured values matches the host information

also for the pci and usb map selectors

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 10:03:52 +02:00
Dominik Csapak
386f8d9795 ui: add ResourceMapTree
this will be the base class for trees for the individual mapping types,
e.g. pci and usb mapping.

there are a few things to configure, but the overall code sharing is
still significant, and should work out fine for future mapping types

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-16 16:25:42 +02:00
Dominik Csapak
c04b8fea38 ui: resource tree: correctly reinsert item when name changes
if the user has the tree sorted by name, we have to move the items
on a name change, otherwise they'll stay on the old position

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-03-16 10:21:23 +01:00
Dominik Csapak
8e9267f309 fix #1408: ui: ResourceTree: sort the tree according to tree-sorting options
Considers the newly added options from browser local storage. We have to
save the last sorting mechanism there, so we can detect if it changes
and trigger the movement/text changes (otherwise the tree nodes won't
be updated/moved)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-02-22 09:12:36 +01:00
Dominik Csapak
731436ee86 ui: refactor ui option related methods into UIOptions
a new singleton like Utils/Parser, intended for holding stuff for
ui options, such as the tag settings/overrides

no behavioural change intended

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-02-22 09:12:36 +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
Fabian Ebner
ab0616aacb ui: snapshot tree: warn that current state is lost when confirming rollback
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-05-02 15:46:36 +02:00
Dominik Csapak
d8da55382a ui: resourcetree: move guest position on template creation
we sort templates at the end normally, but if we convert a guest to a
template, it was not moved in the tree

add it to the list of attributes that are checked for a move

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
2021-10-21 11:48:38 +02:00
Dominik Csapak
133d82d5e5 ui: tree/SnapshotTree: use beforedestroy instead of destroy
on extjs 7.0, this triggers when the handler is not available anymore,
so use the beforedestroy event instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 12:43:08 +02:00
Thomas Lamprecht
eda300438e ui: snapshot tree: eslint fixes and code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 16:52:49 +02:00
Thomas Lamprecht
ff0777c520 ui: resource tree: eslint fixes and code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 14:00:59 +02: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
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
e41a172b63 ui: snapshot tree: add separator between rollback and edit button
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-23 14:00:07 +01:00
Moayad Almalat
97f8afffd4 close #3114: ui: snapshots: switch Edit and Remove Button & add warning logo
Signed-off-by: Moayad Almalat <m.almalat@proxmox.com>
2020-11-23 13:57:40 +01:00
Alexandre Derumier
90f7cb68d1 sdn: fix zone icon in tree view
also add status icon:
  -pending (yellow triangle)
  -error (red cross)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-06-25 13:35:55 +02:00
Alexandre Derumier
12ae2ddd90 add sdn icons
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-26 12:17:53 +01:00
Alexandre Derumier
9233148bc1 add sdn gui
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-03-23 14:43:26 +01:00
Fabian Ebner
7fb02366e0 Hide 'Include RAM' when VM isn't running
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-02-06 22:31:39 +01:00
Dominik Csapak
c16c13020d gui: tree/SnapshotTree: fix gettext invocation
our gettext extractor cannot handle such statements to extract the
gettext, so change it to two gettexts

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-02-05 20:23:17 +01:00
Thomas Lamprecht
87ae19d1ee ui snapshot tree: avoid another exception in delayd load when view is gone
similar story than commit 9cc4958f5a
We cannot really assert anything about the state of me (the view) and
consorts if me.destroyed is true, just early return.

We can get here because this is a delayed task, i.e., async,
everything can happen in between triggering it and receiving the
actual callback, so guard!

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 20:06:16 +01:00
Thomas Lamprecht
9cc4958f5a ui snapshot tree: avoid exception in delayd load when view is gone
If one switched through guest fast (e.g., keeping the down-arrow key
pressed) while staying on the snapshot panel, it could happen that
the previous view got already destroyed once the success callback of
the feature API request got executed.

Then the ExtJS ViewModels' set method got a "null" back from its
me.getStub(...) call, and tried to access members of that, resulting
in a TypeError exception.

Avoid that by checking if we're already destroyed or still around
before doing that call. During the time we are already in the
callback we shouldn't be able to get destroyed in parallel due to JS
single thread nature and no yield point here, so this is safe.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 19:43:20 +01:00
Thomas Lamprecht
e1af138576 ui snapshot tree: add label when no new snapshot is possible
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 19:42:02 +01:00
Thomas Lamprecht
b9c780c5a8 ui snapshot tree: express formulas more concisely
Use arrow functions to bring them in a more simple boolean expression
style. Further, we can reuse the "isSnapshot" formula in the
"canRollback" and "canRemove" ones.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 19:34:35 +01:00
Thomas Lamprecht
9a6b894fcc ui: follow up style fixes, don't cram expressions into one line
We do not want to have multiple expressions on the same line, if it'
really is an exception.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 19:31:54 +01:00
Dominik Csapak
5b1b9360eb gui: refator SnapshotTree
using the better View, ViewModel, Controller style,
while doing this, make it generic so that we can use it for qemu and lxc

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-01-30 18:01:38 +01:00
Thomas Lamprecht
ec5052600f js: fix some common typos found with codespell
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-15 10:44:43 +02:00
Thomas Lamprecht
82a33d4ef7 gui: tree: add lock information to tooltips
This was already proposed by Dominik[0], but it was was wished for a
faster backend backing of this[1], and as with most wishes one needs
to either be content with what's there or (try) to improve it one
self.. So with the IPCC approach proposed as backing for this I'd
like to add this again. It differs from [0] a bit, first it's rebased
as parts of the tooltip stuff got already applied[2].

I use "Config locked (<LOCK>)" as text for this, as it
1. Clarifies what the lock symbol means, which is always a good thing
   for tooltips
2. repeating the lock symbol here again would show the users three
   lock symbols at the same time if the VM was selected in the tree
   (the tree one, the VM config panel one, and this tool tip one)
   this is a bit much, so don't do it.

[0]: https://pve.proxmox.com/pipermail/pve-devel/2019-February/035829.html
[1]: https://pve.proxmox.com/pipermail/pve-devel/2019-March/035930.html
[2]: https://pve.proxmox.com/pipermail/pve-devel/2019-March/036165.html

Co-developed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-13 21:28:53 +02:00