mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-02 11:08:13 -05:00
✨ Feature(custom): add new set item to open config file path
This commit is contained in:
parent
97d083df5a
commit
4be82e0afc
@ -195,6 +195,8 @@ SETTINGS_CURRENT_VERSION: Current Version
|
|||||||
SETTINGS_NEWEST_VERSION: Newest Version
|
SETTINGS_NEWEST_VERSION: Newest Version
|
||||||
SETTINGS_GETING: Getting...
|
SETTINGS_GETING: Getting...
|
||||||
SETTINGS_TIPS_HAS_NEW_VERSION: PicList has a new version, please click confirm to open download page
|
SETTINGS_TIPS_HAS_NEW_VERSION: PicList has a new version, please click confirm to open download page
|
||||||
|
SETTINGS_LOG_FILE_PATH: Log File Path
|
||||||
|
SETTINGS_CONFIG_FILE_PATH: Config File Path
|
||||||
SETTINGS_LOG_FILE: Log File
|
SETTINGS_LOG_FILE: Log File
|
||||||
SETTINGS_GUI_LOG_FILE: GUI Log File
|
SETTINGS_GUI_LOG_FILE: GUI Log File
|
||||||
SETTINGS_MANAGE_LOG_FILE: Manage Log File
|
SETTINGS_MANAGE_LOG_FILE: Manage Log File
|
||||||
|
@ -197,6 +197,8 @@ SETTINGS_CURRENT_VERSION: 当前版本
|
|||||||
SETTINGS_NEWEST_VERSION: 最新版本
|
SETTINGS_NEWEST_VERSION: 最新版本
|
||||||
SETTINGS_GETING: 正在获取中
|
SETTINGS_GETING: 正在获取中
|
||||||
SETTINGS_TIPS_HAS_NEW_VERSION: PicList更新啦,请点击确定打开下载页面
|
SETTINGS_TIPS_HAS_NEW_VERSION: PicList更新啦,请点击确定打开下载页面
|
||||||
|
SETTINGS_LOG_FILE_PATH: 日志文件路径
|
||||||
|
SETTINGS_CONFIG_FILE_PATH: 配置文件路径
|
||||||
SETTINGS_LOG_FILE: 常规日志文件
|
SETTINGS_LOG_FILE: 常规日志文件
|
||||||
SETTINGS_GUI_LOG_FILE: GUI日志文件
|
SETTINGS_GUI_LOG_FILE: GUI日志文件
|
||||||
SETTINGS_MANAGE_LOG_FILE: 管理日志文件
|
SETTINGS_MANAGE_LOG_FILE: 管理日志文件
|
||||||
|
@ -195,6 +195,8 @@ SETTINGS_CURRENT_VERSION: 當前版本
|
|||||||
SETTINGS_NEWEST_VERSION: 最新版本
|
SETTINGS_NEWEST_VERSION: 最新版本
|
||||||
SETTINGS_GETING: 正在取得中
|
SETTINGS_GETING: 正在取得中
|
||||||
SETTINGS_TIPS_HAS_NEW_VERSION: PicList更新啦,請點擊確定開啟下載頁面
|
SETTINGS_TIPS_HAS_NEW_VERSION: PicList更新啦,請點擊確定開啟下載頁面
|
||||||
|
SETTINGS_LOG_FILE_PATH: 記錄檔案路徑
|
||||||
|
SETTINGS_CONFIG_FILE_PATH: 設定檔案路徑
|
||||||
SETTINGS_LOG_FILE: 記錄檔案
|
SETTINGS_LOG_FILE: 記錄檔案
|
||||||
SETTINGS_GUI_LOG_FILE: GUI記錄檔案
|
SETTINGS_GUI_LOG_FILE: GUI記錄檔案
|
||||||
SETTINGS_MANAGE_LOG_FILE: 管理記錄檔案
|
SETTINGS_MANAGE_LOG_FILE: 管理記錄檔案
|
||||||
|
@ -40,6 +40,7 @@ import {
|
|||||||
PICGO_GET_BY_ID_DB,
|
PICGO_GET_BY_ID_DB,
|
||||||
PICGO_REMOVE_BY_ID_DB,
|
PICGO_REMOVE_BY_ID_DB,
|
||||||
PICGO_OPEN_FILE,
|
PICGO_OPEN_FILE,
|
||||||
|
PICGO_OPEN_DIRECTORY,
|
||||||
PASTE_TEXT,
|
PASTE_TEXT,
|
||||||
OPEN_WINDOW,
|
OPEN_WINDOW,
|
||||||
GET_LANGUAGE_LIST,
|
GET_LANGUAGE_LIST,
|
||||||
@ -379,6 +380,18 @@ const handleOpenFile = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleOpenDirectory = () => {
|
||||||
|
ipcMain.on(PICGO_OPEN_DIRECTORY, (event: IpcMainEvent, dirPath?: string, inStorePath: boolean = true) => {
|
||||||
|
if (inStorePath) {
|
||||||
|
dirPath = path.join(STORE_PATH, dirPath || '')
|
||||||
|
}
|
||||||
|
if (!dirPath || !fs.existsSync(dirPath)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
shell.openPath(dirPath)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const handleOpenWindow = () => {
|
const handleOpenWindow = () => {
|
||||||
ipcMain.on(OPEN_WINDOW, (event: IpcMainEvent, windowName: IWindowList) => {
|
ipcMain.on(OPEN_WINDOW, (event: IpcMainEvent, windowName: IWindowList) => {
|
||||||
const window = windowManager.get(windowName)
|
const window = windowManager.get(windowName)
|
||||||
@ -431,6 +444,7 @@ export default {
|
|||||||
handleImportLocalPlugin()
|
handleImportLocalPlugin()
|
||||||
handleUpdateAllPlugin()
|
handleUpdateAllPlugin()
|
||||||
handleOpenFile()
|
handleOpenFile()
|
||||||
|
handleOpenDirectory()
|
||||||
handleOpenWindow()
|
handleOpenWindow()
|
||||||
handleI18n()
|
handleI18n()
|
||||||
handleRPCActions()
|
handleRPCActions()
|
||||||
|
@ -283,6 +283,18 @@
|
|||||||
{{ $T('SETTINGS_CLICK_TO_OPEN') }}
|
{{ $T('SETTINGS_CLICK_TO_OPEN') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
:label="$T('SETTINGS_CONFIG_FILE_PATH')"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
round
|
||||||
|
size="small"
|
||||||
|
@click="openDirectory()"
|
||||||
|
>
|
||||||
|
{{ $T('SETTINGS_CLICK_TO_OPEN') }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -582,6 +594,18 @@
|
|||||||
label-width="50%"
|
label-width="50%"
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
|
<el-form-item
|
||||||
|
:label="$T('SETTINGS_LOG_FILE_PATH')"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
round
|
||||||
|
size="small"
|
||||||
|
@click="openDirectory()"
|
||||||
|
>
|
||||||
|
{{ $T('SETTINGS_CLICK_TO_OPEN') }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="$T('SETTINGS_SET_LOG_FILE')"
|
:label="$T('SETTINGS_SET_LOG_FILE')"
|
||||||
>
|
>
|
||||||
@ -1603,7 +1627,7 @@ import { Reading, Close, Edit, InfoFilled } from '@element-plus/icons-vue'
|
|||||||
import pkg from 'root/package.json'
|
import pkg from 'root/package.json'
|
||||||
|
|
||||||
// 事件常量
|
// 事件常量
|
||||||
import { PICGO_OPEN_FILE, OPEN_URL, GET_PICBEDS, HIDE_DOCK } from '#/events/constants'
|
import { PICGO_OPEN_FILE, PICGO_OPEN_DIRECTORY, OPEN_URL, GET_PICBEDS, HIDE_DOCK } from '#/events/constants'
|
||||||
import { IRPCActionType } from '~/universal/types/enum'
|
import { IRPCActionType } from '~/universal/types/enum'
|
||||||
|
|
||||||
// Electron 相关
|
// Electron 相关
|
||||||
@ -2046,6 +2070,10 @@ function openFile (file: string) {
|
|||||||
sendToMain(PICGO_OPEN_FILE, file)
|
sendToMain(PICGO_OPEN_FILE, file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openDirectory (directory?: string, inStorePath = true) {
|
||||||
|
sendToMain(PICGO_OPEN_DIRECTORY, directory, inStorePath)
|
||||||
|
}
|
||||||
|
|
||||||
function openLogSetting () {
|
function openLogSetting () {
|
||||||
logFileVisible.value = true
|
logFileVisible.value = true
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ export const PICGO_UPDATE_BY_ID_DB = 'PICGO_UPDATE_BY_ID_DB'
|
|||||||
export const PICGO_GET_BY_ID_DB = 'PICGO_GET_BY_ID_DB'
|
export const PICGO_GET_BY_ID_DB = 'PICGO_GET_BY_ID_DB'
|
||||||
export const PICGO_REMOVE_BY_ID_DB = 'PICGO_REMOVE_BY_ID_DB'
|
export const PICGO_REMOVE_BY_ID_DB = 'PICGO_REMOVE_BY_ID_DB'
|
||||||
export const PICGO_OPEN_FILE = 'PICGO_OPEN_FILE'
|
export const PICGO_OPEN_FILE = 'PICGO_OPEN_FILE'
|
||||||
|
export const PICGO_OPEN_DIRECTORY = 'PICGO_OPEN_DIRECTORY'
|
||||||
export const OPEN_DEVTOOLS = 'OPEN_DEVTOOLS'
|
export const OPEN_DEVTOOLS = 'OPEN_DEVTOOLS'
|
||||||
export const SHOW_MINI_PAGE_MENU = 'SHOW_MINI_PAGE_MENU'
|
export const SHOW_MINI_PAGE_MENU = 'SHOW_MINI_PAGE_MENU'
|
||||||
export const SHOW_MAIN_PAGE_MENU = 'SHOW_MAIN_PAGE_MENU'
|
export const SHOW_MAIN_PAGE_MENU = 'SHOW_MAIN_PAGE_MENU'
|
||||||
|
2
src/universal/types/i18n.d.ts
vendored
2
src/universal/types/i18n.d.ts
vendored
@ -190,6 +190,8 @@ interface ILocales {
|
|||||||
SETTINGS_NEWEST_VERSION: string
|
SETTINGS_NEWEST_VERSION: string
|
||||||
SETTINGS_GETING: string
|
SETTINGS_GETING: string
|
||||||
SETTINGS_TIPS_HAS_NEW_VERSION: string
|
SETTINGS_TIPS_HAS_NEW_VERSION: string
|
||||||
|
SETTINGS_LOG_FILE_PATH: string
|
||||||
|
SETTINGS_CONFIG_FILE_PATH: string
|
||||||
SETTINGS_LOG_FILE: string
|
SETTINGS_LOG_FILE: string
|
||||||
SETTINGS_GUI_LOG_FILE: string
|
SETTINGS_GUI_LOG_FILE: string
|
||||||
SETTINGS_MANAGE_LOG_FILE: string
|
SETTINGS_MANAGE_LOG_FILE: string
|
||||||
|
Loading…
Reference in New Issue
Block a user