mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-06 20:42:57 +08:00
🔨 Refactor(custom): change type defination in universal to global
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": [
|
"extends": ["config:recommended"]
|
||||||
"config:recommended"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { app, clipboard, dialog, shell } from 'electron'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { gte, lte } from 'semver'
|
import { gte, lte } from 'semver'
|
||||||
|
|
||||||
import type { IRemoteNotice, IRemoteNoticeAction, IRemoteNoticeLocalCountStorage } from '#/types/types'
|
|
||||||
import { showNotification } from '~/utils/common'
|
import { showNotification } from '~/utils/common'
|
||||||
import { IRemoteNoticeActionType, IRemoteNoticeTriggerCount } from '~/utils/enum'
|
import { IRemoteNoticeActionType, IRemoteNoticeTriggerCount } from '~/utils/enum'
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,6 @@ import shortKeyService from 'apis/app/shortKey/shortKeyService'
|
|||||||
import GuiApi from 'apis/gui'
|
import GuiApi from 'apis/gui'
|
||||||
import { globalShortcut } from 'electron'
|
import { globalShortcut } from 'electron'
|
||||||
|
|
||||||
import type {
|
|
||||||
IKeyCommandType,
|
|
||||||
IPluginShortKeyConfig,
|
|
||||||
IShortKeyConfig,
|
|
||||||
IShortKeyConfigs,
|
|
||||||
IShortKeyHandler,
|
|
||||||
} from '#/types/types'
|
|
||||||
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '~/events/constant'
|
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '~/events/constant'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import logger from '@core/picgo/logger'
|
import logger from '@core/picgo/logger'
|
||||||
|
|
||||||
import type { IShortKeyHandler } from '#/types/types'
|
|
||||||
|
|
||||||
class ShortKeyService {
|
class ShortKeyService {
|
||||||
private commandList = new Map<string, IShortKeyHandler>()
|
private commandList = new Map<string, IShortKeyHandler>()
|
||||||
registerCommand(command: string, handler: IShortKeyHandler) {
|
registerCommand(command: string, handler: IShortKeyHandler) {
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import fs from 'fs-extra'
|
|||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import pkg from 'root/package.json'
|
import pkg from 'root/package.json'
|
||||||
|
|
||||||
import type { IBounds, ImgInfo } from '#/types/types'
|
|
||||||
import { buildPicBedListMenu } from '~/events/remotes/menu'
|
import { buildPicBedListMenu } from '~/events/remotes/menu'
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import clipboardPoll from '~/utils/clipboardPoll'
|
import clipboardPoll from '~/utils/clipboardPoll'
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import fs from 'fs-extra'
|
|||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import type { IPicGo } from 'piclist'
|
import type { IPicGo } from 'piclist'
|
||||||
|
|
||||||
import type { IFileWithPath, ImgInfo, IStringKeyMap, IUploadOption } from '#/types/types'
|
|
||||||
import { T as $t } from '~/i18n/index'
|
import { T as $t } from '~/i18n/index'
|
||||||
import { handleCopyUrl, handleUrlEncodeWithSetting } from '~/utils/common'
|
import { handleCopyUrl, handleUrlEncodeWithSetting } from '~/utils/common'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import fs from 'fs-extra'
|
|||||||
import type { IPicGo } from 'piclist'
|
import type { IPicGo } from 'piclist'
|
||||||
import writeFile from 'write-file-atomic'
|
import writeFile from 'write-file-atomic'
|
||||||
|
|
||||||
import type { ImgInfo, IUploadOption } from '#/types/types'
|
|
||||||
import { GET_RENAME_FILE_NAME, RENAME_FILE_NAME } from '~/events/constant'
|
import { GET_RENAME_FILE_NAME, RENAME_FILE_NAME } from '~/events/constant'
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import { getClipboardFilePath, showNotification } from '~/utils/common'
|
import { getClipboardFilePath, showNotification } from '~/utils/common'
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import { CREATE_APP_MENU } from '@core/bus/constants'
|
|||||||
import db from '@core/datastore'
|
import db from '@core/datastore'
|
||||||
import { app, BrowserWindow, Rectangle } from 'electron'
|
import { app, BrowserWindow, Rectangle } from 'electron'
|
||||||
|
|
||||||
import type { IWindowListItem } from '#/types/electron'
|
|
||||||
import type { IBrowserWindowOptions } from '#/types/types'
|
|
||||||
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '~/events/constant'
|
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '~/events/constant'
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import windowList from 'apis/app/window/windowList'
|
import windowList from 'apis/app/window/windowList'
|
||||||
import { BrowserWindow } from 'electron'
|
import { BrowserWindow } from 'electron'
|
||||||
|
|
||||||
import type { IWindowListItem, IWindowManager } from '#/types/electron'
|
|
||||||
import { IWindowList } from '~/utils/enum'
|
import { IWindowList } from '~/utils/enum'
|
||||||
|
|
||||||
class WindowManager implements IWindowManager {
|
class WindowManager implements IWindowManager {
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import {
|
|||||||
} from '@core/bus/constants'
|
} from '@core/bus/constants'
|
||||||
import bus from '@core/bus/index'
|
import bus from '@core/bus/index'
|
||||||
|
|
||||||
import type { IFileWithPath } from '#/types/types'
|
|
||||||
|
|
||||||
export const uploadWithClipboardFiles = (): Promise<{
|
export const uploadWithClipboardFiles = (): Promise<{
|
||||||
success: boolean
|
success: boolean
|
||||||
result?: string[]
|
result?: string[]
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import { debounce } from 'lodash-es'
|
|||||||
import { PicGo } from 'piclist'
|
import { PicGo } from 'piclist'
|
||||||
import pkg from 'root/package.json'
|
import pkg from 'root/package.json'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
const CONFIG_PATH = dbPathChecker()
|
const CONFIG_PATH = dbPathChecker()
|
||||||
|
|
||||||
dbChecker()
|
dbChecker()
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import util from 'node:util'
|
|||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { ILogArgvTypeWithError } from '#/types/types'
|
|
||||||
|
|
||||||
const MB = 1024 * 1024
|
const MB = 1024 * 1024
|
||||||
const DEFAULT_LOG_FILE_SIZE_LIMIT = 10 * MB
|
const DEFAULT_LOG_FILE_SIZE_LIMIT = 10 * MB
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import OSS from 'ali-oss'
|
import OSS from 'ali-oss'
|
||||||
|
|
||||||
import type { IAliYunConfig, PartialKeys } from '#/types/types'
|
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
|
|
||||||
interface IConfigMap {
|
interface IConfigMap {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import AlistApi from '~/apis/delete/alist'
|
import AlistApi from '~/apis/delete/alist'
|
||||||
import AlistplistApi from '~/apis/delete/alistplist'
|
import AlistplistApi from '~/apis/delete/alistplist'
|
||||||
import AliyunApi from '~/apis/delete/aliyun'
|
import AliyunApi from '~/apis/delete/aliyun'
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import { getRawData } from '~/utils/common'
|
import { getRawData } from '~/utils/common'
|
||||||
import { removeFileFromS3InMain } from '~/utils/deleteFunc'
|
import { removeFileFromS3InMain } from '~/utils/deleteFunc'
|
||||||
import { deleteFailedLog } from '~/utils/deleteLog'
|
import { deleteFailedLog } from '~/utils/deleteLog'
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import { getRawData } from '~/utils/common'
|
import { getRawData } from '~/utils/common'
|
||||||
import { removeFileFromDogeInMain } from '~/utils/deleteFunc'
|
import { removeFileFromDogeInMain } from '~/utils/deleteFunc'
|
||||||
import { deleteFailedLog } from '~/utils/deleteLog'
|
import { deleteFailedLog } from '~/utils/deleteLog'
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Octokit } from '@octokit/rest'
|
import { Octokit } from '@octokit/rest'
|
||||||
|
|
||||||
import type { IGitHubConfig, PartialKeys } from '#/types/types'
|
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
|
|
||||||
interface IConfigMap {
|
interface IConfigMap {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import { getRawData } from '~/utils/common'
|
import { getRawData } from '~/utils/common'
|
||||||
import { removeFileFromHuaweiInMain } from '~/utils/deleteFunc'
|
import { removeFileFromHuaweiInMain } from '~/utils/deleteFunc'
|
||||||
import { deleteFailedLog } from '~/utils/deleteLog'
|
import { deleteFailedLog } from '~/utils/deleteLog'
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import axios, { AxiosResponse } from 'axios'
|
import axios, { AxiosResponse } from 'axios'
|
||||||
|
|
||||||
import type { IImgurConfig } from '#/types/types'
|
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
|
|
||||||
interface IConfigMap {
|
interface IConfigMap {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import https from 'node:https'
|
|||||||
|
|
||||||
import axios, { AxiosResponse } from 'axios'
|
import axios, { AxiosResponse } from 'axios'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
|
|
||||||
export default class LskyplistApi {
|
export default class LskyplistApi {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import axios, { AxiosResponse } from 'axios'
|
import axios, { AxiosResponse } from 'axios'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
|
|
||||||
export default class PiclistApi {
|
export default class PiclistApi {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import qiniu from 'qiniu'
|
import qiniu from 'qiniu'
|
||||||
|
|
||||||
import type { IQiniuConfig, PartialKeys } from '#/types/types'
|
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
interface IConfigMap {
|
interface IConfigMap {
|
||||||
fileName: string
|
fileName: string
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import { getRawData } from '~/utils/common'
|
import { getRawData } from '~/utils/common'
|
||||||
import { removeFileFromSFTPInMain } from '~/utils/deleteFunc'
|
import { removeFileFromSFTPInMain } from '~/utils/deleteFunc'
|
||||||
import { deleteFailedLog } from '~/utils/deleteLog'
|
import { deleteFailedLog } from '~/utils/deleteLog'
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import axios, { AxiosResponse } from 'axios'
|
import axios, { AxiosResponse } from 'axios'
|
||||||
|
|
||||||
import type { ISMMSConfig } from '#/types/types'
|
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
|
|
||||||
interface IConfigMap {
|
interface IConfigMap {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import COS from 'cos-nodejs-sdk-v5'
|
import COS from 'cos-nodejs-sdk-v5'
|
||||||
|
|
||||||
import type { ITcYunConfig, PartialKeys } from '#/types/types'
|
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
interface IConfigMap {
|
interface IConfigMap {
|
||||||
fileName: string
|
fileName: string
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import Upyun from 'upyun'
|
import Upyun from 'upyun'
|
||||||
|
|
||||||
import type { IUpYunConfig, PartialKeys } from '#/types/types'
|
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
|
|
||||||
interface IConfigMap {
|
interface IConfigMap {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { AuthType, createClient, WebDAVClientOptions } from 'webdav'
|
import { AuthType, createClient, WebDAVClientOptions } from 'webdav'
|
||||||
|
|
||||||
import type { IWebdavPlistConfig, PartialKeys } from '#/types/types'
|
|
||||||
import { formatEndpoint } from '~/utils/common'
|
import { formatEndpoint } from '~/utils/common'
|
||||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||||
|
|
||||||
|
|||||||
@@ -8,16 +8,6 @@ import { BrowserWindow, dialog, ipcMain, IpcMainEvent, MessageBoxOptions, Notifi
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
import type {
|
|
||||||
IGuiApi,
|
|
||||||
ImgInfo,
|
|
||||||
IShowFileExplorerOption,
|
|
||||||
IShowInputBoxOption,
|
|
||||||
IShowMessageBoxOption,
|
|
||||||
IShowMessageBoxResult,
|
|
||||||
IShowNotificationOption,
|
|
||||||
IUploadOption,
|
|
||||||
} from '#/types/types'
|
|
||||||
import { SHOW_INPUT_BOX } from '~/events/constant'
|
import { SHOW_INPUT_BOX } from '~/events/constant'
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import { handleCopyUrl } from '~/utils/common'
|
import { handleCopyUrl } from '~/utils/common'
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import { createMenu } from 'apis/app/system'
|
|||||||
import { uploadChoosedFiles, uploadClipboardFiles } from 'apis/app/uploader/apis'
|
import { uploadChoosedFiles, uploadClipboardFiles } from 'apis/app/uploader/apis'
|
||||||
import windowManager from 'apis/app/window/windowManager'
|
import windowManager from 'apis/app/window/windowManager'
|
||||||
|
|
||||||
import type { IFileWithPath } from '#/types/types'
|
|
||||||
import { IWindowList } from '~/utils/enum'
|
import { IWindowList } from '~/utils/enum'
|
||||||
|
|
||||||
function initEventCenter() {
|
function initEventCenter() {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { app, BrowserWindow, dialog, Menu, MenuItem, MenuItemConstructorOptions,
|
|||||||
import { PicGo as PicGoCore } from 'piclist'
|
import { PicGo as PicGoCore } from 'piclist'
|
||||||
import pkg from 'root/package.json'
|
import pkg from 'root/package.json'
|
||||||
|
|
||||||
import type { IPicGoPlugin, IUploaderConfig } from '#/types/types'
|
|
||||||
import {
|
import {
|
||||||
PICGO_CONFIG_PLUGIN,
|
PICGO_CONFIG_PLUGIN,
|
||||||
PICGO_HANDLE_PLUGIN_DONE,
|
PICGO_HANDLE_PLUGIN_DONE,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import logger from '@core/picgo/logger'
|
import logger from '@core/picgo/logger'
|
||||||
import { ipcMain, IpcMainEvent, IpcMainInvokeEvent } from 'electron'
|
import { ipcMain, IpcMainEvent, IpcMainInvokeEvent } from 'electron'
|
||||||
|
|
||||||
import type { IRPCRoutes, IRPCServer } from '#/types/rpc'
|
|
||||||
import { RPC_ACTIONS, RPC_ACTIONS_INVOKE } from '~/events/constant'
|
import { RPC_ACTIONS, RPC_ACTIONS_INVOKE } from '~/events/constant'
|
||||||
import { galleryRouter } from '~/events/rpc/routes/gallery'
|
import { galleryRouter } from '~/events/rpc/routes/gallery'
|
||||||
import { manageRouter } from '~/events/rpc/routes/manage'
|
import { manageRouter } from '~/events/rpc/routes/manage'
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import type { IRPCHandler, IRPCRouter, IRPCRoutes } from '#/types/rpc'
|
|
||||||
import { IRPCType } from '~/utils/enum'
|
import { IRPCType } from '~/utils/enum'
|
||||||
|
|
||||||
interface IBatchAddParams {
|
interface IBatchAddParams {
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import picgo from '@core/picgo'
|
|||||||
import GuiApi from 'apis/gui'
|
import GuiApi from 'apis/gui'
|
||||||
import { clipboard } from 'electron'
|
import { clipboard } from 'electron'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { ImgInfo } from '#/types/types'
|
|
||||||
import { RPCRouter } from '~/events/rpc/router'
|
import { RPCRouter } from '~/events/rpc/router'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
import { ICOREBuildInEvent, IPasteStyle, IRPCActionType, IRPCType } from '~/utils/enum'
|
import { ICOREBuildInEvent, IPasteStyle, IRPCActionType, IRPCType } from '~/utils/enum'
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import { ManageApi } from '~/manage/manageApi'
|
import { ManageApi } from '~/manage/manageApi'
|
||||||
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { IObj } from '#/types/types'
|
|
||||||
import getManageApi from '~/manage/Main'
|
import getManageApi from '~/manage/Main'
|
||||||
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import path from 'node:path'
|
|||||||
import { app, dialog, shell } from 'electron'
|
import { app, dialog, shell } from 'electron'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import { downloadFileFromUrl } from '~/manage/utils/common'
|
import { downloadFileFromUrl } from '~/manage/utils/common'
|
||||||
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import ALLApi from 'apis/delete/allApi'
|
import ALLApi from 'apis/delete/allApi'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { ImgInfo } from '#/types/types'
|
|
||||||
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import picgo from '@core/picgo'
|
import picgo from '@core/picgo'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import { RPCRouter } from '~/events/rpc/router'
|
import { RPCRouter } from '~/events/rpc/router'
|
||||||
import deleteRoutes from '~/events/rpc/routes/picbed/delete'
|
import deleteRoutes from '~/events/rpc/routes/picbed/delete'
|
||||||
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import { dialog, shell } from 'electron'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { IGuiMenuItem, PicGo as PicGoCore } from 'piclist'
|
import { IGuiMenuItem, PicGo as PicGoCore } from 'piclist'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { IDispose, IPicGoPlugin } from '#/types/types'
|
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import { handleStreamlinePluginName, showNotification, simpleClone } from '~/utils/common'
|
import { handleStreamlinePluginName, showNotification, simpleClone } from '~/utils/common'
|
||||||
import { ICOREBuildInEvent, IPicGoHelperType, IWindowList } from '~/utils/enum'
|
import { ICOREBuildInEvent, IPicGoHelperType, IWindowList } from '~/utils/enum'
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import picgo from '@core/picgo'
|
|||||||
import { IpcMainEvent, shell } from 'electron'
|
import { IpcMainEvent, shell } from 'electron'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { IObj } from '#/types/types'
|
|
||||||
import { isAutoStartEnabled, setAutoStart } from '~/utils/autoStart'
|
import { isAutoStartEnabled, setAutoStart } from '~/utils/autoStart'
|
||||||
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ import bus from '@core/bus'
|
|||||||
import shortKeyHandler from 'apis/app/shortKey/shortKeyHandler'
|
import shortKeyHandler from 'apis/app/shortKey/shortKeyHandler'
|
||||||
import { Notification } from 'electron'
|
import { Notification } from 'electron'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { IShortKeyConfig } from '#/types/types'
|
|
||||||
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '~/events/constant'
|
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '~/events/constant'
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import picgo from '@core/picgo'
|
import picgo from '@core/picgo'
|
||||||
import { app, shell } from 'electron'
|
import { app, shell } from 'electron'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import { i18nManager } from '~/i18n'
|
import { i18nManager } from '~/i18n'
|
||||||
import { IRPCActionType } from '~/utils/enum'
|
import { IRPCActionType } from '~/utils/enum'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import windowManager from 'apis/app/window/windowManager'
|
import windowManager from 'apis/app/window/windowManager'
|
||||||
import { app, BrowserWindow } from 'electron'
|
import { app, BrowserWindow } from 'electron'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { IMiniWindowPos, IPicGoPlugin } from '#/types/types'
|
|
||||||
import {
|
import {
|
||||||
buildMainPageMenu,
|
buildMainPageMenu,
|
||||||
buildMiniPageMenu,
|
buildMiniPageMenu,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import path from 'node:path'
|
|||||||
import { dbPathChecker, defaultConfigPath } from '@core/datastore/dbChecker'
|
import { dbPathChecker, defaultConfigPath } from '@core/datastore/dbChecker'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IToolboxCheckerMap, IToolboxFixMap } from '#/types/rpc'
|
|
||||||
import { sendToolboxResWithType } from '~/events/rpc/routes/toolbox/utils'
|
import { sendToolboxResWithType } from '~/events/rpc/routes/toolbox/utils'
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import { IToolboxItemCheckStatus, IToolboxItemType } from '~/utils/enum'
|
import { IToolboxItemCheckStatus, IToolboxItemType } from '~/utils/enum'
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { dbPathChecker } from '@core/datastore/dbChecker'
|
|||||||
import type { IpcMainEvent } from 'electron'
|
import type { IpcMainEvent } from 'electron'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IToolboxCheckerMap, IToolboxFixMap } from '#/types/rpc'
|
|
||||||
import { sendToolboxResWithType } from '~/events/rpc/routes/toolbox/utils'
|
import { sendToolboxResWithType } from '~/events/rpc/routes/toolbox/utils'
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import { IToolboxItemCheckStatus, IToolboxItemType } from '~/utils/enum'
|
import { IToolboxItemCheckStatus, IToolboxItemType } from '~/utils/enum'
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import fs from 'fs-extra'
|
|||||||
import { IConfig } from 'piclist'
|
import { IConfig } from 'piclist'
|
||||||
import tunnel from 'tunnel'
|
import tunnel from 'tunnel'
|
||||||
|
|
||||||
import type { IToolboxCheckerMap } from '#/types/rpc'
|
|
||||||
import { sendToolboxResWithType } from '~/events/rpc/routes/toolbox/utils'
|
import { sendToolboxResWithType } from '~/events/rpc/routes/toolbox/utils'
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import { IToolboxItemCheckStatus, IToolboxItemType } from '~/utils/enum'
|
import { IToolboxItemCheckStatus, IToolboxItemType } from '~/utils/enum'
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { IpcMainEvent } from 'electron'
|
import { IpcMainEvent } from 'electron'
|
||||||
|
|
||||||
import type { IToolboxCheckArgs, IToolboxCheckerMap, IToolboxFixMap } from '#/types/rpc'
|
|
||||||
import { RPCRouter } from '~/events/rpc/router'
|
import { RPCRouter } from '~/events/rpc/router'
|
||||||
import { checkClipboardUploadMap, fixClipboardUploadMap } from '~/events/rpc/routes/toolbox/checkClipboardUpload'
|
import { checkClipboardUploadMap, fixClipboardUploadMap } from '~/events/rpc/routes/toolbox/checkClipboardUpload'
|
||||||
import { checkFileMap, fixFileMap } from '~/events/rpc/routes/toolbox/checkFile'
|
import { checkFileMap, fixFileMap } from '~/events/rpc/routes/toolbox/checkFile'
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { IpcMainEvent } from 'electron'
|
import { IpcMainEvent } from 'electron'
|
||||||
|
|
||||||
import type { IToolboxCheckRes } from '#/types/rpc'
|
|
||||||
import { IRPCActionType } from '~/utils/enum'
|
import { IRPCActionType } from '~/utils/enum'
|
||||||
|
|
||||||
export function sendToolboxResWithType(type: string) {
|
export function sendToolboxResWithType(type: string) {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import uploader from 'apis/app/uploader'
|
|||||||
import windowManager from 'apis/app/window/windowManager'
|
import windowManager from 'apis/app/window/windowManager'
|
||||||
import { Notification } from 'electron'
|
import { Notification } from 'electron'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import { RPCRouter } from '~/events/rpc/router'
|
import { RPCRouter } from '~/events/rpc/router'
|
||||||
import { T as $t } from '~/i18n'
|
import { T as $t } from '~/i18n'
|
||||||
import { generateShortUrl, handleCopyUrl, setTrayToolTip } from '~/utils/common'
|
import { generateShortUrl, handleCopyUrl, setTrayToolTip } from '~/utils/common'
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { uploadChoosedFiles, uploadClipboardFiles } from 'apis/app/uploader/apis'
|
import { uploadChoosedFiles, uploadClipboardFiles } from 'apis/app/uploader/apis'
|
||||||
|
|
||||||
import type { IIPCEvent } from '#/types/rpc'
|
|
||||||
import type { IFileWithPath } from '#/types/types'
|
|
||||||
import { RPCRouter } from '~/events/rpc/router'
|
import { RPCRouter } from '~/events/rpc/router'
|
||||||
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
import { IRPCActionType, IRPCType } from '~/utils/enum'
|
||||||
import getPicBeds from '~/utils/getPicBeds'
|
import getPicBeds from '~/utils/getPicBeds'
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ import { I18n, ObjectAdapter } from '@piclist/i18n'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import yaml from 'js-yaml'
|
import yaml from 'js-yaml'
|
||||||
|
|
||||||
import type { ILocales, ILocalesKey } from '#/types/i18n'
|
|
||||||
import type { II18nItem, IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
const dirname = path.dirname(fileURLToPath(import.meta.url))
|
const dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
|
||||||
const builtinI18nList: II18nItem[] = [
|
const builtinI18nList: II18nItem[] = [
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import axios from 'axios'
|
|||||||
import { ipcMain, IpcMainEvent } from 'electron'
|
import { ipcMain, IpcMainEvent } from 'electron'
|
||||||
import * as fastxml from 'fast-xml-parser'
|
import * as fastxml from 'fast-xml-parser'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import {
|
import {
|
||||||
ConcurrencyPromisePool,
|
ConcurrencyPromisePool,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { ipcMain, IpcMainEvent } from 'electron'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import got from 'got'
|
import got from 'got'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import {
|
import {
|
||||||
ConcurrencyPromisePool,
|
ConcurrencyPromisePool,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import FormData from 'form-data'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import got from 'got'
|
import got from 'got'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import {
|
import {
|
||||||
ConcurrencyPromisePool,
|
ConcurrencyPromisePool,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import windowManager from 'apis/app/window/windowManager'
|
|||||||
import { ipcMain, IpcMainEvent } from 'electron'
|
import { ipcMain, IpcMainEvent } from 'electron'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import { formatError } from '~/manage/utils/common'
|
import { formatError } from '~/manage/utils/common'
|
||||||
import ManageLogger from '~/manage/utils/logger'
|
import ManageLogger from '~/manage/utils/logger'
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import axios from 'axios'
|
|||||||
import { ipcMain, IpcMainEvent } from 'electron'
|
import { ipcMain, IpcMainEvent } from 'electron'
|
||||||
import qiniu from 'qiniu'
|
import qiniu from 'qiniu'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import {
|
import {
|
||||||
ConcurrencyPromisePool,
|
ConcurrencyPromisePool,
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import windowManager from 'apis/app/window/windowManager'
|
|||||||
import { ipcMain, IpcMainEvent } from 'electron'
|
import { ipcMain, IpcMainEvent } from 'electron'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import { ConcurrencyPromisePool, formatError, getAgent, getFileMimeType, NewDownloader } from '~/manage/utils/common'
|
import { ConcurrencyPromisePool, formatError, getAgent, getFileMimeType, NewDownloader } from '~/manage/utils/common'
|
||||||
import { dogecloudApi, DogecloudToken, getTempToken } from '~/manage/utils/dogeAPI'
|
import { dogecloudApi, DogecloudToken, getTempToken } from '~/manage/utils/dogeAPI'
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import path from 'node:path'
|
|||||||
import windowManager from 'apis/app/window/windowManager'
|
import windowManager from 'apis/app/window/windowManager'
|
||||||
import { ipcMain, IpcMainEvent } from 'electron'
|
import { ipcMain, IpcMainEvent } from 'electron'
|
||||||
|
|
||||||
import type { Undefinable } from '#/types/manage'
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import { formatError } from '~/manage/utils/common'
|
import { formatError } from '~/manage/utils/common'
|
||||||
import ManageLogger from '~/manage/utils/logger'
|
import ManageLogger from '~/manage/utils/logger'
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { ipcMain, IpcMainEvent } from 'electron'
|
|||||||
import FormData from 'form-data'
|
import FormData from 'form-data'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import { ConcurrencyPromisePool, formatError, getFileMimeType, gotUpload, NewDownloader } from '~/manage/utils/common'
|
import { ConcurrencyPromisePool, formatError, getFileMimeType, gotUpload, NewDownloader } from '~/manage/utils/common'
|
||||||
import { ManageLogger } from '~/manage/utils/logger'
|
import { ManageLogger } from '~/manage/utils/logger'
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import COS from 'cos-nodejs-sdk-v5'
|
|||||||
import { ipcMain, IpcMainEvent } from 'electron'
|
import { ipcMain, IpcMainEvent } from 'electron'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import { formatError, getFileMimeType } from '~/manage/utils/common'
|
import { formatError, getFileMimeType } from '~/manage/utils/common'
|
||||||
import { ManageLogger } from '~/manage/utils/logger'
|
import { ManageLogger } from '~/manage/utils/logger'
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import FormData from 'form-data'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import Upyun from 'upyun'
|
import Upyun from 'upyun'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import {
|
import {
|
||||||
ConcurrencyPromisePool,
|
ConcurrencyPromisePool,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { ipcMain, IpcMainEvent } from 'electron'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { AuthType, createClient, FileStat, ProgressEvent, WebDAVClient, WebDAVClientOptions } from 'webdav'
|
import { AuthType, createClient, FileStat, ProgressEvent, WebDAVClient, WebDAVClientOptions } from 'webdav'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import { ConcurrencyPromisePool, formatError, getInnerAgent, NewDownloader } from '~/manage/utils/common'
|
import { ConcurrencyPromisePool, formatError, getInnerAgent, NewDownloader } from '~/manage/utils/common'
|
||||||
import ManageLogger from '~/manage/utils/logger'
|
import ManageLogger from '~/manage/utils/logger'
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { JSONStore } from '@piclist/store'
|
import { JSONStore } from '@piclist/store'
|
||||||
|
|
||||||
import type { IManageApiType, IManageConfigType } from '#/types/manage'
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
interface IJSON {
|
interface IJSON {
|
||||||
[propsName: string]: string | number | IJSON
|
[propsName: string]: string | number | IJSON
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import path from 'node:path'
|
|||||||
import { app } from 'electron'
|
import { app } from 'electron'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IDownloadTask, IUploadTask } from '#/types/manage'
|
|
||||||
import { commonTaskStatus, downloadTaskSpecialStatus, uploadTaskSpecialStatus } from '~/utils/enum'
|
import { commonTaskStatus, downloadTaskSpecialStatus, uploadTaskSpecialStatus } from '~/utils/enum'
|
||||||
|
|
||||||
class UpDownTaskQueue {
|
class UpDownTaskQueue {
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import { ipcMain } from 'electron'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { get, set, unset } from 'lodash-es'
|
import { get, set, unset } from 'lodash-es'
|
||||||
|
|
||||||
import type { IManageApiType, IManageConfigType, IManageError, IPicBedMangeConfig } from '#/types/manage'
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import API from '~/manage/apis/api'
|
import API from '~/manage/apis/api'
|
||||||
import ManageDB from '~/manage/datastore/db'
|
import ManageDB from '~/manage/datastore/db'
|
||||||
import { managePathChecker } from '~/manage/datastore/dbChecker'
|
import { managePathChecker } from '~/manage/datastore/dbChecker'
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import { HttpProxyAgent, HttpsProxyAgent } from 'hpagent'
|
|||||||
import mime from 'mime'
|
import mime from 'mime'
|
||||||
import Downloader from 'nodejs-file-downloader'
|
import Downloader from 'nodejs-file-downloader'
|
||||||
|
|
||||||
import type { IHTTPProxy, IStringKeyMap } from '#/types/types'
|
|
||||||
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
import UpDownTaskQueue from '~/manage/datastore/upDownTaskQueue'
|
||||||
import { ManageLogger } from '~/manage/utils/logger'
|
import { ManageLogger } from '~/manage/utils/logger'
|
||||||
import { formatHttpProxy } from '~/utils/common'
|
import { formatHttpProxy } from '~/utils/common'
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import querystring from 'node:querystring'
|
|||||||
import picgo from '@core/picgo'
|
import picgo from '@core/picgo'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import type { IObj } from '#/types/types'
|
|
||||||
|
|
||||||
export interface DogecloudToken {
|
export interface DogecloudToken {
|
||||||
accessKeyId: string
|
accessKeyId: string
|
||||||
secretAccessKey: string
|
secretAccessKey: string
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import dayjs from 'dayjs'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { ILogColor, ILogger } from 'piclist/dist/types'
|
import { ILogColor, ILogger } from 'piclist/dist/types'
|
||||||
|
|
||||||
import type { IManageApiType, Undefinable } from '#/types/manage'
|
|
||||||
import type { ILogArgvType, ILogArgvTypeWithError } from '#/types/types'
|
|
||||||
import { enforceNumber } from '~/utils/common'
|
import { enforceNumber } from '~/utils/common'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
import { ILogType } from '~/utils/enum'
|
import { ILogType } from '~/utils/enum'
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { app } from 'electron'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import multer from 'multer'
|
import multer from 'multer'
|
||||||
|
|
||||||
import type { ErrnoException, IObj, IServerConfig } from '#/types/types'
|
|
||||||
import routers from '~/server/routerManager'
|
import routers from '~/server/routerManager'
|
||||||
import { ensureHTTPLink, handleResponse } from '~/server/utils'
|
import { ensureHTTPLink, handleResponse } from '~/server/utils'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { routeHandler } from '#/types/types'
|
|
||||||
|
|
||||||
type HttpMethod = 'GET' | 'POST'
|
type HttpMethod = 'GET' | 'POST'
|
||||||
|
|
||||||
class Router {
|
class Router {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { app } from 'electron'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { marked } from 'marked'
|
import { marked } from 'marked'
|
||||||
|
|
||||||
import type { IHttpResponse, IStringKeyMap } from '#/types/types'
|
|
||||||
import { markdownContent } from '~/server/apiDoc'
|
import { markdownContent } from '~/server/apiDoc'
|
||||||
import router from '~/server/router'
|
import router from '~/server/router'
|
||||||
import { deleteChoosedFiles, handleResponse } from '~/server/utils'
|
import { deleteChoosedFiles, handleResponse } from '~/server/utils'
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import ALLApi from 'apis/delete/allApi'
|
|||||||
import GuiApi from 'apis/gui'
|
import GuiApi from 'apis/gui'
|
||||||
import { Notification } from 'electron'
|
import { Notification } from 'electron'
|
||||||
|
|
||||||
import type { IHttpResponse, ImgInfo, IObj } from '#/types/types'
|
|
||||||
import { T as $t } from '~/i18n/index'
|
import { T as $t } from '~/i18n/index'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
import { ICOREBuildInEvent, IWindowList } from '~/utils/enum'
|
import { ICOREBuildInEvent, IWindowList } from '~/utils/enum'
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import picgo from '@core/picgo'
|
|||||||
import logger from '@core/picgo/logger'
|
import logger from '@core/picgo/logger'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
import { encodeFilePath } from '~/utils/common'
|
import { encodeFilePath } from '~/utils/common'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
|
|
||||||
@@ -76,7 +75,7 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
@@ -84,14 +83,14 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
color: #212121;
|
color: #212121;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.window {
|
.window {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border: 1px solid #dadce0;
|
border: 1px solid #dadce0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.titlebar {
|
.titlebar {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
background: #f8f9fa;
|
background: #f8f9fa;
|
||||||
@@ -103,7 +102,7 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
@@ -113,7 +112,7 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-button {
|
.nav-button {
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
@@ -127,17 +126,17 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #5f6368;
|
color: #5f6368;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-button:hover {
|
.nav-button:hover {
|
||||||
background: #f8f9fa;
|
background: #f8f9fa;
|
||||||
border-color: #c4c7c5;
|
border-color: #c4c7c5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-button:disabled {
|
.nav-button:disabled {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-bar {
|
.address-bar {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
@@ -149,12 +148,12 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #202124;
|
color: #202124;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-bar:focus {
|
.address-bar:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
border-color: #1a73e8;
|
border-color: #1a73e8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
@@ -164,24 +163,24 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box:focus {
|
.search-box:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
border-color: #1a73e8;
|
border-color: #1a73e8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content {
|
.main-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-list-container {
|
.file-list-container {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-header {
|
.list-header {
|
||||||
height: 24px;
|
height: 24px;
|
||||||
background: #f8f9fa;
|
background: #f8f9fa;
|
||||||
@@ -195,27 +194,27 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.8px;
|
letter-spacing: 0.8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-name {
|
.header-name {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-modified {
|
.header-modified {
|
||||||
width: 140px;
|
width: 140px;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-size {
|
.header-size {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-list {
|
.file-list {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-item {
|
.file-item {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -226,22 +225,22 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
border-bottom: 1px solid transparent;
|
border-bottom: 1px solid transparent;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-item:hover {
|
.file-item:hover {
|
||||||
background: #f8f9fa;
|
background: #f8f9fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-item:active {
|
.file-item:active {
|
||||||
background: #e8f0fe;
|
background: #e8f0fe;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-icon {
|
.file-icon {
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-name {
|
.file-name {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
@@ -250,7 +249,7 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-modified {
|
.file-modified {
|
||||||
width: 140px;
|
width: 140px;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
@@ -258,7 +257,7 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
color: #5f6368;
|
color: #5f6368;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-size {
|
.file-size {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
@@ -267,20 +266,20 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
color: #5f6368;
|
color: #5f6368;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.directory .file-name {
|
.directory .file-name {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.parent-dir {
|
.parent-dir {
|
||||||
border-bottom: 1px solid #e8eaed;
|
border-bottom: 1px solid #e8eaed;
|
||||||
}
|
}
|
||||||
|
|
||||||
.parent-dir .file-name {
|
.parent-dir .file-name {
|
||||||
color: #1a73e8;
|
color: #1a73e8;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-state {
|
.empty-state {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -289,14 +288,14 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
height: 200px;
|
height: 200px;
|
||||||
color: #5f6368;
|
color: #5f6368;
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-state-icon {
|
.empty-state-icon {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-bar {
|
.status-bar {
|
||||||
height: 22px;
|
height: 22px;
|
||||||
background: #f8f9fa;
|
background: #f8f9fa;
|
||||||
@@ -307,16 +306,16 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #5f6368;
|
color: #5f6368;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.header-modified, .file-modified {
|
.header-modified, .file-modified {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-size, .file-size {
|
.header-size, .file-size {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
}
|
}
|
||||||
@@ -328,7 +327,7 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
<div class="titlebar">
|
<div class="titlebar">
|
||||||
File Browser - ${requestPath || 'Home'}
|
File Browser - ${requestPath || 'Home'}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<button class="nav-button" onclick="history.back()" title="Back">←</button>
|
<button class="nav-button" onclick="history.back()" title="Back">←</button>
|
||||||
<button class="nav-button" onclick="history.forward()" title="Forward">→</button>
|
<button class="nav-button" onclick="history.forward()" title="Forward">→</button>
|
||||||
@@ -336,7 +335,7 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
<input type="text" class="address-bar" value="${requestPath || '/'}" readonly>
|
<input type="text" class="address-bar" value="${requestPath || '/'}" readonly>
|
||||||
<input type="text" class="search-box" placeholder="Search..." id="searchBox">
|
<input type="text" class="search-box" placeholder="Search..." id="searchBox">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="file-list-container">
|
<div class="file-list-container">
|
||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
@@ -344,7 +343,7 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
<div class="header-modified">Date modified</div>
|
<div class="header-modified">Date modified</div>
|
||||||
<div class="header-size">Size</div>
|
<div class="header-size">Size</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="file-list" id="fileList">
|
<div class="file-list" id="fileList">
|
||||||
`
|
`
|
||||||
|
|
||||||
@@ -410,18 +409,18 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="status-bar">
|
<div class="status-bar">
|
||||||
${itemCount} items
|
${itemCount} items
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Search functionality
|
// Search functionality
|
||||||
document.getElementById('searchBox').addEventListener('input', function(e) {
|
document.getElementById('searchBox').addEventListener('input', function(e) {
|
||||||
const searchTerm = e.target.value.toLowerCase();
|
const searchTerm = e.target.value.toLowerCase();
|
||||||
const fileItems = document.querySelectorAll('.file-item:not(.parent-dir)');
|
const fileItems = document.querySelectorAll('.file-item:not(.parent-dir)');
|
||||||
|
|
||||||
fileItems.forEach(item => {
|
fileItems.forEach(item => {
|
||||||
const fileName = item.querySelector('.file-name').textContent.toLowerCase();
|
const fileName = item.querySelector('.file-name').textContent.toLowerCase();
|
||||||
if (fileName.includes(searchTerm)) {
|
if (fileName.includes(searchTerm)) {
|
||||||
@@ -431,7 +430,7 @@ function generateDirectoryListingHtml(files: any[], requestPath: string, fullPat
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle keyboard navigation
|
// Handle keyboard navigation
|
||||||
document.addEventListener('keydown', function(e) {
|
document.addEventListener('keydown', function(e) {
|
||||||
if (e.key === 'F5') {
|
if (e.key === 'F5') {
|
||||||
@@ -508,7 +507,7 @@ function generateErrorPage(errorCode: number, _e: string): string {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
@@ -518,7 +517,7 @@ function generateErrorPage(errorCode: number, _e: string): string {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-container {
|
.error-container {
|
||||||
background: rgba(255, 255, 255, 0.95);
|
background: rgba(255, 255, 255, 0.95);
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
@@ -529,34 +528,34 @@ function generateErrorPage(errorCode: number, _e: string): string {
|
|||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-icon {
|
.error-icon {
|
||||||
font-size: 80px;
|
font-size: 80px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-code {
|
.error-code {
|
||||||
font-size: 48px;
|
font-size: 48px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #e74c3c;
|
color: #e74c3c;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-title {
|
.error-title {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-description {
|
.error-description {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #7f8c8d;
|
color: #7f8c8d;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-button {
|
.back-button {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
@@ -567,25 +566,25 @@ function generateErrorPage(errorCode: number, _e: string): string {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
transition: transform 0.3s, box-shadow 0.3s;
|
transition: transform 0.3s, box-shadow 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-button:hover {
|
.back-button:hover {
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
|
box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 480px) {
|
@media (max-width: 480px) {
|
||||||
.error-container {
|
.error-container {
|
||||||
padding: 40px 30px;
|
padding: 40px 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-icon {
|
.error-icon {
|
||||||
font-size: 60px;
|
font-size: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-code {
|
.error-code {
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-title {
|
.error-title {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { dbPathChecker } from '@core/datastore/dbChecker'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import yaml from 'js-yaml'
|
import yaml from 'js-yaml'
|
||||||
|
|
||||||
import type { ILocales } from '#/types/i18n'
|
|
||||||
import { i18nManager } from '~/i18n'
|
import { i18nManager } from '~/i18n'
|
||||||
|
|
||||||
const configPath = dbPathChecker()
|
const configPath = dbPathChecker()
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import FormData from 'form-data'
|
|||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { isReactive, isRef, toRaw, unref } from 'vue'
|
import { isReactive, isRef, toRaw, unref } from 'vue'
|
||||||
|
|
||||||
import type { IHTTPProxy, IPrivateShowNotificationOption, IStringKeyMap } from '#/types/types'
|
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
import { IShortUrlServer } from '~/utils/enum'
|
import { IShortUrlServer } from '~/utils/enum'
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,5 @@
|
|||||||
import type { IBuildInCompressOptions, IBuildInWaterMarkOptions } from 'piclist'
|
import type { IBuildInCompressOptions, IBuildInWaterMarkOptions } from 'piclist'
|
||||||
|
|
||||||
import type {
|
|
||||||
IAliYunConfig,
|
|
||||||
IAwsS3PListUserConfig,
|
|
||||||
IGitHubConfig,
|
|
||||||
IImgurConfig,
|
|
||||||
ILocalConfig,
|
|
||||||
ILskyConfig,
|
|
||||||
IPicBedType,
|
|
||||||
IQiniuConfig,
|
|
||||||
IServerConfig,
|
|
||||||
ISftpPlistConfig,
|
|
||||||
IShortKeyConfig,
|
|
||||||
ISMMSConfig,
|
|
||||||
ISyncConfig,
|
|
||||||
ITcYunConfig,
|
|
||||||
IUploaderConfig,
|
|
||||||
IUpYunConfig,
|
|
||||||
IWebdavPlistConfig,
|
|
||||||
} from '#/types/types'
|
|
||||||
|
|
||||||
export type manualPageOpenType = 'window' | 'browser'
|
export type manualPageOpenType = 'window' | 'browser'
|
||||||
|
|
||||||
type IPicGoPlugins = Record<`picgo-plugin-${string}`, boolean>
|
type IPicGoPlugins = Record<`picgo-plugin-${string}`, boolean>
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { NodeHttpHandler } from '@smithy/node-http-handler'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import type { ISftpPlistConfig } from 'piclist'
|
import type { ISftpPlistConfig } from 'piclist'
|
||||||
|
|
||||||
import type { IObj, IStringKeyMap } from '#/types/types'
|
|
||||||
import { getAgent } from '~/manage/utils/common'
|
import { getAgent } from '~/manage/utils/common'
|
||||||
import SSHClient from '~/utils/sshClient'
|
import SSHClient from '~/utils/sshClient'
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ import crypto from 'node:crypto'
|
|||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
const AUTH_KEY_VALUE_RE = /(\w+)=["']?([^'"]{1,10000})["']?/
|
const AUTH_KEY_VALUE_RE = /(\w+)=["']?([^'"]{1,10000})["']?/
|
||||||
let NC = 0
|
let NC = 0
|
||||||
const NC_PAD = '00000000'
|
const NC_PAD = '00000000'
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import picgo from '@core/picgo'
|
import picgo from '@core/picgo'
|
||||||
|
|
||||||
import type { IPicBedType } from '#/types/types'
|
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
|
|
||||||
const getPicBeds = () => {
|
const getPicBeds = () => {
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
import picgo from '@core/picgo'
|
import picgo from '@core/picgo'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
import type {
|
|
||||||
IPicGoPluginConfig,
|
|
||||||
IPicGoPluginOriginConfig,
|
|
||||||
IStringKeyMap,
|
|
||||||
IUploaderConfigItem,
|
|
||||||
IUploaderConfigListItem,
|
|
||||||
} from '#/types/types'
|
|
||||||
import { setTrayToolTip, trimValues } from '~/utils/common'
|
import { setTrayToolTip, trimValues } from '~/utils/common'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
import type { IAppNotification } from '#/types/types'
|
|
||||||
|
|
||||||
export const notificationList: IAppNotification[] = []
|
export const notificationList: IAppNotification[] = []
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import db from '@core/datastore'
|
import db from '@core/datastore'
|
||||||
|
|
||||||
import type { ImgInfo } from '#/types/types'
|
|
||||||
import { generateShortUrl, handleUrlEncodeWithSetting } from '~/utils/common'
|
import { generateShortUrl, handleUrlEncodeWithSetting } from '~/utils/common'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import fs from 'fs-extra'
|
|||||||
import { HttpsProxyAgent } from 'hpagent'
|
import { HttpsProxyAgent } from 'hpagent'
|
||||||
import { AuthType, createClient, WebDAVClientOptions } from 'webdav'
|
import { AuthType, createClient, WebDAVClientOptions } from 'webdav'
|
||||||
|
|
||||||
import type { IGalleryDBFile, IGalleryDBGalleryItem, ISyncConfig } from '#/types/types'
|
|
||||||
import { extractData, zipData } from '~/utils/common'
|
import { extractData, zipData } from '~/utils/common'
|
||||||
import { formatEndpoint } from '~/utils/common'
|
import { formatEndpoint } from '~/utils/common'
|
||||||
import { configPaths } from '~/utils/configPaths'
|
import { configPaths } from '~/utils/configPaths'
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { getRawData } from '@/utils/common'
|
import { getRawData } from '@/utils/common'
|
||||||
import { IRPCActionType } from '@/utils/enum'
|
import { IRPCActionType } from '@/utils/enum'
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
export default class ALLApi {
|
export default class ALLApi {
|
||||||
static async delete(configMap: IStringKeyMap): Promise<boolean> {
|
static async delete(configMap: IStringKeyMap): Promise<boolean> {
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ import { useI18n } from 'vue-i18n'
|
|||||||
|
|
||||||
import $bus from '@/utils/bus'
|
import $bus from '@/utils/bus'
|
||||||
import { SHOW_INPUT_BOX, SHOW_INPUT_BOX_RESPONSE } from '@/utils/constant'
|
import { SHOW_INPUT_BOX, SHOW_INPUT_BOX_RESPONSE } from '@/utils/constant'
|
||||||
import type { IShowInputBoxOption } from '#/types/types'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const inputBoxValue = ref('')
|
const inputBoxValue = ref('')
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ import { useI18n } from 'vue-i18n'
|
|||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
import { getConfig } from '@/utils/dataSender'
|
import { getConfig } from '@/utils/dataSender'
|
||||||
import type { IPicGoPluginConfig, IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
config: any[]
|
config: any[]
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
export const useAppStore = defineStore('app', () => {
|
export const useAppStore = defineStore('app', () => {
|
||||||
const settings = ref<IStringKeyMap>({
|
const settings = ref<IStringKeyMap>({
|
||||||
app: {
|
app: {
|
||||||
|
|||||||
@@ -1294,8 +1294,6 @@ import { videoExt } from '@/manage/utils/videofile'
|
|||||||
import { trimPath } from '@/utils/common'
|
import { trimPath } from '@/utils/common'
|
||||||
import { IRPCActionType } from '@/utils/enum'
|
import { IRPCActionType } from '@/utils/enum'
|
||||||
import { cancelDownloadLoadingFileList, refreshDownloadFileTransferList } from '@/utils/static'
|
import { cancelDownloadLoadingFileList, refreshDownloadFileTransferList } from '@/utils/static'
|
||||||
import type { IDownloadTask, IUploadTask } from '#/types/manage'
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|||||||
@@ -309,7 +309,6 @@ import { getConfig, removeConfig, saveConfig } from '@/manage/utils/dataSender'
|
|||||||
import { formatEndpoint } from '@/utils/common'
|
import { formatEndpoint } from '@/utils/common'
|
||||||
import { getConfig as getPicBedsConfig } from '@/utils/dataSender'
|
import { getConfig as getPicBedsConfig } from '@/utils/dataSender'
|
||||||
import { IRPCActionType } from '@/utils/enum'
|
import { IRPCActionType } from '@/utils/enum'
|
||||||
import type { IStringKeyMap, IUploaderConfigListItem } from '#/types/types'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const manageStore = useManageStore()
|
const manageStore = useManageStore()
|
||||||
|
|||||||
@@ -276,7 +276,6 @@ import { useManageStore } from '@/manage/store/manageStore'
|
|||||||
import { supportedPicBedList } from '@/manage/utils/constants'
|
import { supportedPicBedList } from '@/manage/utils/constants'
|
||||||
import { newBucketConfig } from '@/manage/utils/newBucketConfig'
|
import { newBucketConfig } from '@/manage/utils/newBucketConfig'
|
||||||
import { IRPCActionType } from '@/utils/enum'
|
import { IRPCActionType } from '@/utils/enum'
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const manageStore = useManageStore() as any
|
const manageStore = useManageStore() as any
|
||||||
|
|||||||
@@ -226,7 +226,6 @@ import { fileCacheDbInstance } from '@/manage/store/bucketFileDb'
|
|||||||
import { customRenameFormatTable, formatFileSize } from '@/manage/utils/common'
|
import { customRenameFormatTable, formatFileSize } from '@/manage/utils/common'
|
||||||
import { getConfig, saveConfig } from '@/manage/utils/dataSender'
|
import { getConfig, saveConfig } from '@/manage/utils/dataSender'
|
||||||
import { IRPCActionType } from '@/utils/enum'
|
import { IRPCActionType } from '@/utils/enum'
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import Dexie, { Table } from 'dexie'
|
import Dexie, { Table } from 'dexie'
|
||||||
|
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* create a database for bucket file cache
|
* create a database for bucket file cache
|
||||||
*database name: bucketFileDb
|
*database name: bucketFileDb
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import { getConfig } from '@/manage/utils/dataSender'
|
import { getConfig } from '@/manage/utils/dataSender'
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
export const useManageStore = defineStore('manageConfig', {
|
export const useManageStore = defineStore('manageConfig', {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
const AliyunAreaCodeName: IStringKeyMap = {
|
const AliyunAreaCodeName: IStringKeyMap = {
|
||||||
'oss-cn-hangzhou': '华东1(杭州)',
|
'oss-cn-hangzhou': '华东1(杭州)',
|
||||||
'oss-cn-shanghai': '华东2(上海)',
|
'oss-cn-shanghai': '华东2(上海)',
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { v4 as uuidv4 } from 'uuid'
|
|||||||
import { getConfig } from '@/manage/utils/dataSender'
|
import { getConfig } from '@/manage/utils/dataSender'
|
||||||
import { availableIconList } from '@/manage/utils/icon'
|
import { availableIconList } from '@/manage/utils/icon'
|
||||||
import { isNeedToShorten, safeSliceF } from '@/utils/common'
|
import { isNeedToShorten, safeSliceF } from '@/utils/common'
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
export const isUrlEncode = (url: string): boolean => {
|
export const isUrlEncode = (url: string): boolean => {
|
||||||
url = url || ''
|
url = url || ''
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { createI18n } from 'vue-i18n'
|
|||||||
import en from '@/i18n/locales/en.json'
|
import en from '@/i18n/locales/en.json'
|
||||||
import zhCN from '@/i18n/locales/zh-CN.json'
|
import zhCN from '@/i18n/locales/zh-CN.json'
|
||||||
import zhTW from '@/i18n/locales/zh-TW.json'
|
import zhTW from '@/i18n/locales/zh-TW.json'
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
type MessageSchema = typeof en
|
type MessageSchema = typeof en
|
||||||
|
|
||||||
const i18n = createI18n<MessageSchema, 'en' | 'zh-CN' | 'zh-TW'>({
|
const i18n = createI18n<MessageSchema, 'en' | 'zh-CN' | 'zh-TW'>({
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { IRPCActionType } from '@/utils/enum'
|
import { IRPCActionType } from '@/utils/enum'
|
||||||
import type { IObj } from '#/types/types'
|
|
||||||
|
|
||||||
export function saveConfig(config: IObj | string, value?: any) {
|
export function saveConfig(config: IObj | string, value?: any) {
|
||||||
const configObj = typeof config === 'string' ? { [config]: value } : config
|
const configObj = typeof config === 'string' ? { [config]: value } : config
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
const AUTH_KEY_VALUE_RE = /(\w+)=["']?([^'"]{1,10000})["']?/
|
const AUTH_KEY_VALUE_RE = /(\w+)=["']?([^'"]{1,10000})["']?/
|
||||||
let NC = 0
|
let NC = 0
|
||||||
const NC_PAD = '00000000'
|
const NC_PAD = '00000000'
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { createI18n } from 'vue-i18n'
|
|||||||
import en from '@/i18n/locales/en.json'
|
import en from '@/i18n/locales/en.json'
|
||||||
import zhCN from '@/i18n/locales/zh-CN.json'
|
import zhCN from '@/i18n/locales/zh-CN.json'
|
||||||
import zhTW from '@/i18n/locales/zh-TW.json'
|
import zhTW from '@/i18n/locales/zh-TW.json'
|
||||||
import type { IStringKeyMap } from '#/types/types'
|
|
||||||
|
|
||||||
import { AliyunAreaCodeName, QiniuAreaCodeName, TencentAreaCodeName } from './bucketConfigCons'
|
import { AliyunAreaCodeName, QiniuAreaCodeName, TencentAreaCodeName } from './bucketConfigCons'
|
||||||
type MessageSchema = typeof en
|
type MessageSchema = typeof en
|
||||||
|
|||||||
@@ -517,7 +517,6 @@ import $$db from '@/utils/db'
|
|||||||
import { IPasteStyle, IRPCActionType } from '@/utils/enum'
|
import { IPasteStyle, IRPCActionType } from '@/utils/enum'
|
||||||
import { picBedGlobal } from '@/utils/global'
|
import { picBedGlobal } from '@/utils/global'
|
||||||
import { picBedsCanbeDeleted } from '@/utils/static'
|
import { picBedsCanbeDeleted } from '@/utils/static'
|
||||||
import type { IGalleryItem, ImgInfo, IObj, IObjT } from '#/types/types'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user