Feature(custom): support force refresh gallery page

This commit is contained in:
Kuingsmile
2024-03-07 22:23:25 +08:00
parent 3e17647a7a
commit cafb4d590a
6 changed files with 36 additions and 2 deletions

View File

@@ -335,6 +335,11 @@ export default {
settingWindow.hide()
})
ipcMain.on('refreshSettingWindow', () => {
const settingWindow = windowManager.get(IWindowList.SETTING_WINDOW)!
settingWindow.webContents.reloadIgnoringCache()
})
// from mini window
ipcMain.on('syncPicBed', () => {
if (windowManager.has(IWindowList.SETTING_WINDOW)) {

View File

@@ -22,7 +22,28 @@
:active-text="$T('SETTINGS_OPEN')"
:inactive-text="$T('SETTINGS_CLOSE')"
@change="handleDeleteCloudFile"
/></span>
/>
<el-button
type="text"
@click="refreshPage"
>
<el-tooltip
class="item"
effect="dark"
:content="$T('REFRESH')"
placement="bottom"
:persistent="false"
teleported
>
<el-icon
size="25"
style="cursor: pointer; margin-left: 10px;"
>
<Refresh />
</el-icon>
</el-tooltip>
</el-button>
</span>
</div>
<transition name="el-zoom-in-top">
<el-row v-show="handleBarActive">
@@ -447,7 +468,7 @@ import { PASTE_TEXT, GET_PICBEDS } from '#/events/constants'
import { CheckboxValueType, ElMessageBox, ElNotification, ElMessage } from 'element-plus'
// Element Plus 图标
import { InfoFilled, Close, CaretBottom, Document, Edit, Delete, CaretTop, Sort } from '@element-plus/icons-vue'
import { InfoFilled, Close, CaretBottom, Document, Edit, Delete, CaretTop, Sort, Refresh } from '@element-plus/icons-vue'
// Electron 相关
import {
@@ -653,6 +674,10 @@ function handleChooseImage (val: CheckboxValueType, index: number) {
}
}
function refreshPage () {
ipcRenderer.send('refreshSettingWindow')
}
function clearChoosedList () {
isShiftKeyPress.value = false
Object.keys(choosedList).forEach(key => {

View File

@@ -61,6 +61,7 @@ interface ILocales {
UPLOAD_VIEW_HINT: string
MANAGE_PAGE: string
GALLERY: string
REFRESH: string
MANUAL: string
OPEN_MANUAL_LINK: string
OPEN_MANUAL_LINK_HINT: string