ui: user view: disable 'Unlock TFA' button by default

Without this, the button is enabled if no entry at all is selected (e.g.
when switching to the 'User Management' tab), with the button then
(obviously) being a noop.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
This commit is contained in:
Christoph Heiss 2024-08-22 13:08:36 +02:00 committed by Wolfgang Bumiller
parent e9152ee951
commit 4c0a8bc054

View File

@ -186,6 +186,7 @@ Ext.define('PBS.config.UserView', {
xtype: 'proxmoxButton',
text: gettext('Unlock TFA'),
handler: 'unlockTfa',
disabled: true,
enableFn: ({ data }) =>
data['totp-locked'] || (data['tfa-locked-until'] > (new Date().getTime() / 1000)),
},