diff --git a/src/main/events/rpc/routes/gallery/index.ts b/src/main/events/rpc/routes/gallery/index.ts index 5972cad9..1b3fb319 100644 --- a/src/main/events/rpc/routes/gallery/index.ts +++ b/src/main/events/rpc/routes/gallery/index.ts @@ -39,11 +39,16 @@ const galleryRoutes = [ action: IRPCActionType.GALLERY_REMOVE_FILES, handler: async (_: IIPCEvent, args: [files: ImgInfo[]]) => { setTimeout(() => { - runScriptInStage('onGalleryRemove', picgo, { galleryItem: args[0] }) picgo.emit(ICOREBuildInEvent.REMOVE, args[0], GuiApi.getInstance()) }, 500) }, }, + { + action: IRPCActionType.GALLERY_REMOVE_RUN_SCRIPTS, + handler: async (_: IIPCEvent, args: [file: ImgInfo]) => { + await runScriptInStage('onGalleryRemove', picgo, { galleryItem: args[0] }) + }, + }, { action: IRPCActionType.GALLERY_GET_DB, handler: async (_: IIPCEvent, args: [filter: IFilter]) => { diff --git a/src/main/utils/enum.ts b/src/main/utils/enum.ts index 05d84d7c..eaad76e7 100644 --- a/src/main/utils/enum.ts +++ b/src/main/utils/enum.ts @@ -191,6 +191,8 @@ export const IRPCActionType = { GALLERY_REMOVE_BY_ID_DB: 'GALLERY_REMOVE_BY_ID_DB', GALLERY_INSERT_DB: 'GALLERY_INSERT_DB', GALLERY_INSERT_DB_BATCH: 'GALLERY_INSERT_DB_BATCH', + GALLERY_REMOVE_RUN_SCRIPTS: 'GALLERY_REMOVE_RUN_SCRIPTS', + // plugin rpc PLUGIN_GET_LIST: 'PLUGIN_GET_LIST', PLUGIN_INSTALL: 'PLUGIN_INSTALL', diff --git a/src/renderer/components/PerPicbedSetting.vue b/src/renderer/components/PerPicbedSetting.vue index 7c8d0a6c..380bb7e3 100644 --- a/src/renderer/components/PerPicbedSetting.vue +++ b/src/renderer/components/PerPicbedSetting.vue @@ -220,7 +220,6 @@ function handleMapChange(picbedType: string, value: any, id?: string) { for (const sibling of element?.parentElement?.parentElement?.children || []) { const input = sibling.querySelector('input') as HTMLInputElement | null if (input && input !== element) { - console.log('uncheck', input) input.checked = false } } diff --git a/src/renderer/manage/pages/BucketPage.vue b/src/renderer/manage/pages/BucketPage.vue index 59d4aa79..fc509c4f 100644 --- a/src/renderer/manage/pages/BucketPage.vue +++ b/src/renderer/manage/pages/BucketPage.vue @@ -1935,7 +1935,6 @@ async function initCustomDomainList() { label: defaultUrl, value: defaultUrl, }) - console.log('customDomainList', customDomainList.value) currentCustomDomain.value = customDomainList.value[0].value } else { customDomainList.value.length = 0 @@ -2426,7 +2425,6 @@ const matchedFilesNumber = computed(() => { } } }) - console.log('matchedFiles', matchedFiles) return matchedFiles }) @@ -2589,7 +2587,6 @@ async function copyLink(item: any, type: string) { } function handlecopyDropdownOpen() { - console.log('copyDropdownOpen', copyDropdownOpen.value) copyDropdownOpen.value = !copyDropdownOpen.value } diff --git a/src/renderer/pages/Gallery.vue b/src/renderer/pages/Gallery.vue index 5c0d4fc1..b18b49f6 100644 --- a/src/renderer/pages/Gallery.vue +++ b/src/renderer/pages/Gallery.vue @@ -849,6 +849,7 @@ function remove(item: ImgInfo, _: number) { } } await $$db.removeById(item.id!) + window.electron.sendRPC(IRPCActionType.GALLERY_REMOVE_RUN_SCRIPTS, getRawData(item)) const args = getRawData(file) window.electron.sendRPC(IRPCActionType.GALLERY_REMOVE_FILES, [args]) await updateGallery() @@ -949,6 +950,7 @@ function multiRemove() { files.push(file) await $$db.removeById(key) } + window.electron.sendRPC(IRPCActionType.GALLERY_REMOVE_RUN_SCRIPTS, getRawData(file)) } } } @@ -960,6 +962,7 @@ function multiRemove() { if (file) { files.push(file) await $$db.removeById(key) + window.electron.sendRPC(IRPCActionType.GALLERY_REMOVE_RUN_SCRIPTS, getRawData(file)) } } } diff --git a/src/renderer/pages/PicBed.vue b/src/renderer/pages/PicBed.vue index 29af938b..546b758a 100644 --- a/src/renderer/pages/PicBed.vue +++ b/src/renderer/pages/PicBed.vue @@ -179,7 +179,6 @@ const handleConfirm = async () => { async function getPicBeds() { try { const result = await window.electron.triggerRPC(IRPCActionType.PICBED_GET_PICBED_CONFIG, $route.params.type) - console.log('PicBed config result:', result) config.value = result.config picBedName.value = result.name } catch (error) { diff --git a/src/renderer/pages/PicGoSetting.vue b/src/renderer/pages/PicGoSetting.vue index 86d85367..ca673025 100644 --- a/src/renderer/pages/PicGoSetting.vue +++ b/src/renderer/pages/PicGoSetting.vue @@ -1605,7 +1605,6 @@ const addWatch = () => { watch( () => formOfSetting.value.mainWindowWidth, newVal => { - console.log('Main window width changed:', newVal) const width = enforceNumber(newVal) saveConfig({ [configPaths.settings.mainWindowWidth]: rawPicGoSize.value ? 800 : Math.max(width, 100) }) }, @@ -1614,7 +1613,6 @@ const addWatch = () => { watch( () => formOfSetting.value.mainWindowHeight, newVal => { - console.log('Main window height changed:', newVal) const height = enforceNumber(newVal) saveConfig({ [configPaths.settings.mainWindowHeight]: rawPicGoSize.value ? 450 : Math.max(height, 100) }) }, diff --git a/src/renderer/pages/ScriptPage.vue b/src/renderer/pages/ScriptPage.vue index f604f93a..2104afde 100644 --- a/src/renderer/pages/ScriptPage.vue +++ b/src/renderer/pages/ScriptPage.vue @@ -278,7 +278,6 @@ async function refreshList() { const fileStats = (await window.electron.triggerRPC(IRPCActionType.GET_FILES_STAT, getRawData(result), 'scripts')) || [] const disabledList = ((await getConfig(configPaths.scripts.disabledList)) as string[] | undefined) || [] - console.log('disabledList', disabledList) fileStats.forEach(file => { const fullPath = file.filePath.join('/') file.enabled = !disabledList.includes(fullPath) diff --git a/src/renderer/utils/enum.ts b/src/renderer/utils/enum.ts index 6c085661..86c7e45c 100644 --- a/src/renderer/utils/enum.ts +++ b/src/renderer/utils/enum.ts @@ -134,6 +134,8 @@ export const IRPCActionType = { GALLERY_REMOVE_BY_ID_DB: 'GALLERY_REMOVE_BY_ID_DB', GALLERY_INSERT_DB: 'GALLERY_INSERT_DB', GALLERY_INSERT_DB_BATCH: 'GALLERY_INSERT_DB_BATCH', + GALLERY_REMOVE_RUN_SCRIPTS: 'GALLERY_REMOVE_RUN_SCRIPTS', + // plugin rpc PLUGIN_GET_LIST: 'PLUGIN_GET_LIST', PLUGIN_INSTALL: 'PLUGIN_INSTALL', diff --git a/src/renderer/utils/static.ts b/src/renderer/utils/static.ts index 8f823ef6..494e1275 100644 --- a/src/renderer/utils/static.ts +++ b/src/renderer/utils/static.ts @@ -71,7 +71,6 @@ export const picBedManualUrlList: IStringKeyMap = { export const defaultScriptTemplate = ` // ctx 为 核心PicList实例, extra为额外参数, 其中extra.galleryItem为当前删除的相册对象 // 可用额外API: axios, crypto, fs, path, os, setTimeout, setInterval, clearTimeout, clearInterval, base64Decode, base64Encode -// 图床上传脚本必须返回 ctx 对象, 其它脚本可根据需求返回任意数据 async function main(ctx, extra) { // 在这里编写你的脚本代码 @@ -82,7 +81,6 @@ async function main(ctx, extra) { export const defaultScriptTemplateEn = ` // ctx is the core PicList instance, extra is additional parameters, among which extra.galleryItem is the currently deleted album object // Available additional APIs: axios, crypto, fs, path, os, setTimeout, setInterval, clearTimeout, clearInterval, base64Decode, base64Encode -// The image bed upload script must return the ctx object, other scripts can return any data as needed async function main(ctx, extra) { // Write your script code here