gui: masks for: adding recovery and removals

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-01-08 12:00:00 +01:00
parent 758a827c2d
commit 63fd8e58b2
2 changed files with 8 additions and 3 deletions

View File

@ -161,6 +161,7 @@ Ext.define('PBS.config.TfaView', {
} }
try { try {
me.getView().mask(gettext('Please wait...'), 'x-mask-loading');
await PBS.Async.api2({ await PBS.Async.api2({
url: `/api2/extjs/access/tfa/${record.id}`, url: `/api2/extjs/access/tfa/${record.id}`,
method: 'DELETE', method: 'DELETE',
@ -169,6 +170,8 @@ Ext.define('PBS.config.TfaView', {
me.reload(); me.reload();
} catch (error) { } catch (error) {
Ext.Msg.alert(gettext('Error'), error); Ext.Msg.alert(gettext('Error'), error);
} finally {
me.getView().unmask();
} }
}, },
}, },

View File

@ -74,6 +74,8 @@ Ext.define('PBS.window.AddTfaRecovery', {
let me = this; let me = this;
let view = me.getView(); let view = me.getView();
view.mask(gettext('Please wait...'), 'x-mask-loading');
let baseurl = view.baseurl; let baseurl = view.baseurl;
let userid = me.userid; let userid = me.userid;
@ -87,8 +89,6 @@ Ext.define('PBS.window.AddTfaRecovery', {
params.password = me.lookup('password').getValue(); params.password = me.lookup('password').getValue();
} }
me.getView().close();
try { try {
let response = await PBS.Async.api2({ let response = await PBS.Async.api2({
url: `${baseurl}/${userid}`, url: `${baseurl}/${userid}`,
@ -102,6 +102,8 @@ Ext.define('PBS.window.AddTfaRecovery', {
}); });
} catch (ex) { } catch (ex) {
Ext.Msg.alert(gettext('Error'), ex); Ext.Msg.alert(gettext('Error'), ex);
} finally {
view.close();
} }
}, },
}, },