Update 2fa.vue

This commit is contained in:
syuilo 2025-03-03 12:52:20 +09:00
parent 47d8550de3
commit 68230ec2cd
1 changed files with 67 additions and 59 deletions

View File

@ -4,8 +4,9 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<SearchMarker :keywords="['2fa']">
<FormSection :first="first">
<template #label>{{ i18n.ts['2fa'] }}</template>
<template #label><SearchLabel>{{ i18n.ts['2fa'] }}</SearchLabel></template>
<div v-if="$i" class="_gaps_s">
<MkInfo v-if="$i.twoFactorEnabled && $i.twoFactorBackupCodesStock === 'partial'" warn>
@ -15,10 +16,11 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts._2fa.backupCodesExhaustedWarning }}
</MkInfo>
<SearchMarker :keywords="['totp', 'app']">
<MkFolder :defaultOpen="true">
<template #icon><i class="ti ti-shield-lock"></i></template>
<template #label>{{ i18n.ts.totp }}</template>
<template #caption>{{ i18n.ts.totpDescription }}</template>
<template #label><SearchLabel>{{ i18n.ts.totp }}</SearchLabel></template>
<template #caption><SearchKeyword>{{ i18n.ts.totpDescription }}</SearchKeyword></template>
<template #suffix><i v-if="$i.twoFactorEnabled" class="ti ti-check" style="color: var(--MI_THEME-success)"></i></template>
<div v-if="$i.twoFactorEnabled" class="_gaps_s">
@ -35,10 +37,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkLink url="https://misskey-hub.net/docs/for-users/stepped-guides/how-to-enable-2fa/" target="_blank"><i class="ti ti-help-circle"></i> {{ i18n.ts.learnMore }}</MkLink>
</div>
</MkFolder>
</SearchMarker>
<SearchMarker :keywords="['security', 'key', 'passkey']">
<MkFolder>
<template #icon><i class="ti ti-key"></i></template>
<template #label>{{ i18n.ts.securityKeyAndPasskey }}</template>
<template #label><SearchLabel>{{ i18n.ts.securityKeyAndPasskey }}</SearchLabel></template>
<div class="_gaps_s">
<MkInfo>
{{ i18n.ts._2fa.securityKeyInfo }}
@ -65,13 +69,17 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
</div>
</MkFolder>
</SearchMarker>
<SearchMarker :keywords="['password', 'less', 'key', 'passkey', 'login', 'signin']">
<MkSwitch :disabled="!$i.twoFactorEnabled || $i.securityKeysList.length === 0" :modelValue="usePasswordLessLogin" @update:modelValue="v => updatePasswordLessLogin(v)">
<template #label>{{ i18n.ts.passwordLessLogin }}</template>
<template #caption>{{ i18n.ts.passwordLessLoginDescription }}</template>
<template #label><SearchLabel>{{ i18n.ts.passwordLessLogin }}</SearchLabel></template>
<template #caption><SearchKeyword>{{ i18n.ts.passwordLessLoginDescription }}</SearchKeyword></template>
</MkSwitch>
</SearchMarker>
</div>
</FormSection>
</SearchMarker>
</template>
<script lang="ts" setup>