web/user: fix device type for static tokens

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-04 15:28:55 +01:00
parent 337677ad12
commit e0e4bf6972
4 changed files with 33 additions and 10 deletions

View File

@ -4218,9 +4218,9 @@ msgstr "Static Tokens"
msgid "Static authenticator" msgid "Static authenticator"
msgstr "Static authenticator" msgstr "Static authenticator"
#: #: src/user/user-settings/mfa/MFADevicesPage.ts
#~ msgid "Static tokens" msgid "Static tokens"
#~ msgstr "Static tokens" msgstr "Static tokens"
#: src/pages/stages/prompt/PromptForm.ts #: src/pages/stages/prompt/PromptForm.ts
msgid "Static: Static value, displayed as-is." msgid "Static: Static value, displayed as-is."
@ -4652,6 +4652,10 @@ msgstr "TLS Verification Certificate"
msgid "TOTP Authenticators" msgid "TOTP Authenticators"
msgstr "TOTP Authenticators" msgstr "TOTP Authenticators"
#: src/user/user-settings/mfa/MFADevicesPage.ts
msgid "TOTP Device"
msgstr "TOTP Device"
#: src/user/user-settings/mfa/MFADevicesPage.ts #: src/user/user-settings/mfa/MFADevicesPage.ts
msgid "TOTP authenticator" msgid "TOTP authenticator"
msgstr "TOTP authenticator" msgstr "TOTP authenticator"

View File

@ -4176,9 +4176,9 @@ msgstr "Jetons statiques"
msgid "Static authenticator" msgid "Static authenticator"
msgstr "" msgstr ""
#: #: src/user/user-settings/mfa/MFADevicesPage.ts
#~ msgid "Static tokens" msgid "Static tokens"
#~ msgstr "Jetons statiques" msgstr "Jetons statiques"
#: src/pages/stages/prompt/PromptForm.ts #: src/pages/stages/prompt/PromptForm.ts
msgid "Static: Static value, displayed as-is." msgid "Static: Static value, displayed as-is."
@ -4604,6 +4604,10 @@ msgstr "Certificat de vérification TLS"
msgid "TOTP Authenticators" msgid "TOTP Authenticators"
msgstr "Authentificateur TOTP" msgstr "Authentificateur TOTP"
#: src/user/user-settings/mfa/MFADevicesPage.ts
msgid "TOTP Device"
msgstr ""
#: src/user/user-settings/mfa/MFADevicesPage.ts #: src/user/user-settings/mfa/MFADevicesPage.ts
msgid "TOTP authenticator" msgid "TOTP authenticator"
msgstr "" msgstr ""

View File

@ -4210,9 +4210,9 @@ msgstr ""
msgid "Static authenticator" msgid "Static authenticator"
msgstr "" msgstr ""
#: #: src/user/user-settings/mfa/MFADevicesPage.ts
#~ msgid "Static tokens" msgid "Static tokens"
#~ msgstr "" msgstr ""
#: src/pages/stages/prompt/PromptForm.ts #: src/pages/stages/prompt/PromptForm.ts
msgid "Static: Static value, displayed as-is." msgid "Static: Static value, displayed as-is."
@ -4644,6 +4644,10 @@ msgstr ""
msgid "TOTP Authenticators" msgid "TOTP Authenticators"
msgstr "" msgstr ""
#: src/user/user-settings/mfa/MFADevicesPage.ts
msgid "TOTP Device"
msgstr ""
#: src/user/user-settings/mfa/MFADevicesPage.ts #: src/user/user-settings/mfa/MFADevicesPage.ts
msgid "TOTP authenticator" msgid "TOTP authenticator"
msgstr "" msgstr ""

View File

@ -138,10 +138,21 @@ export class MFADevicesPage extends Table<Device> {
</ak-forms-delete-bulk>`; </ak-forms-delete-bulk>`;
} }
deviceTypeName(device: Device): string {
switch (device.type) {
case "otp_static.StaticDevice":
return t`Static tokens`;
case "otp_totp.TOTPDevice":
return t`TOTP Device`;
default:
return device.verboseName;
}
}
row(item: Device): TemplateResult[] { row(item: Device): TemplateResult[] {
return [ return [
html`${item.name}`, html`${item.name}`,
html`${item.verboseName}`, html`${this.deviceTypeName(item)}`,
html` html`
<ak-forms-modal> <ak-forms-modal>
<span slot="submit">${t`Update`}</span> <span slot="submit">${t`Update`}</span>