From 9cd22bdc066bd786630366c5fa4e0c4a86fcd4ad Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 2 Jul 2023 23:22:59 +0800 Subject: [PATCH] add application lock setting tab for desktop --- src/desktop-main.js | 3 + src/locales/en.js | 4 +- src/locales/zh_Hans.js | 4 +- .../desktop/app/settings/AppLockSetingTab.vue | 193 +++++++++++++++++- src/views/mobile/ApplicationLockPage.vue | 2 +- 5 files changed, 198 insertions(+), 8 deletions(-) diff --git a/src/desktop-main.js b/src/desktop-main.js index 73e5a213..0569f3af 100644 --- a/src/desktop-main.js +++ b/src/desktop-main.js @@ -27,12 +27,14 @@ import { VProgressLinear } from 'vuetify/components/VProgressLinear'; import { VSelect } from 'vuetify/components/VSelect'; import { VSheet } from 'vuetify/components/VSheet'; import { VSnackbar } from 'vuetify/components/VSnackbar'; +import { VSwitch } from 'vuetify/components/VSwitch'; import { VTabs, VTab } from 'vuetify/components/VTabs'; import { VTable } from 'vuetify/components/VTable'; import { VTextField } from 'vuetify/components/VTextField'; import { VToolbar } from 'vuetify/components/VToolbar'; import { VTooltip } from 'vuetify/components/VTooltip'; import { VWindow, VWindowItem } from 'vuetify/components/VWindow'; + import { aliases, mdi } from 'vuetify/iconsets/mdi-svg'; import 'vuetify/styles'; @@ -114,6 +116,7 @@ const vuetify = createVuetify({ VSelect, VSheet, VSnackbar, + VSwitch, VTabs, VTab, VTable, diff --git a/src/locales/en.js b/src/locales/en.js index ca55597a..0103fb80 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -1119,11 +1119,13 @@ export default { 'Application Lock': 'Application Lock', 'Application lock has been enabled': 'Application lock has been enabled', 'Application lock is not enabled': 'Application lock is not enabled', + 'Enable Application Lock': 'Enable Application Lock', + 'Disable Application Lock': 'Disable Application Lock', 'PIN Code': 'PIN Code', 'Unlock By PIN Code': 'Unlock By PIN Code', 'Unlock By WebAuthn': 'Unlock By WebAuthn', 'Please input a new 6-digit PIN code. PIN code would encrypt your local data, so you need input this PIN code when you launch this app. If this PIN code is lost, you should re-login.': 'Please input a new 6-digit PIN code. PIN code would encrypt your local data, so you need input this PIN code when you launch this app. If this PIN code is lost, you should re-login.', - 'Please enter your current PIN code when disable application lock': 'Please enter your current PIN code when disable application lock', + 'Please enter your current PIN code when disable application lock.': 'Please enter your current PIN code when disable application lock.', 'You have enabled WebAuthn successfully': 'You have enabled WebAuthn successfully', 'This device does not support WebAuthn': 'This device does not support WebAuthn', 'Failed to enable WebAuthn': 'Failed to enable WebAuthn', diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js index 001d32be..0135a137 100644 --- a/src/locales/zh_Hans.js +++ b/src/locales/zh_Hans.js @@ -1119,11 +1119,13 @@ export default { 'Application Lock': '应用锁', 'Application lock has been enabled': '应用锁已经启用', 'Application lock is not enabled': '应用锁没有启用', + 'Enable Application Lock': '启用应用锁', + 'Disable Application Lock': '禁用应用锁', 'PIN Code': 'PIN码', 'Unlock By PIN Code': '使用PIN码解锁', 'Unlock By WebAuthn': '使用WebAuthn解锁', 'Please input a new 6-digit PIN code. PIN code would encrypt your local data, so you need input this PIN code when you launch this app. If this PIN code is lost, you should re-login.': '请输入一个新的6位数字PIN码,PIN码会加密你的本地数据,所以您每次打开应用时都需要输入PIN码。如果您忘记了PIN码,您需要重新登录。', - 'Please enter your current PIN code when disable application lock': '禁用应用锁时需要输入当前的PIN码', + 'Please enter your current PIN code when disable application lock.': '禁用应用锁时需要输入当前的PIN码。', 'You have enabled WebAuthn successfully': '您已经成功开启 WebAuth', 'This device does not support WebAuthn': '当前设备不支持 WebAuth', 'Failed to enable WebAuthn': '启用 WebAuth 失败', diff --git a/src/views/desktop/app/settings/AppLockSetingTab.vue b/src/views/desktop/app/settings/AppLockSetingTab.vue index a77b0349..6d2573cd 100644 --- a/src/views/desktop/app/settings/AppLockSetingTab.vue +++ b/src/views/desktop/app/settings/AppLockSetingTab.vue @@ -2,16 +2,199 @@ - - - - + +

+ {{ $t('Application lock is not enabled') }} +

+

+ {{ $t('Application lock has been enabled') }} +

+
+ + + + + + + +

+ {{ $t('Please input a new 6-digit PIN code. PIN code would encrypt your local data, so you need input this PIN code when you launch this app. If this PIN code is lost, you should re-login.') }} +

+

+ {{ $t('Please enter your current PIN code when disable application lock.') }} +

+
+ + + + +
+ +
+
+
+
+ + + + + + {{ $t('Enable Application Lock') }} + + + {{ $t('Disable Application Lock') }} + + + +
+ + - diff --git a/src/views/mobile/ApplicationLockPage.vue b/src/views/mobile/ApplicationLockPage.vue index 80be6ff6..c3d9b9cf 100644 --- a/src/views/mobile/ApplicationLockPage.vue +++ b/src/views/mobile/ApplicationLockPage.vue @@ -27,7 +27,7 @@