Feature: click picbed name can link to login page now, add some i18n key

This commit is contained in:
萌萌哒赫萝 2023-03-17 10:39:14 +08:00
parent 8feb30adbf
commit d725e71617
7 changed files with 54 additions and 5 deletions

View File

@ -30,6 +30,7 @@ CURRENT_PICBED: Current Picbed
CHOOSE_YOUR_DEFAULT_PICBED: 'Choose ${d} as your default picbed:' CHOOSE_YOUR_DEFAULT_PICBED: 'Choose ${d} as your default picbed:'
UPLOAD_AREA: Upload Area UPLOAD_AREA: Upload Area
UPLOAD_VIEW_HINT: Click to open picbeds settings UPLOAD_VIEW_HINT: Click to open picbeds settings
MANAGE_PAGE: Manage Page
GALLERY: Gallery GALLERY: Gallery
PICBEDS_SETTINGS: Picbeds Settings PICBEDS_SETTINGS: Picbeds Settings
PICBEDS_MANAGE: Picbeds Manage PICBEDS_MANAGE: Picbeds Manage

View File

@ -30,6 +30,7 @@ CURRENT_PICBED: 当前图床
CHOOSE_YOUR_DEFAULT_PICBED: 选择 ${d} 作为你默认图床: CHOOSE_YOUR_DEFAULT_PICBED: 选择 ${d} 作为你默认图床:
UPLOAD_AREA: 上传区 UPLOAD_AREA: 上传区
UPLOAD_VIEW_HINT: 点击打开图床设置 UPLOAD_VIEW_HINT: 点击打开图床设置
MANAGE_PAGE: 管理页面
GALLERY: 相册 GALLERY: 相册
PICBEDS_SETTINGS: 图床设置 PICBEDS_SETTINGS: 图床设置
PICBEDS_MANAGE: 图床管理 PICBEDS_MANAGE: 图床管理

View File

@ -30,6 +30,7 @@ CURRENT_PICBED: 當前圖床
CHOOSE_YOUR_DEFAULT_PICBED: 選擇 ${d} 作為你的預設圖床: CHOOSE_YOUR_DEFAULT_PICBED: 選擇 ${d} 作為你的預設圖床:
UPLOAD_AREA: 上傳區 UPLOAD_AREA: 上傳區
UPLOAD_VIEW_HINT: 點擊打開圖床設定 UPLOAD_VIEW_HINT: 點擊打開圖床設定
MANAGE_PAGE: 管理頁面
GALLERY: 相簿 GALLERY: 相簿
PICBEDS_SETTINGS: 圖床設定 PICBEDS_SETTINGS: 圖床設定
PICBEDS_MANAGE: 圖床管理 PICBEDS_MANAGE: 圖床管理

View File

@ -63,7 +63,7 @@
<el-icon> <el-icon>
<PieChart /> <PieChart />
</el-icon> </el-icon>
<span>管理页面</span> <span>{{ $T('MANAGE_PAGE') }}</span>
</el-menu-item> </el-menu-item>
<el-menu-item :index="routerConfig.GALLERY_PAGE"> <el-menu-item :index="routerConfig.GALLERY_PAGE">
<el-icon> <el-icon>

View File

@ -3,9 +3,9 @@
id="mini-page" id="mini-page"
:class="{ linux: os === 'linux' }" :class="{ linux: os === 'linux' }"
> >
<img <img
:src="logoPath.value ? logoPath.value : require('../assets/squareLogo.png')" :src="logoPath.value ? logoPath.value : require('../assets/squareLogo.png')"
style="width: 100%; height: 100%;border-radius: 50%;" style="width: 100%; height: 100%;border-radius: 50%;"
> >
<div <div
id="upload-area" id="upload-area"

View File

@ -8,8 +8,16 @@
:span="20" :span="20"
:offset="2" :offset="2"
> >
<div class="view-title"> <div
class="view-title"
@click="handelNameClick"
>
{{ picBedName }} {{ $T('SETTINGS') }} {{ picBedName }} {{ $T('SETTINGS') }}
<el-icon
v-if="linkToLogInList.includes(picBedName)"
>
<Link />
</el-icon>
</div> </div>
<config-form <config-form
v-if="config.length > 0" v-if="config.length > 0"
@ -53,6 +61,8 @@ import {
ipcRenderer, ipcRenderer,
IpcRendererEvent IpcRendererEvent
} from 'electron' } from 'electron'
import { OPEN_URL } from '~/universal/events/constants'
import { Link } from '@element-plus/icons-vue'
const type = ref('') const type = ref('')
const config = ref<IPicGoPluginConfig[]>([]) const config = ref<IPicGoPluginConfig[]>([])
const picBedName = ref('') 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) { function getPicBeds (event: IpcRendererEvent, _config: IPicGoPluginConfig[], name: string) {
config.value = _config config.value = _config
picBedName.value = name picBedName.value = name
@ -104,6 +145,10 @@ export default {
height 100% height 100%
overflow-y auto overflow-y auto
overflow-x hidden overflow-x hidden
.view-title
&:hover
cursor pointer
color #409EFF
.confirm-btn .confirm-btn
width: 250px width: 250px
.el-form .el-form

View File

@ -28,6 +28,7 @@ interface ILocales {
CHOOSE_YOUR_DEFAULT_PICBED: string CHOOSE_YOUR_DEFAULT_PICBED: string
UPLOAD_AREA: string UPLOAD_AREA: string
UPLOAD_VIEW_HINT: string UPLOAD_VIEW_HINT: string
MANAGE_PAGE: string
GALLERY: string GALLERY: string
PICBEDS_SETTINGS: string PICBEDS_SETTINGS: string
PICBEDS_MANAGE: string PICBEDS_MANAGE: string