]> git.proxmox.com Git - proxmox-backup.git/commitdiff
gui: masks for: adding recovery and removals
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 8 Jan 2021 11:00:00 +0000 (12:00 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 11 Jan 2021 09:23:13 +0000 (10:23 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
www/config/TfaView.js
www/window/AddTfaRecovery.js

index a4c289dc1acfaf3d6d18c250d76317e712a587a6..9188ae521feb748f350c5f9e600aa4d5e14c02ff 100644 (file)
@@ -161,6 +161,7 @@ Ext.define('PBS.config.TfaView', {
            }
 
            try {
+               me.getView().mask(gettext('Please wait...'), 'x-mask-loading');
                await PBS.Async.api2({
                    url: `/api2/extjs/access/tfa/${record.id}`,
                    method: 'DELETE',
@@ -169,7 +170,9 @@ Ext.define('PBS.config.TfaView', {
                me.reload();
            } catch (error) {
                Ext.Msg.alert(gettext('Error'), error);
-           }
+           } finally {
+               me.getView().unmask();
+            }
        },
     },
 
index 1dc81f86320ee926605f5dd49c25f017b22c93d2..710c243f7e1a95f866ec6d075d6654fc13c434e1 100644 (file)
@@ -74,6 +74,8 @@ Ext.define('PBS.window.AddTfaRecovery', {
            let me = this;
            let view = me.getView();
 
+           view.mask(gettext('Please wait...'), 'x-mask-loading');
+
            let baseurl = view.baseurl;
 
            let userid = me.userid;
@@ -87,8 +89,6 @@ Ext.define('PBS.window.AddTfaRecovery', {
                params.password = me.lookup('password').getValue();
            }
 
-           me.getView().close();
-
            try {
                let response = await PBS.Async.api2({
                    url: `${baseurl}/${userid}`,
@@ -102,6 +102,8 @@ Ext.define('PBS.window.AddTfaRecovery', {
                });
            } catch (ex) {
                Ext.Msg.alert(gettext('Error'), ex);
+           } finally {
+               view.close();
            }
        },
     },