diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index df36fcfb..00000000
Binary files a/public/favicon.ico and /dev/null differ
diff --git a/public/index.html b/public/index.html
deleted file mode 100644
index f2d56b5d..00000000
--- a/public/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
- PicList
-
-
-
-
-
-
-
diff --git a/public/linux.sh b/public/linux.sh
deleted file mode 100644
index 91dfa404..00000000
--- a/public/linux.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-if [ "$XDG_SESSION_TYPE" = "x11" ]; then
- # require xclip(see http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212)
- command -v xclip >/dev/null 2>&1 || { echo >&1 "no xclip"; exit 1; }
- # write image in clipboard to file (see http://unix.stackexchange.com/questions/145131/copy-image-from-clipboard-to-file)
- filePath=`xclip -selection clipboard -o 2>/dev/null | grep ^file:// | cut -c8-`
- if [ ! -n "$filePath" ] ;then
- if
- xclip -selection clipboard -target image/png -o >/dev/null 2>&1
- then
- xclip -selection clipboard -target image/png -o >$1 2>/dev/null
- echo $1
- else
- echo "no image"
- fi
- else
- echo $filePath
- fi
-elif [ "$XDG_SESSION_TYPE" = "wayland" ]; then
- command -v wl-copy >/dev/null 2>&1 || { echo >&1 "no wl-clipboard"; exit 1; }
- filePath=`wl-copy -o 2>/dev/null | grep ^file:// | cut -c8-`
- if [ ! -n "$filePath" ] ;then
- if
- wl-copy -t image/png -o >/dev/null 2>&1
- then
- wl-copy -t image/png image/png -o >$1 2>/dev/null
- echo $1
- else
- echo "no image"
- fi
- else
- echo $filePath
- fi
-fi
diff --git a/public/mac.applescript b/public/mac.applescript
deleted file mode 100644
index f1ee277e..00000000
Binary files a/public/mac.applescript and /dev/null differ
diff --git a/public/menubar 256.png b/public/menubar 256.png
deleted file mode 100644
index 835e3307..00000000
Binary files a/public/menubar 256.png and /dev/null differ
diff --git a/public/menubar-newdarwin.png b/public/menubar-newdarwin.png
deleted file mode 100644
index 32fdd968..00000000
Binary files a/public/menubar-newdarwin.png and /dev/null differ
diff --git a/public/menubar-newdarwin@2.png b/public/menubar-newdarwin@2.png
deleted file mode 100644
index d2601461..00000000
Binary files a/public/menubar-newdarwin@2.png and /dev/null differ
diff --git a/public/menubar-newdarwin@3.png b/public/menubar-newdarwin@3.png
deleted file mode 100644
index 189a3328..00000000
Binary files a/public/menubar-newdarwin@3.png and /dev/null differ
diff --git a/public/menubar-newdarwinTemplate.png b/public/menubar-newdarwinTemplate.png
deleted file mode 100644
index 96efb2ff..00000000
Binary files a/public/menubar-newdarwinTemplate.png and /dev/null differ
diff --git a/public/menubar-newdarwinTemplate@2x.png b/public/menubar-newdarwinTemplate@2x.png
deleted file mode 100644
index 33d8d249..00000000
Binary files a/public/menubar-newdarwinTemplate@2x.png and /dev/null differ
diff --git a/public/menubar-newdarwinTemplate@3x.png b/public/menubar-newdarwinTemplate@3x.png
deleted file mode 100644
index 10664750..00000000
Binary files a/public/menubar-newdarwinTemplate@3x.png and /dev/null differ
diff --git a/public/menubar-newdarwinTemplate@4x.png b/public/menubar-newdarwinTemplate@4x.png
deleted file mode 100644
index 63e1dd72..00000000
Binary files a/public/menubar-newdarwinTemplate@4x.png and /dev/null differ
diff --git a/public/menubar-newdarwinTemplate@512w.png b/public/menubar-newdarwinTemplate@512w.png
deleted file mode 100644
index ed21c136..00000000
Binary files a/public/menubar-newdarwinTemplate@512w.png and /dev/null differ
diff --git a/public/menubar-nodarwin.png b/public/menubar-nodarwin.png
deleted file mode 100644
index d6ff7404..00000000
Binary files a/public/menubar-nodarwin.png and /dev/null differ
diff --git a/public/menubar-nodarwin@2x.png b/public/menubar-nodarwin@2x.png
deleted file mode 100644
index d6ff7404..00000000
Binary files a/public/menubar-nodarwin@2x.png and /dev/null differ
diff --git a/public/menubar-nodarwin@3x.png b/public/menubar-nodarwin@3x.png
deleted file mode 100644
index c0e2e97d..00000000
Binary files a/public/menubar-nodarwin@3x.png and /dev/null differ
diff --git a/public/menubar.png b/public/menubar.png
deleted file mode 100644
index 4646df9b..00000000
Binary files a/public/menubar.png and /dev/null differ
diff --git a/public/menubar@2x.png b/public/menubar@2x.png
deleted file mode 100644
index 8606c04a..00000000
Binary files a/public/menubar@2x.png and /dev/null differ
diff --git a/public/menubar@3x.png b/public/menubar@3x.png
deleted file mode 100644
index ebf1ac0c..00000000
Binary files a/public/menubar@3x.png and /dev/null differ
diff --git a/public/upload-dark.png b/public/upload-dark.png
deleted file mode 100644
index 1476c970..00000000
Binary files a/public/upload-dark.png and /dev/null differ
diff --git a/public/upload-dark@2x.png b/public/upload-dark@2x.png
deleted file mode 100644
index fbf6be5a..00000000
Binary files a/public/upload-dark@2x.png and /dev/null differ
diff --git a/public/upload-dark@3x.png b/public/upload-dark@3x.png
deleted file mode 100644
index 9f92bf8e..00000000
Binary files a/public/upload-dark@3x.png and /dev/null differ
diff --git a/public/upload.png b/public/upload.png
deleted file mode 100644
index aa45305a..00000000
Binary files a/public/upload.png and /dev/null differ
diff --git a/public/upload@2x.png b/public/upload@2x.png
deleted file mode 100644
index 228705d2..00000000
Binary files a/public/upload@2x.png and /dev/null differ
diff --git a/public/upload@3x.png b/public/upload@3x.png
deleted file mode 100644
index 51dfaf94..00000000
Binary files a/public/upload@3x.png and /dev/null differ
diff --git a/public/windows.ps1 b/public/windows.ps1
deleted file mode 100644
index 480b58fd..00000000
--- a/public/windows.ps1
+++ /dev/null
@@ -1,26 +0,0 @@
-
-param($imagePath)
-
-# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1
-
-Add-Type -Assembly PresentationCore
-$img = [Windows.Clipboard]::GetImage()
-
-if ($img -eq $null) {
- "no image"
- Exit 1
-}
-
-if (-not $imagePath) {
- "no image"
- Exit 1
-}
-
-$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0)
-$stream = [IO.File]::Open($imagePath, "OpenOrCreate")
-$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder
-$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null
-$encoder.Save($stream) | out-null
-$stream.Dispose() | out-null
-
-$imagePath
diff --git a/public/windows10.ps1 b/public/windows10.ps1
deleted file mode 100644
index c347d2f1..00000000
--- a/public/windows10.ps1
+++ /dev/null
@@ -1,45 +0,0 @@
-# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1
-param($imagePath)
-
-# https://github.com/PowerShell/PowerShell/issues/7233
-# fix the output encoding bug
-[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
-
-Add-Type -Assembly PresentationCore
-function main {
- $img = [Windows.Clipboard]::GetImage()
-
- if ($img -eq $null) {
- "no image"
- Exit 1
- }
-
- if (-not $imagePath) {
- "no image"
- Exit 1
- }
-
- $fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0)
- $stream = [IO.File]::Open($imagePath, "OpenOrCreate")
- $encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder
- $encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null
- $encoder.Save($stream) | out-null
- $stream.Dispose() | out-null
-
- $imagePath
- Exit 1
-}
-
-try {
- # For WIN10
- $file = Get-Clipboard -Format FileDropList
- if ($file -ne $null) {
- Convert-Path $file
- Exit 1
- }
-} catch {
- # For WIN7 WIN8 WIN10
- main
-}
-
-main
\ No newline at end of file
diff --git a/public/wsl.sh b/public/wsl.sh
deleted file mode 100644
index 7adb05de..00000000
--- a/public/wsl.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-# grab the paths
-scriptPath=$(echo $0 | awk '{ print substr( $0, 1, length($0)-6 ) }')"windows10.ps1"
-imagePath=$(echo $1 | awk '{ print substr( $0, 1, length($0)-18 ) }')
-imageName=$(echo $1 | awk '{ print substr( $0, length($0)-17, length($0) ) }')
-
-# run the powershell script
-res=$(powershell.exe -noprofile -noninteractive -nologo -sta -executionpolicy unrestricted -file $(wslpath -w $scriptPath) $(wslpath -w $imagePath)"\\"$imageName)
-
-# note that there is a return symbol in powershell result
-noImage=$(echo "no image\r")
-
-# check whether image exists
-if [ "$res" = "$noImage" ] ;then
- echo "no image"
-else
- echo $(wslpath -u $res)
-fi
diff --git a/resources/favicon.ico b/resources/favicon.ico
deleted file mode 100644
index df36fcfb..00000000
Binary files a/resources/favicon.ico and /dev/null differ
diff --git a/src/main/events/rpc/routes/system/app.ts b/src/main/events/rpc/routes/system/app.ts
index 5e30661e..6fc6c7b4 100644
--- a/src/main/events/rpc/routes/system/app.ts
+++ b/src/main/events/rpc/routes/system/app.ts
@@ -1,17 +1,11 @@
import picgo from '@core/picgo'
-import { app, IpcMainEvent, shell } from 'electron'
+import { app, shell } from 'electron'
import { IRPCActionType } from '#/types/enum'
import { IIPCEvent } from '#/types/rpc'
import { i18nManager } from '~/i18n'
export default [
- {
- action: IRPCActionType.GET_PLATFORM,
- handler: async (event: IIPCEvent) => {
- (event as IpcMainEvent).returnValue = process.platform
- }
- },
{
action: IRPCActionType.RELOAD_APP,
handler: async () => {
diff --git a/src/main/utils/beforeOpen.ts b/src/main/utils/beforeOpen.ts
index 27e18899..6a506ba6 100644
--- a/src/main/utils/beforeOpen.ts
+++ b/src/main/utils/beforeOpen.ts
@@ -4,8 +4,8 @@ import path from 'node:path'
import { dbPathChecker } from '@core/datastore/dbChecker'
import fs from 'fs-extra'
import yaml from 'js-yaml'
-import { ILocales } from 'root/src/universal/types/i18n'
+import { ILocales } from '#/types/i18n'
import { i18nManager } from '~/i18n'
const configPath = dbPathChecker()
diff --git a/src/preload/index.ts b/src/preload/index.ts
index ee534350..a78bb9e3 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -49,6 +49,7 @@ try {
clipboard: {
writeText: clipboard.writeText
},
+ platform: process.platform,
sendRpcSync,
triggerRPC,
sendToMain,
diff --git a/src/renderer/manage/pages/ManageMain.vue b/src/renderer/manage/pages/ManageMain.vue
index 1df8996b..e79ddfcb 100644
--- a/src/renderer/manage/pages/ManageMain.vue
+++ b/src/renderer/manage/pages/ManageMain.vue
@@ -438,7 +438,7 @@ async function getBucketList () {
function transPathToUnix (filePath: string | undefined) {
if (!filePath) return ''
- return window.electron.sendRpcSync(IRPCActionType.GET_PLATFORM) === 'win32'
+ return window.electron.platform === 'win32'
? filePath
.split(window.node.path.sep)
.join(window.node.path.posix.sep)
diff --git a/src/renderer/pages/PicGoSetting.vue b/src/renderer/pages/PicGoSetting.vue
index 338fd956..88c67220 100644
--- a/src/renderer/pages/PicGoSetting.vue
+++ b/src/renderer/pages/PicGoSetting.vue
@@ -1417,12 +1417,12 @@ const languageList = [
}
]
-const startModeList = Object.values(ISartMode).map(item => ({
+const startModeList = computed(() => Object.values(ISartMode).map(item => ({
label: t(`SETTINGS_START_MODE_${item.toUpperCase().replace(/-/g, '_')}` as any),
value: item
-}))
+})))
-const manualPageOpenList = [
+const manualPageOpenList = computed(() => [
{
label: t('MANUAL_PAGE_OPEN_BY_BUILD_IN'),
value: 'window'
@@ -1431,7 +1431,7 @@ const manualPageOpenList = [
label: t('MANUAL_PAGE_OPEN_BY_BROWSER'),
value: 'browser'
}
-]
+])
const showPicBedList = computed(
() =>
@@ -1676,12 +1676,12 @@ async function initData () {
formOfSetting.value.logLevel = initArray(settings.logLevel || [], ['all'])
formOfSetting.value.autoImportPicBed = initArray(settings.autoImportPicBed || [], [])
currentLanguage.value = valueToOptionItem(settings.language || 'zh-CN', languageList)
- currentStartMode.value = valueToOptionItem(settings.startMode || ISartMode.QUIET, startModeList)
+ currentStartMode.value = valueToOptionItem(settings.startMode || ISartMode.QUIET, startModeList.value)
if (osGlobal.value === 'darwin' && currentStartMode.value.value === ISartMode.MINI) {
- currentStartMode.value = valueToOptionItem(ISartMode.QUIET, startModeList)
+ currentStartMode.value = valueToOptionItem(ISartMode.QUIET, startModeList.value)
saveConfig(configPaths.settings.startMode, ISartMode.QUIET)
}
- currentManualPageOpen.value = valueToOptionItem(settings.manualPageOpen || 'window', manualPageOpenList)
+ currentManualPageOpen.value = valueToOptionItem(settings.manualPageOpen || 'window', manualPageOpenList.value)
currentShortUrlServer.value = valueToOptionItem(settings.shortUrlServer || 'c1n', shortUrlServerList)
customLink.value = settings.customLink || ''
proxy.value = picBed.proxy || ''
@@ -2040,7 +2040,7 @@ function handleStartModeChange (val: ISartModeValues) {
if (val === ISartMode.NO_TRAY) {
if (formOfSetting.value.isHideDock) {
ElMessage.warning(t('SETTINGS_ISHIDEDOCK_TIPS'))
- currentStartMode.value = valueToOptionItem(ISartMode.QUIET, startModeList)
+ currentStartMode.value = valueToOptionItem(ISartMode.QUIET, startModeList.value)
return
}
$message.info(t('TIPS_NEED_RELOAD'))
diff --git a/src/renderer/utils/global.ts b/src/renderer/utils/global.ts
index 70a42077..5d47ec5e 100644
--- a/src/renderer/utils/global.ts
+++ b/src/renderer/utils/global.ts
@@ -3,8 +3,8 @@ import { ref } from 'vue'
import { IRPCActionType } from '#/types/enum'
import { IPicBedType } from '#/types/types'
-console.log('global.ts loaded', window.node.crypto.randomBytes(16).toString('hex'))
-const osGlobal = ref(window.electron.sendRpcSync(IRPCActionType.GET_PLATFORM))
+console.log('global.ts loaded', window.electron.platform)
+const osGlobal = ref(window.electron.platform)
const picBedGlobal = ref([])
const pageReloadCount = ref(0)
diff --git a/src/renderer/utils/key-binding.ts b/src/renderer/utils/key-binding.ts
index d3fe95f9..57ea4c3f 100644
--- a/src/renderer/utils/key-binding.ts
+++ b/src/renderer/utils/key-binding.ts
@@ -1,5 +1,3 @@
-import { IRPCActionType } from '#/types/enum'
-
const isSpecialKey = (key: string) => {
const keyArr = ['Shift', 'Control', 'Alt', 'Meta']
@@ -7,7 +5,7 @@ const isSpecialKey = (key: string) => {
}
const keyBinding = (event: KeyboardEvent) => {
- const meta = window.electron.sendRpcSync(IRPCActionType.GET_PLATFORM) === 'darwin' ? 'Cmd' : 'Super'
+ const meta = window.electron.platform === 'darwin' ? 'Cmd' : 'Super'
const specialKey = {
Ctrl: event.ctrlKey,
Shift: event.shiftKey,
diff --git a/src/universal/types/enum.ts b/src/universal/types/enum.ts
index 82d79e55..e9a1546d 100644
--- a/src/universal/types/enum.ts
+++ b/src/universal/types/enum.ts
@@ -95,7 +95,6 @@ export enum IRPCActionType {
MAIN_WINDOW_ON_TOP = 'MAIN_WINDOW_ON_TOP',
UPDATE_MINI_WINDOW_ICON = 'UPDATE_MINI_WINDOW_ICON',
REFRESH_SETTING_WINDOW = 'REFRESH_SETTING_WINDOW',
- GET_PLATFORM = 'GET_PLATFORM',
// picbed RPC
PICBED_GET_PICBED_CONFIG = 'PICBED_GET_PICBED_CONFIG',
PICBED_GET_CONFIG_LIST = 'PICBED_GET_CONFIG_LIST',
diff --git a/src/universal/types/shims-tsx.d.ts b/src/universal/types/shims-tsx.d.ts
index 4b6b97ec..9c146791 100644
--- a/src/universal/types/shims-tsx.d.ts
+++ b/src/universal/types/shims-tsx.d.ts
@@ -22,6 +22,7 @@ declare global {
}
export interface Window {
electron: {
+ platform: string
setVisualZoomLevelLimits: (min: number, max: number) => void
sendRpcSync: (action: IRPCActionType, ...args: any[]) => any
triggerRPC: (action: IRPCActionType, ...args: any[]) => Promise