]> git.proxmox.com Git - pve-manager.git/commit
fix #4474: ui: guest stop: offer to overrule active shutdown tasks
authorFriedrich Weber <f.weber@proxmox.com>
Fri, 12 Apr 2024 14:15:53 +0000 (16:15 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 20 Apr 2024 18:32:32 +0000 (20:32 +0200)
commite8b411f1c5539767f6af69f6ff3ece3e61c05af8
treea18cd9a2e4903aefc7c0d4717d5fffc6960cea65
parent2a5fd75de53aa5d9c9e9df7aed87689a8e976467
fix #4474: ui: guest stop: offer to overrule active shutdown tasks

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>
www/manager6/Makefile
www/manager6/lxc/CmdMenu.js
www/manager6/lxc/Config.js
www/manager6/qemu/CmdMenu.js
www/manager6/qemu/Config.js
www/manager6/window/GuestStop.js [new file with mode: 0644]