mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-01-23 06:38:13 -05:00
✨ Feature: add link for manual in main menu
This commit is contained in:
parent
74d0c9340e
commit
ccac4968e6
@ -32,6 +32,9 @@ UPLOAD_AREA: Upload
|
||||
UPLOAD_VIEW_HINT: Click to open picbeds settings
|
||||
MANAGE_PAGE: Manage
|
||||
GALLERY: Gallery
|
||||
MANUAL: Manual
|
||||
OPEN_MANUAL_LINK: Open Manual Link
|
||||
OPEN_MANUAL_LINK_HINT: Will open the manual link in your browser, do you want to continue?
|
||||
PICBEDS_SETTINGS: Picbeds
|
||||
PICBEDS_MANAGE: Picbeds Manage
|
||||
PICLIST_SETTINGS: Settings
|
||||
|
@ -32,6 +32,9 @@ UPLOAD_AREA: 上传区
|
||||
UPLOAD_VIEW_HINT: 点击打开图床设置
|
||||
MANAGE_PAGE: 管理
|
||||
GALLERY: 相册
|
||||
MANUAL: 手册
|
||||
OPEN_MANUAL_LINK: 前往手册
|
||||
OPEN_MANUAL_LINK_HINT: 即将打开PicList使用手册网页, 是否继续?
|
||||
PICBEDS_SETTINGS: 图床设置
|
||||
PICBEDS_MANAGE: 图床管理
|
||||
PICLIST_SETTINGS: PicList设置
|
||||
|
@ -32,6 +32,9 @@ UPLOAD_AREA: 上傳
|
||||
UPLOAD_VIEW_HINT: 點擊打開圖床設定
|
||||
MANAGE_PAGE: 管理
|
||||
GALLERY: 相簿
|
||||
MANUAL: 手冊
|
||||
OPEN_MANUAL_LINK: 前往手冊
|
||||
OPEN_MANUAL_LINK_HINT: 即將打開PicList使用手冊網頁,是否繼續?
|
||||
PICBEDS_SETTINGS: 圖床設定
|
||||
PICBEDS_MANAGE: 圖床管理
|
||||
PICLIST_SETTINGS: PicList設定
|
||||
|
@ -104,6 +104,12 @@
|
||||
</el-icon>
|
||||
<span>{{ $T('PLUGIN_SETTINGS') }}</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="MANUAL">
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<span>{{ $T('MANUAL') }}</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
<el-icon
|
||||
class="info-window"
|
||||
@ -228,9 +234,10 @@ import {
|
||||
Minus,
|
||||
CirclePlus,
|
||||
Close,
|
||||
PieChart
|
||||
PieChart,
|
||||
Link
|
||||
} from '@element-plus/icons-vue'
|
||||
import { ElMessage as $message } from 'element-plus'
|
||||
import { ElMessage as $message, ElMessageBox } from 'element-plus'
|
||||
import { T as $T } from '@/i18n/index'
|
||||
import { ref, onBeforeUnmount, Ref, onBeforeMount, watch, nextTick, reactive } from 'vue'
|
||||
import { onBeforeRouteUpdate, useRouter } from 'vue-router'
|
||||
@ -250,9 +257,11 @@ import {
|
||||
SHOW_MAIN_PAGE_MENU,
|
||||
SHOW_MAIN_PAGE_QRCODE,
|
||||
SHOW_MAIN_PAGE_DONATION,
|
||||
GET_PICBEDS
|
||||
GET_PICBEDS,
|
||||
OPEN_URL
|
||||
} from '~/universal/events/constants'
|
||||
import { getConfig, sendToMain } from '@/utils/dataSender'
|
||||
import { IConfig } from 'piclist'
|
||||
const version = ref(process.env.NODE_ENV === 'production' ? pkg.version : 'Dev')
|
||||
const routerConfig = reactive(config)
|
||||
const defaultActive = ref(routerConfig.UPLOAD_PAGE)
|
||||
@ -294,6 +303,27 @@ const handleGetPicPeds = () => {
|
||||
}
|
||||
|
||||
const handleSelect = (index: string) => {
|
||||
if (index === 'MANUAL') {
|
||||
ElMessageBox.confirm($T('OPEN_MANUAL_LINK_HINT'), $T('OPEN_MANUAL_LINK'), {
|
||||
confirmButtonText: $T('CONFIRM'),
|
||||
cancelButtonText: $T('CANCEL'),
|
||||
type: 'warning',
|
||||
center: true
|
||||
}).then(async () => {
|
||||
let language = 'zh-CN'
|
||||
const config = (await getConfig<IConfig>())!
|
||||
if (config !== undefined) {
|
||||
const settings = config.settings || {}
|
||||
language = settings.language ?? 'zh-CN'
|
||||
}
|
||||
if (language === 'zh-CN' || language === 'zh-TW') {
|
||||
sendToMain(OPEN_URL, 'https://piclist.cn/configure.html')
|
||||
} else {
|
||||
sendToMain(OPEN_URL, 'https://piclist.cn/en/configure.html')
|
||||
}
|
||||
}).catch(() => {})
|
||||
return
|
||||
}
|
||||
defaultActive.value = index
|
||||
const type = index.match(routerConfig.UPLOADER_CONFIG_PAGE)
|
||||
if (type === null) {
|
||||
|
3
src/universal/types/i18n.d.ts
vendored
3
src/universal/types/i18n.d.ts
vendored
@ -30,6 +30,9 @@ interface ILocales {
|
||||
UPLOAD_VIEW_HINT: string
|
||||
MANAGE_PAGE: string
|
||||
GALLERY: string
|
||||
MANUAL: string
|
||||
OPEN_MANUAL_LINK: string
|
||||
OPEN_MANUAL_LINK_HINT: string
|
||||
PICBEDS_SETTINGS: string
|
||||
PICBEDS_MANAGE: string
|
||||
PICLIST_SETTINGS: string
|
||||
|
Loading…
Reference in New Issue
Block a user