Skip to content

Commit

Permalink
✨ Feature(custom): update manual url for en language
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed May 26, 2024
1 parent 892a147 commit e6ee325
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 26 deletions.
2 changes: 1 addition & 1 deletion FAQ_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This FAQ has been modified from PicGo's FAQ, and thanks to the author Molunerfin

## Common Questions

> Please refer to [user manual](https://piclist.cn) for general configuration issues.
> Please refer to [user manual](https://piclist.cn/en) for general configuration issues.
## 1. What is the relationship between PicList and PicGo?

Expand Down
8 changes: 5 additions & 3 deletions src/renderer/pages/PicGoSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ import pkg from 'root/package.json'
// 事件常量
import { PICGO_OPEN_FILE, PICGO_OPEN_DIRECTORY, OPEN_URL, GET_PICBEDS, HIDE_DOCK } from '#/events/constants'
import { IRPCActionType, ISartMode } from '~/universal/types/enum'
import { II18nLanguage, IRPCActionType, ISartMode } from '~/universal/types/enum'
// Electron 相关
import {
Expand Down Expand Up @@ -2704,8 +2704,10 @@ function handleManualPageOpenChange (val: string) {
})
}
function goConfigPage () {
sendToMain(OPEN_URL, 'https://piclist.cn/configure.html')
async function goConfigPage () {
const lang = await getConfig(configPaths.settings.language) || II18nLanguage.ZH_CN
const url = lang === II18nLanguage.ZH_CN ? 'https://piclist.cn/configure.html' : 'https://piclist.cn/en/configure.html'
sendToMain(OPEN_URL, url)
}
function goShortCutPage () {
Expand Down
27 changes: 5 additions & 22 deletions src/renderer/pages/picbeds/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</template>
<script lang="ts" setup>
// 枚举类型声明
import { IRPCActionType } from '~/universal/types/enum'
import { II18nLanguage, IRPCActionType } from '~/universal/types/enum'
// Vue 相关
import { ref, onBeforeUnmount, onBeforeMount } from 'vue'
Expand Down Expand Up @@ -133,6 +133,7 @@ import dayjs from 'dayjs'
// Element Plus 下拉菜单组件
import { ElDropdown, ElMessage } from 'element-plus'
import { configPaths } from '~/universal/utils/configPaths'
import { picBedManualUrlList } from '~/universal/utils/static'
const type = ref('')
const config = ref<IPicGoPluginConfig[]>([])
Expand Down Expand Up @@ -200,27 +201,9 @@ const handleReset = async () => {
$router.back()
}
function handleNameClick () {
const typeUrlMap: IStringKeyMap = {
github: 'https://piclist.cn/configure.html#github%E5%9B%BE%E5%BA%8A',
githubPlus: 'https://piclist.cn/configure.html#github%E5%9B%BE%E5%BA%8A',
tcyun: 'https://piclist.cn/configure.html#%E8%85%BE%E8%AE%AF%E4%BA%91cos',
aliyun: 'https://piclist.cn/configure.html#%E9%98%BF%E9%87%8C%E4%BA%91oss',
smms: 'https://piclist.cn/configure.html#sm-ms',
qiniu: 'https://piclist.cn/configure.html#%E4%B8%83%E7%89%9B%E4%BA%91',
imgur: 'https://piclist.cn/configure.html#imgur',
upyun: 'https://piclist.cn/configure.html#%E5%8F%88%E6%8B%8D%E4%BA%91',
'aws-s3-plist': 'https://piclist.cn/configure.html#%E5%86%85%E7%BD%AEaws-s3',
'aws-s3': 'https://piclist.cn/configure.html#%E5%86%85%E7%BD%AEaws-s3',
local: 'https://piclist.cn/configure.html#%E6%9C%AC%E5%9C%B0%E5%9B%BE%E5%BA%8A',
lskyplist: 'https://piclist.cn/configure.html#%E5%85%B0%E7%A9%BA%E5%9B%BE%E5%BA%8A',
sftpplist: 'https://piclist.cn/configure.html#%E5%86%85%E7%BD%AEsftp',
telegraphplist: 'https://piclist.cn/configure.html#telegra-ph',
webdavplist: 'https://piclist.cn/configure.html#webdav',
piclist: 'https://piclist.cn/configure.html#piclist',
lankong: 'https://github.com/hellodk34/picgo-plugin-lankong'
}
const url = typeUrlMap[$route.params.type as string]
async function handleNameClick () {
const lang = await getConfig(configPaths.settings.language) || II18nLanguage.ZH_CN
const url = picBedManualUrlList[lang === II18nLanguage.EN ? 'en' : 'zh_cn'][$route.params.type as string]
if (url) {
sendToMain(OPEN_URL, url)
}
Expand Down
41 changes: 41 additions & 0 deletions src/universal/utils/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,45 @@ export const picBedsCanbeDeleted = [
'webdavplist'
]

export const picBedManualUrlList: IStringKeyMap = {
zh_cn: {
aliyun: 'https://piclist.cn/configure.html#%E9%98%BF%E9%87%8C%E4%BA%91oss',
'aws-s3': 'https://piclist.cn/configure.html#%E5%86%85%E7%BD%AEaws-s3',
'aws-s3-plist': 'https://piclist.cn/configure.html#%E5%86%85%E7%BD%AEaws-s3',
github: 'https://piclist.cn/configure.html#github%E5%9B%BE%E5%BA%8A',
githubPlus: 'https://piclist.cn/configure.html#github%E5%9B%BE%E5%BA%8A',
imgur: 'https://piclist.cn/configure.html#imgur',
lankong: 'https://github.com/hellodk34/picgo-plugin-lankong',
local: 'https://piclist.cn/configure.html#%E6%9C%AC%E5%9C%B0%E5%9B%BE%E5%BA%8A',
lskyplist: 'https://piclist.cn/configure.html#%E5%85%B0%E7%A9%BA%E5%9B%BE%E5%BA%8A',
tcyun: 'https://piclist.cn/configure.html#%E8%85%BE%E8%AE%AF%E4%BA%91cos',
piclist: 'https://piclist.cn/configure.html#piclist',
qiniu: 'https://piclist.cn/configure.html#%E4%B8%83%E7%89%9B%E4%BA%91',
sftpplist: 'https://piclist.cn/configure.html#%E5%86%85%E7%BD%AEsftp',
smms: 'https://piclist.cn/configure.html#sm-ms',
telegraphplist: 'https://piclist.cn/configure.html#telegra-ph',
upyun: 'https://piclist.cn/configure.html#%E5%8F%88%E6%8B%8D%E4%BA%91',
webdavplist: 'https://piclist.cn/configure.html#webdav'
},
en: {
aliyun: 'https://piclist.cn/en/configure.html#alibaba-cloud',
'aws-s3': 'https://piclist.cn/en/configure.html#built-in-aws-s3',
'aws-s3-plist': 'https://piclist.cn/en/configure.html#built-in-aws-s3',
github: 'https://piclist.cn/en/configure.html#github',
githubPlus: 'https://piclist.cn/en/configure.html#github',
imgur: 'https://piclist.cn/en/configure.html#imgur',
lankong: 'https://github.com/hellodk34/picgo-plugin-lankong',
local: 'https://piclist.cn/en/configure.html#local-image-hosting',
lskyplist: 'https://piclist.cn/en/configure.html#lsky-pro',
tcyun: 'https://piclist.cn/en/configure.html#tencent-cloud-cos',
piclist: 'https://piclist.cn/en/configure.html#piclist',
qiniu: 'https://piclist.cn/en/configure.html#qiniu-cloud',
sftpplist: 'https://piclist.cn/en/configure.html#built-in-sftp',
smms: 'https://piclist.cn/en/configure.html#sm-ms',
telegraphplist: 'https://piclist.cn/en/configure.html#telegra-ph',
upyun: 'https://piclist.cn/en/configure.html#upyun',
webdavplist: 'https://piclist.cn/en/configure.html#webdav'
}
}

export const DEFAULT_AES_PASSWORD = 'aesPassword'

0 comments on commit e6ee325

Please sign in to comment.