From d725e71617465420229201d739a04bfc6bd9ffa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92=E8=B5=AB=E8=90=9D?= Date: Fri, 17 Mar 2023 10:39:14 +0800 Subject: [PATCH] :sparkles: Feature: click picbed name can link to login page now, add some i18n key --- public/i18n/en.yml | 1 + public/i18n/zh-CN.yml | 1 + public/i18n/zh-TW.yml | 1 + src/renderer/layouts/Main.vue | 2 +- src/renderer/pages/MiniPage.vue | 6 ++-- src/renderer/pages/picbeds/index.vue | 47 +++++++++++++++++++++++++++- src/universal/types/i18n.d.ts | 1 + 7 files changed, 54 insertions(+), 5 deletions(-) diff --git a/public/i18n/en.yml b/public/i18n/en.yml index 17240ca..b8f0708 100644 --- a/public/i18n/en.yml +++ b/public/i18n/en.yml @@ -30,6 +30,7 @@ CURRENT_PICBED: Current Picbed CHOOSE_YOUR_DEFAULT_PICBED: 'Choose ${d} as your default picbed:' UPLOAD_AREA: Upload Area UPLOAD_VIEW_HINT: Click to open picbeds settings +MANAGE_PAGE: Manage Page GALLERY: Gallery PICBEDS_SETTINGS: Picbeds Settings PICBEDS_MANAGE: Picbeds Manage diff --git a/public/i18n/zh-CN.yml b/public/i18n/zh-CN.yml index cca0660..a885553 100644 --- a/public/i18n/zh-CN.yml +++ b/public/i18n/zh-CN.yml @@ -30,6 +30,7 @@ CURRENT_PICBED: 当前图床 CHOOSE_YOUR_DEFAULT_PICBED: 选择 ${d} 作为你默认图床: UPLOAD_AREA: 上传区 UPLOAD_VIEW_HINT: 点击打开图床设置 +MANAGE_PAGE: 管理页面 GALLERY: 相册 PICBEDS_SETTINGS: 图床设置 PICBEDS_MANAGE: 图床管理 diff --git a/public/i18n/zh-TW.yml b/public/i18n/zh-TW.yml index 9bd926d..b16b6d1 100644 --- a/public/i18n/zh-TW.yml +++ b/public/i18n/zh-TW.yml @@ -30,6 +30,7 @@ CURRENT_PICBED: 當前圖床 CHOOSE_YOUR_DEFAULT_PICBED: 選擇 ${d} 作為你的預設圖床: UPLOAD_AREA: 上傳區 UPLOAD_VIEW_HINT: 點擊打開圖床設定 +MANAGE_PAGE: 管理頁面 GALLERY: 相簿 PICBEDS_SETTINGS: 圖床設定 PICBEDS_MANAGE: 圖床管理 diff --git a/src/renderer/layouts/Main.vue b/src/renderer/layouts/Main.vue index ab3d557..c13f2be 100644 --- a/src/renderer/layouts/Main.vue +++ b/src/renderer/layouts/Main.vue @@ -63,7 +63,7 @@ - 管理页面 + {{ $T('MANAGE_PAGE') }} diff --git a/src/renderer/pages/MiniPage.vue b/src/renderer/pages/MiniPage.vue index 10de295..a9df23c 100644 --- a/src/renderer/pages/MiniPage.vue +++ b/src/renderer/pages/MiniPage.vue @@ -3,9 +3,9 @@ id="mini-page" :class="{ linux: os === 'linux' }" > -
-
+
{{ picBedName }} {{ $T('SETTINGS') }} + + +
([]) const picBedName = ref('') @@ -80,6 +90,37 @@ const handleConfirm = async () => { } } +const linkToLogInList = ['GitHub', '腾讯云COS', '阿里云OSS', 'SM.MS', '七牛云', 'Imgur', '又拍云', 'githubPlus'] + +function handelNameClick () { + switch (picBedName.value) { + case 'GitHub': + case 'githubPlus': + sendToMain(OPEN_URL, 'https://github.com') + break + case '腾讯云COS': + sendToMain(OPEN_URL, 'https://cloud.tencent.com/login') + break + case '阿里云OSS': + sendToMain(OPEN_URL, 'https://account.aliyun.com/login/login.htm') + break + case 'SM.MS': + sendToMain(OPEN_URL, 'https://smms.app') + break + case '七牛云': + sendToMain(OPEN_URL, 'https://portal.qiniu.com') + break + case 'Imgur': + sendToMain(OPEN_URL, 'https://imgur.com') + break + case '又拍云': + sendToMain(OPEN_URL, 'https://console.upyun.com') + break + default: + break + } +} + function getPicBeds (event: IpcRendererEvent, _config: IPicGoPluginConfig[], name: string) { config.value = _config picBedName.value = name @@ -104,6 +145,10 @@ export default { height 100% overflow-y auto overflow-x hidden + .view-title + &:hover + cursor pointer + color #409EFF .confirm-btn width: 250px .el-form diff --git a/src/universal/types/i18n.d.ts b/src/universal/types/i18n.d.ts index 63767a5..1f6b092 100644 --- a/src/universal/types/i18n.d.ts +++ b/src/universal/types/i18n.d.ts @@ -28,6 +28,7 @@ interface ILocales { CHOOSE_YOUR_DEFAULT_PICBED: string UPLOAD_AREA: string UPLOAD_VIEW_HINT: string + MANAGE_PAGE: string GALLERY: string PICBEDS_SETTINGS: string PICBEDS_MANAGE: string