Go to file
Dominik Csapak 6d727f81c8 ui: migrate: fix disabled migrate button glitch
under certain circumstances, the migrate button stays disabled, even
when a valid target node was selected:
* the first node that gets autoselected (most likely the second)
  is not a valid migration target
* the user changes to a migration target that is a valid one

if that happens, the migration button would stay disabled.
switching once to a non valid target and would enable the button.

To fix it, we have to do two things here:

'checkQemuPreconditions' is actually an async function that awaits an
api call and uses the result to set the 'migration.allowedNodes'
property

'checkMigratePreconditions' calls 'checkQemuPreconditions' and uses the
'migration.allowedNodes' property afterwards.

but since 'checkMigratePreconditions' is not async, that happens before
the api call can return the valid data and thus leaves it empty, making
all nodes valid in the selector. (thus the initial selected node is
valid)

instead make 'checkMigratePreconditions' also async and await the result
of 'checkQemuPreconditions'

this unearthed another issue, namely we access an object that is
possibly undefined (worked out before due to race conditions) so
fallback to an empty object.

and lastly, since we want the 'disallowedNodes' set before actually
checking the qemu preconditions, we move the setting of that on
the node selector above the qemu preconditions check
(this is the only place where we set it anyway, and the source does not
change, we probably could move that out of that function altogether)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-22 14:50:30 +02:00
aplinfo update shipped aplliance info index 2023-06-21 09:26:38 +02:00
bin drop outdated pve6to7 upgrade checker script for bookworm 2023-05-31 18:02:39 +02:00
configs pve sources: update dist to bookworm 2023-05-30 15:15:06 +02:00
debian bump version to 8.0.3 2023-06-21 19:55:58 +02:00
network-hooks makefile: convert to use simple parenthesis 2023-05-29 18:24:00 +02:00
PVE pve7to8: sync over from stable-7 branch 2023-06-21 19:52:59 +02:00
services makefile: convert to use simple parenthesis 2023-05-29 18:24:00 +02:00
test fix replication fail count tests & bump libpve-guest-common-perl b-d 2022-04-27 18:53:27 +02:00
www ui: migrate: fix disabled migrate button glitch 2023-06-22 14:50:30 +02:00
.gitignore Extend the .gitignore(s) 2018-05-04 14:50:04 +02:00
defines.mk fix #844: allow to pre-delay start-all-marked guests on boot 2019-11-20 20:20:58 +01:00
Makefile buildsys: derive upload dist automatically and avoid bogus check 2023-05-29 18:24:00 +02:00
spice-example-sh doc: spice-example-sh: support special characters in passwords 2017-10-05 13:57:27 +02:00
vzdump-hook-script.pl close #3476: vzdump: add job-init hook 2022-01-18 12:20:26 +01:00