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>
Implement a new "guest stop" confirmation message box which first
checks if there is an active shutdown task for the same guest that is
visible to the logged-in user. If there is at least one, the dialog
displays an additional default-on checkbox for overruling active
shutdown tasks. If the user confirms and the checkbox is checked, the
UI sends a guest stop API request with the `overrule-shutdown`
parameter set to 1. If there are no active shutdown tasks, or the
checkbox is unchecked, the UI sends a guest stop API request without
`overrule-shutdown`.
To avoid an additional API request for querying active shutdown tasks,
check the UI's current view of cluster tasks instead, which is fetched
from the `pve-cluster-tasks` store.
As the UI might hold an outdated task list, there are some
opportunities for races, e.g., the UI may miss a new shutdown task or
consider a shutdown task active even though it has already terminated.
These races either result in a surviving shutdown task that the user
still needs to abort manually, or a superfluous `override-shutdown=1`
parameter that does not actually abort any tasks. Since "stop
overrules shutdown" is merely a convenience feature, both outcomes
seem bearable.
The confirmation message box is now always marked as dangerous (with a
warning sign icon), whereas previously it was only marked dangerous if
the stop issued from the guest panel, but not when issued from the
resource tree command menu.
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
[ TL: squash in some slightly opinionated code/style clean-ups ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
while the command itself is 'suspend', the task description
is 'qmpause', so simply add a parameter and overwrite it for the pause
menu item
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
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>
We act correctly for an outside triggered suspend, but if the guest
suspends itself from inside (e.g., systemctl suspend,
`echo "standby" > /sys/power/state` or windows sleep) it has another
state (suspended vs. paused), so handled that also
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
so that we can reuse it for containers
while we do this, we also have to adapt the SnapshotSelector
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
some function are now in Proxmox.Utils instead, so we have to use that
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
The snapshot selector was known to confuse first time pve users.
Some wondered that they had no snapshot called 'current' in their
snapshot trees, and other thought that snapshots would be included
in the copied image.
So before displaying the Clone Window, do an API call to verify
if the source VM has snapshots.
When basic capabilities are missing, don't display the corresponding actions in
the tree menu.
Note that we *hide* the corresponding actions, instead of disabling by greying
out the menu command. Disabling here does not make sense, since a low privilege
user has no way to reenable the menu commands by himself.
This is mainly a usability improvement, as the real capabilities test is done in
the backend.
change the order of the contextmenu items to
group functions, also introducing separators
like this:
***
power options
***
moving options
***
console
***
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
start button should be disabled when suspended
use 'file' icon instead of 'sticky-note'
to be consistent with tree icons
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
this patch makes use of font-awesome for
lxc/qemu action buttons (start/shutdown etc.)
node actions buttons (restart/shutdown etc.)
and lxc/qemu cmdmenus
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>