Improve layout in 2FA setup dialog

This commit is contained in:
Johannes Zellner
2025-03-23 10:04:06 +01:00
parent 113a3eb5cf
commit 5ef0ad9a3e
+7 -6
View File
@@ -5,7 +5,7 @@ const i18n = useI18n();
const t = i18n.t;
import { ref, onMounted, useTemplateRef } from 'vue';
import { Button, Dropdown, Dialog, InputDialog, TextInput } from 'pankow';
import { Button, Dropdown, Dialog, InputDialog, TextInput, InputGroup } from 'pankow';
import { TOKEN_TYPES } from '../constants.js';
import AppPasswords from '../components/AppPasswords.vue';
import SettingsItem from '../components/SettingsItem.vue';
@@ -239,8 +239,7 @@ onMounted(async () => {
<template>
<InputDialog ref="inputDialog" />
<Dialog ref="twoFADialog"
:title="$t('profile.enable2FA.title')">
<Dialog ref="twoFADialog" :title="$t('profile.enable2FA.title')" :show-x="true">
<div style="text-align: center; max-width: 420px">
<p v-show="mandatory2FAHelp">{{ $t('profile.enable2FA.description') }}</p>
<p v-html="$t('profile.enable2FA.authenticatorAppDescription', { googleAuthenticatorPlayStoreLink: 'https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2', googleAuthenticatorITunesLink: 'https://itunes.apple.com/us/app/google-authenticator/id388497605', freeOTPPlayStoreLink: 'https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp', freeOTPITunesLink: 'https://itunes.apple.com/us/app/freeotp-authenticator/id872559395'})"></p>
@@ -251,11 +250,13 @@ onMounted(async () => {
<p class="has-error" v-show="twoFAEnableError">{{ twoFAEnableError }} </p>
<form @submit.prevent="onTwoFAEnable()">
<input type="submit" style="display: none;" :disabled="!twoFATotpToken"/>
<FormGroup>
<FormGroup style="text-align: left;">
<label for="totpTokenInput">{{ $t('profile.enable2FA.token') }}</label>
<TextInput v-model="twoFATotpToken" id="totpTokenInput" />
<InputGroup>
<TextInput v-model="twoFATotpToken" id="totpTokenInput" style="flex-grow: 1;"/>
<Button @click="onTwoFAEnable()" :disabled="!twoFATotpToken">{{ $t('profile.enable2FA.enable') }}</Button>
</InputGroup>
</FormGroup>
<Button @click="onTwoFAEnable()" :disabled="!twoFATotpToken">{{ $t('profile.enable2FA.enable') }}</Button>
</form>
</div>
</Dialog>