]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: window/Migrate: avoid triggering another info request if already in-progress
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 19 May 2021 14:51:16 +0000 (16:51 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 19 May 2021 14:52:49 +0000 (16:52 +0200)
use the node as key, so that a target switch would still trigger a
new one - else there's a slight chance that a user could get the
check out-of-sync (from another node).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/window/Migrate.js

index 6f4759de9d5895a2628e62fd568a2d1870de1105..5122e25ff73b5c3288add0ac7c500b233a7f219b 100644 (file)
@@ -98,7 +98,6 @@ Ext.define('PVE.window.Migrate', {
            me.lookup('proxmoxHelpButton').setHelpConfig({
                onlineHelp: vm.get(view.vmtype).onlineHelp,
            });
-           me.checkMigratePreconditions();
            me.lookup('formPanel').isValid();
        },
 
@@ -190,11 +189,16 @@ Ext.define('PVE.window.Migrate', {
            }
 
            try {
+               if (me.fetchingNodeMigrateInfo && me.fetchingNodeMigrateInfo === vm.get('nodename')) {
+                   return;
+               }
+               me.fetchingNodeMigrateInfo = vm.get('nodename');
                let { result } = await Proxmox.Async.api2({
                    url: `/nodes/${vm.get('nodename')}/${vm.get('vmtype')}/${vm.get('vmid')}/migrate`,
                    method: 'GET',
                });
                migrateStats = result.data;
+               me.fetchingNodeMigrateInfo = false;
            } catch (error) {
                Ext.Msg.alert(gettext('Error'), error.htmlStatus);
                return;