From fd018dc5acef2ef89f79a8533050cff8bbc03fb3 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 11 Oct 2023 16:31:07 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BB=85=E6=9C=AC=E5=9C=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=85=81=E8=AE=B8=E4=BD=BF=E7=94=A8=20passkey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Apps/UserConfirmDialog/index.vue | 5 +++-- src/i18n/langs/en.json | 7 ++++++- src/i18n/langs/ja.json | 9 +++++++-- src/i18n/langs/zh.json | 3 ++- src/views/profile/PassKey.vue | 16 ++++++++++++++-- 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/components/Apps/UserConfirmDialog/index.vue b/src/components/Apps/UserConfirmDialog/index.vue index afa42e35f..9938fd50b 100644 --- a/src/components/Apps/UserConfirmDialog/index.vue +++ b/src/components/Apps/UserConfirmDialog/index.vue @@ -94,10 +94,10 @@ export default { data() { return { title: this.$t('common.CurrentUserVerify'), + smsBtnText: this.$t('common.SendVerificationCode'), smsWidth: 0, subTypeSelected: '', inputPlaceholder: '', - smsBtnText: this.$t('common.SendVerificationCode'), smsBtnDisabled: false, confirmTypeRequired: '', subTypeChoices: [], @@ -119,7 +119,7 @@ export default { watch: { visible(val) { if (!val) { - this.$emit('onConfirmCancel', true) + this.$emit('onConfirmFinal', true) } } }, @@ -189,6 +189,7 @@ export default { }).catch((e) => { this.$emit('onHandlerError', e) }).finally(() => { + this.$emit('onConfirmFinal') this.visible = false }) }, diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 006a12905..86735aaca 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -2313,5 +2313,10 @@ "applets": { "PublishStatus": "Publish status", "NoPublished": "Unpublished" + }, + "profile": { + "CreateAccessKey": "Create Access key", + "ApiKeyWarning": "To reduce the risk of AccessKey exposure, Secret is provided only during creation and cannot be queried again later. Please keep it safe.", + "PasskeyAddDisableInfo": "Your authentication source is {source}, and Passkey addition is not supported." } -} +} \ No newline at end of file diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index 617cd419a..e261aaa40 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -1023,7 +1023,7 @@ "ratio": "スケール", "run": "実行", "runAs": "実行ユーザー", - "runningPath":"実行パス", + "runningPath": "実行パス", "runTimes": "実行回数", "selectAssetsMessage": "左側の資産を選択し、実行するシステムユーザーを選択し、コマンドを一括実行します", "selectedAssets": "選択済アセット:", @@ -2304,5 +2304,10 @@ "applets": { "PublishStatus": "投稿ステータス", "NoPublished": "未発表" + }, + "profile": { + "CreateAccessKey": "Create Access key", + "ApiKeyWarning": "AccessKeyの漏洩リスクを低減するため、Secretは作成時にのみ提供され、後で再度クエリできません。安全に保管してください。", + "PasskeyAddDisableInfo": "あなたの認証元は {source} であり、Passkeyの追加はサポートされていません。" } -} +} \ No newline at end of file diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index df354eedc..4e8370a69 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -1878,7 +1878,8 @@ }, "profile": { "CreateAccessKey": "创建访问密钥", - "ApiKeyWarning": "为降低 AccessKey 泄露的风险,只在创建时提供 Secret,后续不可再进行查询,请妥善保存。" + "ApiKeyWarning": "为降低 AccessKey 泄露的风险,只在创建时提供 Secret,后续不可再进行查询,请妥善保存。", + "PasskeyAddDisableInfo": "你的认证来源是 {source}, 不支持添加 Passkey" }, "users": { "LunaSettingUpdate": "Luna 配置设置", diff --git a/src/views/profile/PassKey.vue b/src/views/profile/PassKey.vue index 86ad4fbda..8845410b3 100644 --- a/src/views/profile/PassKey.vue +++ b/src/views/profile/PassKey.vue @@ -10,7 +10,10 @@ :title="$tc('auth.AddPassKey')" :visible.sync="dialogVisible" > - + + {{ $t('profile.PasskeyAddDisableInfo', {source: source.label}) }} + + @@ -115,6 +118,12 @@ export default { computed: { getRefsListTable() { return this.$refs.GenericListTable.$refs.ListTable.$refs.ListTable || {} + }, + isLocalUser() { + return this.source?.value === 'local' + }, + source() { + return this.$store.getters.currentUser?.source } }, methods: { @@ -149,5 +158,8 @@ export default { } -