diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed305d..fe3a975 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +## :tada: 2.9.4 (2024-10-22) + + +### :sparkles: Features + +* **custom:** change default short key ([64fba8a](https://github.com/Kuingsmile/piclist/commit/64fba8a)) +* **custom:** optimize second uploader ([0565ce3](https://github.com/Kuingsmile/piclist/commit/0565ce3)), closes [#241](https://github.com/Kuingsmile/piclist/issues/241) [#238](https://github.com/Kuingsmile/piclist/issues/238) +* **custom:** remove telegra.ph ([59ed79a](https://github.com/Kuingsmile/piclist/commit/59ed79a)) + + +### :bug: Bug Fixes + +* **custom:** fix gallery image delete bug ([d6f48e5](https://github.com/Kuingsmile/piclist/commit/d6f48e5)), closes [#239](https://github.com/Kuingsmile/piclist/issues/239) +* **custom:** fix webdav url bug ([07cf63a](https://github.com/Kuingsmile/piclist/commit/07cf63a)), closes [#243](https://github.com/Kuingsmile/piclist/issues/243) + + +### :pencil: Documentation + +* **custom:** prepare for 2.9.4 ([4b12e42](https://github.com/Kuingsmile/piclist/commit/4b12e42)) + + + ## :tada: 2.9.3 (2024-08-22) diff --git a/FAQ.md b/FAQ.md index 313553d..7334224 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,166 +1,165 @@ -# FAQ - -该FAQ修改自PicGo的FAQ,感谢PicGo的作者Molunerfinn。 - -## 常见问题 - -> 常规配置问题请参考 [官方文档](https://piclist.cn) - -## 1. PicList和PicGo有什么关系? - -PicList项目fork自PicGo项目,基于PicGo进行了二次开发,同时核心功能内核PicGo-Core也进行了二次开发,重命名为[PicList-Core](https://github.com/Kuingsmile/PicList-Core)。 - -PicList所有新功能的添加没有影响到PicGo的原有功能,所以你可以在PicList中使用PicGo的大部分插件。同时仍然可以配合typora、obsidian等软件进行使用。 - -## 2. 使用图床管理功能时,出现无法获取目录等错误 - -请查看日志文件 `manage.log`,此外,各平台的API调用基本都有每小时次数限制,如果出现错误,请稍后再试。 - -## 3. 支持哪些图床远端同步删除 - -目前支持的图床有: - -- 阿里云 OSS -- 腾讯云 COS -- 七牛云 Kodo -- 又拍云 -- SM.MS -- Imgur -- GitHub -- WebDav -- Aws S3 -- 本地路径 -- 内置SFTP -- 多吉云 -- 华为云 OBS -- Alist -- 兰空图床 - -## 4. 能否支持上传视频文件 - -可以,通过新添加的图床管理功能,你可以上传任意格式的文件,包括视频文件。同时,在管理界面内上传时,使用分片上传/流式上传等方式,相对于PicGo内置的转换为base64的方式,上传更快,更稳定。 - -## 5. 能否支持某某某图床 - -PicList本体支持了如下图床: - -- `七牛图床` -- `AWS S3 兼容平台` -- `腾讯云 COS` -- `又拍云` -- `GitHub` -- `SM.MS` -- `阿里云 OSS` -- `Imgur` -- `Webdav` -- `本地图床` -- `SFTP` -- `Telegra.ph` -- `兰空图床` -- `PicList(套娃)` - -PicList计划整合和优化现有插件,内置更多的常用图床。 - -此外,PicList兼容PicGo的插件系统,需要其他图床支持可以参考目前已有的PicGo三方 [插件](https://github.com/PicGo/Awesome-PicGo),如果还是没有你所需要的图床欢迎开发一个插件供大家使用。 - -## 6. Github 图床有时能上传,有时上传失败 - -GitHub 服务器和国内 GFW 的问题会导致有时上传成功,有时上传失败,无解。 - -想要稳定请使用付费云存储,如阿里云、腾讯云等,价格也不会贵。 - -## 7. Mac 上无法打开 PicList 的主窗口界面 - -要打开主窗口,请右键或者双指点按顶部栏 PicList 图标,选择「打开主窗口」即可打开主窗口。 - -或者在dock栏中右键PicList图标,选择「打开主窗口」。 - -## 8. 上传失败,或者是服务器出错 - -1. PicList 自带的图床都经过测试,上传出错一般都不是 PicList 自身的原因。如果你用的是 GitHub 图床请参考上面的第 7 点。 -2. 检查 PicList 的日志(报错日志可以在 PicList 设置 -> 设置日志文件 -> 点击打开 后找到),看看 `[PicList Error]` 的报错信息里有什么关键信息 - 1. 先自行搜索 error 里的报错信息,往往你能百度或者谷歌出问题原因,不必开 issue。 - 2. 如果有带有 `401` 、`403` 等 `40X` 状态码字样的,不用怀疑,就是你配置写错了,仔细检查配置,看看是否多了空格之类的。 - 3. 如果带有 `HttpError`、`RequestError` 、 `socket hang up` 等字样的说明这是网络问题,我无法帮你解决网络问题,请检查你自己的网络,是否有代理,DNS 设置是否正常等。 -3. 通常网络问题引起的上传失败都是因为代理设置不当导致的。如果开启了系统代理,建议同时也在 PicList 的代理设置中设置对应的HTTP代理。 - -## 10. macOS版本安装完之后没有主界面 - -请找到PicList在顶部栏的图标,然后右键(触摸板双指点按,或者鼠标右键),即可找到「打开主窗口」的菜单。 - -或者再Docker栏PicList的图标上右键,即可找到「打开主窗口」的菜单。 - -## 11. macOS系统安装完PicList显示「文件已损坏」或者安装完打开没有反应 - -请升级PicList 1.4.1或以上版本,自1.4.1开始,PicList已经经过Apple的签名,不会再出现这种情况。 - -## 12. 水印没有正常添加 - -PicList在添加水印前会先检查字体文件是否存在,如果不存在会自动下载字体文件,但是由于网络问题,可能会导致字体文件下载失败,此时会跳过水印添加。 - -请根据自己的系统检查对应路径下的字体文件是否存在,如果不存在,请手动下载字体文件,然后放到对应的路径下。 - -Windows: `%APPDATA%\piclist\assets\simhei.ttf` -Linux: `$XDG_CONFIG_HOME/piclist/assets/simhei.ttf` or `~/.config//assets/simhei.ttf` -macOS: `~/Library/Application\ Support/picgo/assets/simhei.ttf` - -字体文件下载地址:[https://release.piclist.cn/simhei.ttf](https://release.piclist.cn/simhei.ttf) - -## 13. 使用aws-s3插件上传到cloudflare R2时出现上传失败问题 - -R2的endpoint地址会出现被GFW sni阻断的问题,查看piclist.log后将对应的ip地址加入代理列表可解决。 - -## 14. PicList兼容所有的PicGo插件吗? - -PicList兼容绝大部分的PicGo插件。然而由于PicList使用了更新的electron版本,与旧版本的sharp库不兼容,所以部分插件可能无法使用。 - -已知的无法使用的插件有: - -- picgo-plugin-watermark (已经内置) -- picgo-plugin-pic-migrater (该插件会校验PicGo的版本,无法使用,请换用pic-migrater-piclist插件) -- picgo-plugin-auto-delete (已经内置) - -欢迎大家测试其他插件,如果有无法使用的插件,欢迎开issue反馈。 - -## 15. 如何通过Docker运行PicList-core? - -### docker run - -修改 `./piclist`为你自己的路径,修改 `piclist123456`为你自己的密钥。 - -```bash -docker run -d \ - --name piclist \ - --restart always \ - -p 36677:36677 \ - -v "./piclist:/root/.piclist" \ - kuingsmile/piclist:latest \ - node /usr/local/bin/picgo-server -k piclist123456 -``` - -### docker-compose - -下载piclist-core仓库的 `docker-compose.yml`文件,或者复制以下内容到 `docker-compose.yml`文件中: - -```yaml -version: '3.3' - -services: - node: - image: 'kuingsmile/piclist:latest' - container_name: piclist - restart: always - ports: - - 36677:36677 - volumes: - - './piclist:/root/.piclist' - command: node /usr/local/bin/picgo-server -k piclist123456 -``` - -你可以修改 `volumes`为你自己的路径,修改 `command`为你自己的密钥。 - -然后运行 - -```bash -docker-compose up -d -``` +# FAQ + +该FAQ修改自PicGo的FAQ,感谢PicGo的作者Molunerfinn。 + +## 常见问题 + +> 常规配置问题请参考 [官方文档](https://piclist.cn) + +## 1. PicList和PicGo有什么关系? + +PicList项目fork自PicGo项目,基于PicGo进行了二次开发,同时核心功能内核PicGo-Core也进行了二次开发,重命名为[PicList-Core](https://github.com/Kuingsmile/PicList-Core)。 + +PicList所有新功能的添加没有影响到PicGo的原有功能,所以你可以在PicList中使用PicGo的大部分插件。同时仍然可以配合typora、obsidian等软件进行使用。 + +## 2. 使用图床管理功能时,出现无法获取目录等错误 + +请查看日志文件 `manage.log`,此外,各平台的API调用基本都有每小时次数限制,如果出现错误,请稍后再试。 + +## 3. 支持哪些图床远端同步删除 + +目前支持的图床有: + +- 阿里云 OSS +- 腾讯云 COS +- 七牛云 Kodo +- 又拍云 +- SM.MS +- Imgur +- GitHub +- WebDav +- Aws S3 +- 本地路径 +- 内置SFTP +- 多吉云 +- 华为云 OBS +- Alist +- 兰空图床 + +## 4. 能否支持上传视频文件 + +可以,通过新添加的图床管理功能,你可以上传任意格式的文件,包括视频文件。同时,在管理界面内上传时,使用分片上传/流式上传等方式,相对于PicGo内置的转换为base64的方式,上传更快,更稳定。 + +## 5. 能否支持某某某图床 + +PicList本体支持了如下图床: + +- `七牛图床` +- `AWS S3 兼容平台` +- `腾讯云 COS` +- `又拍云` +- `GitHub` +- `SM.MS` +- `阿里云 OSS` +- `Imgur` +- `Webdav` +- `本地图床` +- `SFTP` +- `兰空图床` +- `PicList(套娃)` + +PicList计划整合和优化现有插件,内置更多的常用图床。 + +此外,PicList兼容PicGo的插件系统,需要其他图床支持可以参考目前已有的PicGo三方 [插件](https://github.com/PicGo/Awesome-PicGo),如果还是没有你所需要的图床欢迎开发一个插件供大家使用。 + +## 6. Github 图床有时能上传,有时上传失败 + +GitHub 服务器和国内 GFW 的问题会导致有时上传成功,有时上传失败,无解。 + +想要稳定请使用付费云存储,如阿里云、腾讯云等,价格也不会贵。 + +## 7. Mac 上无法打开 PicList 的主窗口界面 + +要打开主窗口,请右键或者双指点按顶部栏 PicList 图标,选择「打开主窗口」即可打开主窗口。 + +或者在dock栏中右键PicList图标,选择「打开主窗口」。 + +## 8. 上传失败,或者是服务器出错 + +1. PicList 自带的图床都经过测试,上传出错一般都不是 PicList 自身的原因。如果你用的是 GitHub 图床请参考上面的第 7 点。 +2. 检查 PicList 的日志(报错日志可以在 PicList 设置 -> 设置日志文件 -> 点击打开 后找到),看看 `[PicList Error]` 的报错信息里有什么关键信息 + 1. 先自行搜索 error 里的报错信息,往往你能百度或者谷歌出问题原因,不必开 issue。 + 2. 如果有带有 `401` 、`403` 等 `40X` 状态码字样的,不用怀疑,就是你配置写错了,仔细检查配置,看看是否多了空格之类的。 + 3. 如果带有 `HttpError`、`RequestError` 、 `socket hang up` 等字样的说明这是网络问题,我无法帮你解决网络问题,请检查你自己的网络,是否有代理,DNS 设置是否正常等。 +3. 通常网络问题引起的上传失败都是因为代理设置不当导致的。如果开启了系统代理,建议同时也在 PicList 的代理设置中设置对应的HTTP代理。 + +## 10. macOS版本安装完之后没有主界面 + +请找到PicList在顶部栏的图标,然后右键(触摸板双指点按,或者鼠标右键),即可找到「打开主窗口」的菜单。 + +或者再Docker栏PicList的图标上右键,即可找到「打开主窗口」的菜单。 + +## 11. macOS系统安装完PicList显示「文件已损坏」或者安装完打开没有反应 + +请升级PicList 1.4.1或以上版本,自1.4.1开始,PicList已经经过Apple的签名,不会再出现这种情况。 + +## 12. 水印没有正常添加 + +PicList在添加水印前会先检查字体文件是否存在,如果不存在会自动下载字体文件,但是由于网络问题,可能会导致字体文件下载失败,此时会跳过水印添加。 + +请根据自己的系统检查对应路径下的字体文件是否存在,如果不存在,请手动下载字体文件,然后放到对应的路径下。 + +Windows: `%APPDATA%\piclist\assets\simhei.ttf` +Linux: `$XDG_CONFIG_HOME/piclist/assets/simhei.ttf` or `~/.config//assets/simhei.ttf` +macOS: `~/Library/Application\ Support/picgo/assets/simhei.ttf` + +字体文件下载地址:[https://release.piclist.cn/simhei.ttf](https://release.piclist.cn/simhei.ttf) + +## 13. 使用aws-s3插件上传到cloudflare R2时出现上传失败问题 + +R2的endpoint地址会出现被GFW sni阻断的问题,查看piclist.log后将对应的ip地址加入代理列表可解决。 + +## 14. PicList兼容所有的PicGo插件吗? + +PicList兼容绝大部分的PicGo插件。然而由于PicList使用了更新的electron版本,与旧版本的sharp库不兼容,所以部分插件可能无法使用。 + +已知的无法使用的插件有: + +- picgo-plugin-watermark (已经内置) +- picgo-plugin-pic-migrater (该插件会校验PicGo的版本,无法使用,请换用pic-migrater-piclist插件) +- picgo-plugin-auto-delete (已经内置) + +欢迎大家测试其他插件,如果有无法使用的插件,欢迎开issue反馈。 + +## 15. 如何通过Docker运行PicList-core? + +### docker run + +修改 `./piclist`为你自己的路径,修改 `piclist123456`为你自己的密钥。 + +```bash +docker run -d \ + --name piclist \ + --restart always \ + -p 36677:36677 \ + -v "./piclist:/root/.piclist" \ + kuingsmile/piclist:latest \ + node /usr/local/bin/picgo-server -k piclist123456 +``` + +### docker-compose + +下载piclist-core仓库的 `docker-compose.yml`文件,或者复制以下内容到 `docker-compose.yml`文件中: + +```yaml +version: '3.3' + +services: + node: + image: 'kuingsmile/piclist:latest' + container_name: piclist + restart: always + ports: + - 36677:36677 + volumes: + - './piclist:/root/.piclist' + command: node /usr/local/bin/picgo-server -k piclist123456 +``` + +你可以修改 `volumes`为你自己的路径,修改 `command`为你自己的密钥。 + +然后运行 + +```bash +docker-compose up -d +``` diff --git a/FAQ_EN.md b/FAQ_EN.md index e5185e4..06d60cb 100644 --- a/FAQ_EN.md +++ b/FAQ_EN.md @@ -55,7 +55,6 @@ PicList itself supports the following image hosting platforms: - Webdav - Local path - SFTP -- Telegra.ph - Lsky Pro - PicList (nested) diff --git a/README.md b/README.md index 6299f3d..d3cda53 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ if you want to use PicList-core, please go to [https://github.com/Kuingsmile/Pic ## Features - Retains all the features of PicGo and is compatible with the vast majority of existing PicGo plugins, including integrations with software like Typora and Obsidian. -- Added multiple built-in image hosting platforms, such as WebDav, Lsky Pro, local image hosting, SFTP and Telegra.ph. The original built-in imgur image host now also supports account login for uploading. +- Added multiple built-in image hosting platforms, such as WebDav, Lsky Pro, local image hosting, SFTP. The original built-in imgur image host now also supports account login for uploading. - Within the album, you can synchronize the deletion of cloud images. This is supported across all built-in image hosts and multiple plugins. - The album now offers advanced search and sorting features, as well as batch URL modification. - Built-in tools for adding watermarks, compressing images, scaling images, rotating images, and converting image formats are now available. Advanced renaming is also supported. @@ -139,7 +139,6 @@ docker-compose up -d | Built-in SFTP | ✔️ | ✔️ | | Doge Cloud | ✔️ | ✔️ | | PicList(Lasso-Doll) | ✔️ | ✔️ | -| Telegra.ph | ✔️ | × | | Lsky Pro | ✔️ | ✔️ | | Custom API platform | × | × | diff --git a/README_cn.md b/README_cn.md index b8a7497..83a3989 100644 --- a/README_cn.md +++ b/README_cn.md @@ -34,7 +34,7 @@ PicList的内核使用的是原版PicGo-Core基础上修改的[PicList-core](htt ## 特色功能 - 保留了PicGo的所有功能,兼容绝大部分已有的PicGo插件,包括和Typora、Obsidian等软件的搭配 -- 新增了多个内置图床,如WebDav、兰空图床、本地图床、SFTP和Telegra.ph等,原内置imgur图床额外支持登录账号上传 +- 新增了多个内置图床,如WebDav、兰空图床、本地图床、SFTP等,原内置imgur图床额外支持登录账号上传 - 相册中可同步删除云端图片,支持所有内置图床和多个插件 - 相册新增了高级搜索和排序,批量修改URL等功能 - 内置水印添加、图片压缩、图片缩放、图片旋转和图片格式转换等功能,同时支持高级重命名 @@ -141,7 +141,6 @@ docker-compose up -d | 内置SFTP | ✔️ | ✔️ | | 多吉云 | ✔️ | ✔️ | | PicList(套娃) | ✔️ | ✔️ | -| Telegra.ph | ✔️ | x | | 兰空图床 | ✔️ | ✔️ | | 自定义图床 | x | x | diff --git a/currentVersion.md b/currentVersion.md index d441ae5..d3fa846 100644 --- a/currentVersion.md +++ b/currentVersion.md @@ -1,9 +1,10 @@ ### ✨ Features -- 新增第二图床上传支持 -- 现在管理页面支持预览avif图片 -- 调整了图床配置页面的日期显示格式 +- 优化了第二图床的上传逻辑,现在会使用相同文件名和压缩方式 +- 移除了telegra.ph图床(官方现已关闭匿名上传功能) +- 默认上传快捷键修改为`Ctrl+Alt+U`,避免与vscode命令面板冲突 ### 🐛 Bug Fixes -- 修复了PicList图床对core版的兼容性问题 +- 修复了webdav图床链接拼接错误的问题 +- 修复了开启云删除时部分第三方图床图片无法批量删除的问题 diff --git a/currentVersion_en.md b/currentVersion_en.md index 23edb93..499e314 100644 --- a/currentVersion_en.md +++ b/currentVersion_en.md @@ -1,9 +1,10 @@ ### ✨ Features -- Added support for the second image bed upload -- Now the management page supports previewing avif images -- Adjusted the date display format on the image bed configuration page +- Optimize the upload logic of the second image bed, now it will use the same file name and compression method +- Removed telegra.ph image bed (officially closed anonymous upload function) +- The default upload shortcut key is changed to `Ctrl+Alt+U` to avoid conflicts with the vscode command panel ### 🐛 Bug Fixes -- Fixed the compatibility issue of PicList image bed with the core version \ No newline at end of file +- Fixed the problem of incorrect splicing of webdav image bed links +- Fixed the problem that some third-party image bed pictures cannot be deleted in batches when cloud deletion is enabled diff --git a/package.json b/package.json index 3da93ad..81554fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "piclist", - "version": "2.9.3", + "version": "2.9.4", "author": { "name": "Kuingsmile", "email": "pkukuing@gmail.com" @@ -67,7 +67,7 @@ "multer": "^1.4.5-lts.1", "node-ssh-no-cpu-features": "^2.0.0", "nodejs-file-downloader": "^4.12.1", - "piclist": "^1.9.3", + "piclist": "^1.9.6", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.1", "proxy-agent": "^5.0.0", diff --git a/src/main/apis/app/system/index.ts b/src/main/apis/app/system/index.ts index bc3b2a3..380a680 100644 --- a/src/main/apis/app/system/index.ts +++ b/src/main/apis/app/system/index.ts @@ -309,8 +309,16 @@ export function createTray(tooltip: string) { const pasteStyle = db.get(configPaths.settings.pasteStyle) || IPasteStyle.MARKDOWN const rawInput = cloneDeep(files) const trayWindow = windowManager.get(IWindowList.TRAY_WINDOW)! - await handleSecondaryUpload(trayWindow.webContents, files, 'tray') - const imgs = await uploader.setWebContents(trayWindow.webContents).upload(files) + const { needRestore, ctx } = await handleSecondaryUpload(trayWindow.webContents, files, 'tray') + let imgs: ImgInfo[] | false = false + if (needRestore) { + const res = await uploader + .setWebContents(trayWindow.webContents) + .uploadReturnCtx(ctx ? ctx.processedInput : files, true) + imgs = res ? res.output : false + } else { + imgs = await uploader.setWebContents(trayWindow.webContents).upload(files) + } const deleteLocalFile = db.get(configPaths.settings.deleteLocalFile) || false if (imgs !== false) { const pasteText: string[] = [] diff --git a/src/main/apis/app/uploader/apis.ts b/src/main/apis/app/uploader/apis.ts index 59b5764..068ff1f 100644 --- a/src/main/apis/app/uploader/apis.ts +++ b/src/main/apis/app/uploader/apis.ts @@ -15,6 +15,7 @@ import pasteTemplate from '~/utils/pasteTemplate' import { IPasteStyle, IWindowList } from '#/types/enum' import { configPaths } from '#/utils/configPaths' import { changeCurrentUploader } from '~/utils/handleUploaderConfig' +import { IPicGo } from 'piclist' const handleClipboardUploading = async (): Promise => { const useBuiltinClipboard = @@ -28,9 +29,27 @@ const handleClipboardUploading = async (): Promise => { return await uploader.setWebContents(win!.webContents).upload() } +const handleClipboardUploadingReturnCtx = async (img?: IUploadOption, skipProcess = false): Promise => { + const useBuiltinClipboard = + db.get(configPaths.settings.useBuiltinClipboard) === undefined + ? true + : !!db.get(configPaths.settings.useBuiltinClipboard) + const win = windowManager.getAvailableWindow() + if (useBuiltinClipboard) { + return await uploader.setWebContents(win!.webContents).uploadWithBuildInClipboardReturnCtx(img, skipProcess) + } + return await uploader.setWebContents(win!.webContents).uploadReturnCtx(img, skipProcess) +} + export const uploadClipboardFiles = async (): Promise => { - await handleSecondaryUpload(undefined, undefined, 'clipboard') - const img = await handleClipboardUploading() + const { needRestore, ctx } = await handleSecondaryUpload(undefined, undefined, 'clipboard') + let img: ImgInfo[] | false = false + if (needRestore) { + const res = await handleClipboardUploadingReturnCtx(ctx ? ctx.processedInput : undefined, true) + img = res ? res.output : false + } else { + img = await handleClipboardUploading() + } if (img !== false) { if (img.length > 0) { const trayWindow = windowManager.get(IWindowList.TRAY_WINDOW) @@ -86,8 +105,14 @@ export const uploadChoosedFiles = async ( ): Promise => { const input = files.map(item => item.path) const rawInput = cloneDeep(input) - await handleSecondaryUpload(webContents, input) - const imgs = await uploader.setWebContents(webContents).upload(input) + const { needRestore, ctx } = await handleSecondaryUpload(webContents, input) + let imgs: ImgInfo[] | false = false + if (needRestore) { + const res = await uploader.setWebContents(webContents).uploadReturnCtx(ctx ? ctx.processedInput : input, true) + imgs = res ? res.output : false + } else { + imgs = await uploader.setWebContents(webContents).upload(input) + } const result = [] if (imgs !== false) { const pasteStyle = db.get(configPaths.settings.pasteStyle) || IPasteStyle.MARKDOWN @@ -140,12 +165,13 @@ export const handleSecondaryUpload = async ( webContents?: WebContents, input?: string[], uploadType: 'clipboard' | 'file' | 'tray' = 'file' -): Promise => { +): Promise<{ needRestore: boolean; ctx: IPicGo | false }> => { const enableSecondUploader = db.get(configPaths.settings.enableSecondUploader) || false let currentPicBedType = '' let currentPicBedConfig = {} as IStringKeyMap let currentPicBedConfigId = '' let needRestore = false + let ctx: IPicGo | false = false if (enableSecondUploader) { const secondUploader = db.get(configPaths.picBed.secondUploader) const secondUploaderConfig = db.get(configPaths.picBed.secondUploaderConfig) @@ -165,10 +191,11 @@ export const handleSecondaryUpload = async ( let secondImgs: ImgInfo[] | false = false changeCurrentUploader(secondUploader, secondUploaderConfig, secondUploaderId) if (uploadType === 'clipboard') { - secondImgs = await handleClipboardUploading() + ctx = await handleClipboardUploadingReturnCtx(undefined) } else { - secondImgs = await uploader.setWebContents(webContents!).upload(input) + ctx = await uploader.setWebContents(webContents!).uploadReturnCtx(input) } + secondImgs = ctx ? ctx.output : false if (secondImgs !== false) { const trayWindow = windowManager.get(IWindowList.TRAY_WINDOW) if (uploadType === 'clipboard') { @@ -196,4 +223,8 @@ export const handleSecondaryUpload = async ( if (needRestore) { changeCurrentUploader(currentPicBedType, currentPicBedConfig, currentPicBedConfigId) } + return { + needRestore, + ctx + } } diff --git a/src/main/apis/app/uploader/index.ts b/src/main/apis/app/uploader/index.ts index 103ff1f..1c917e0 100644 --- a/src/main/apis/app/uploader/index.ts +++ b/src/main/apis/app/uploader/index.ts @@ -149,6 +149,69 @@ class Uploader { } } + async uploadWithBuildInClipboardReturnCtx(img?: IUploadOption, skipProcess = false): Promise { + let filePath = '' + try { + const imgPath = getClipboardFilePath() + if (!imgPath) { + const nativeImage = clipboard.readImage() + if (nativeImage.isEmpty()) { + return false + } + const buffer = nativeImage.toPNG() + const baseDir = picgo.baseDir + const fileName = `${dayjs().format('YYYYMMDDHHmmSSS')}.png` + filePath = path.join(baseDir, CLIPBOARD_IMAGE_FOLDER, fileName) + await writeFile(filePath, buffer) + return await this.uploadReturnCtx(img ?? [filePath], skipProcess) + } else { + return await this.uploadReturnCtx(img ?? [imgPath], skipProcess) + } + } catch (e: any) { + logger.error(e) + return false + } finally { + if (filePath) { + fs.remove(filePath) + } + } + } + + async uploadReturnCtx(img?: IUploadOption, skipProcess = false): Promise { + try { + const startTime = Date.now() + const ctx = await picgo.uploadReturnCtx(img, skipProcess) + if (Array.isArray(ctx.output) && ctx.output.some((item: ImgInfo) => item.imgUrl)) { + if (this.webContents) { + handleTalkingData(this.webContents, { + fromClipboard: !img, + type: db.get(configPaths.picBed.uploader) || db.get(configPaths.picBed.current) || 'smms', + count: img ? img.length : 1, + duration: Date.now() - startTime + } as IAnalyticsData) + } + ctx.output.forEach((item: ImgInfo) => { + item.config = JSON.parse(JSON.stringify(db.get(`picBed.${item.type}`))) + }) + return ctx + } else { + return false + } + } catch (e: any) { + logger.error(e) + setTimeout(() => { + showNotification({ + title: T('UPLOAD_FAILED'), + body: util.format(e.stack), + clickToCopy: true + }) + }, 500) + return false + } finally { + ipcMain.removeAllListeners(GET_RENAME_FILE_NAME) + } + } + async upload(img?: IUploadOption): Promise { try { const startTime = Date.now() diff --git a/src/main/apis/core/datastore/index.ts b/src/main/apis/core/datastore/index.ts index bcd7a97..24ff4b7 100644 --- a/src/main/apis/core/datastore/index.ts +++ b/src/main/apis/core/datastore/index.ts @@ -35,7 +35,7 @@ class ConfigStore { if (!this.#db.has(configPaths.settings.shortKey._path)) { this.#db.set(configPaths.settings.shortKey['picgo:upload'], { enable: true, - key: 'CommandOrControl+Shift+P', + key: 'CommandOrControl+Alt+P', name: 'upload', label: T('QUICK_UPLOAD') }) diff --git a/src/main/apis/gui/index.ts b/src/main/apis/gui/index.ts index 25930bb..2d571b1 100644 --- a/src/main/apis/gui/index.ts +++ b/src/main/apis/gui/index.ts @@ -79,8 +79,14 @@ class GuiApi implements IGuiApi { this.windowId = await getWindowId() const webContents = this.getWebcontentsByWindowId(this.windowId) const rawInput = cloneDeep(input) - await handleSecondaryUpload(webContents!, input) - const imgs = await uploader.setWebContents(webContents!).upload(input) + const { needRestore, ctx } = await handleSecondaryUpload(webContents!, input) + let imgs: ImgInfo[] | false = false + if (needRestore) { + const res = await uploader.setWebContents(webContents!).uploadReturnCtx(ctx ? ctx.processedInput : input, true) + imgs = res ? res.output : false + } else { + imgs = await uploader.setWebContents(webContents!).upload(input) + } if (imgs !== false) { const pasteStyle = db.get(configPaths.settings.pasteStyle) || IPasteStyle.MARKDOWN const deleteLocalFile = db.get(configPaths.settings.deleteLocalFile) || false diff --git a/src/renderer/pages/Gallery.vue b/src/renderer/pages/Gallery.vue index 60f92da..7e6f8c0 100644 --- a/src/renderer/pages/Gallery.vue +++ b/src/renderer/pages/Gallery.vue @@ -428,9 +428,7 @@ function handleDetectShiftKey(event: KeyboardEvent) { } const filterList = computed(() => { - const start = new Date().getTime() const res = getGallery() - console.log(`filterList: ${new Date().getTime() - start}ms`) return res }) @@ -487,9 +485,7 @@ function getGallery(): IGalleryItem[] { } async function updateGallery() { - const start = new Date().getTime() images.value = (await $$db.get({ orderBy: 'desc' }))!.data - console.log(`updateGallery: ${new Date().getTime() - start}ms`) } watch( @@ -698,6 +694,9 @@ function multiRemove() { duration: multiRemoveNumber > 5 ? 1000 : 2000 }) } + } else { + files.push(file) + await $$db.removeById(key) } } } diff --git a/src/universal/types/types.d.ts b/src/universal/types/types.d.ts index 59962d6..4c185e4 100644 --- a/src/universal/types/types.d.ts +++ b/src/universal/types/types.d.ts @@ -1,538 +1,533 @@ -// global -interface IObj { - [propName: string]: any -} - -interface IObjT { - [propName: string]: T -} - -declare interface ErrnoException extends Error { - errno?: number | string; - code?: string; - path?: string; - syscall?: string; - stack?: string; -} - -declare let __static: string - -declare type ILogType = 'success' | 'info' | 'warn' | 'error' - -// Server -type routeHandler = (ctx: IServerCTX) => Promise - -type IHttpResponse = import('http').ServerResponse - -interface IServerCTX { - response: IHttpResponse - [propName: string]: any -} - -interface IServerConfig { - port: number | string - host: string - enable: boolean -} - -// Sync - -interface ISyncConfig { - type: string - file?: string - username: string - repo: string - branch: string - token: string - endpoint?: string - proxy?: string - interval?: number -} - -// Image && PicBed -interface ImgInfo { - buffer?: Buffer - base64Image?: string - fileName?: string - width?: number - height?: number - extname?: string - imgUrl?: string - id?: string - type?: string - [propName: string]: any -} - -interface IGalleryItem extends ImgInfo { - src: string - key: string - intro: string -} - -interface IPicBedType { - type: string - name: string - visible: boolean -} - -// Config Settings -interface IShortKeyConfig { - enable: boolean - key: string // 按键 - name: string - label: string - from?: string -} - -interface IPluginShortKeyConfig { - key: string - name: string - label: string - handle: IShortKeyHandler -} - -interface IShortKeyConfigs { - [propName: string]: IShortKeyConfig -} - -interface IOldShortKeyConfigs { - upload: string -} - -interface IKeyCommandType { - key: string - command: string -} - -// Main process -interface IBrowserWindowOptions { - height: number - width: number - show: boolean - fullscreenable: boolean - resizable: boolean - webPreferences: { - nodeIntegration: boolean - nodeIntegrationInWorker: boolean - contextIsolation: boolean - backgroundThrottling: boolean - webSecurity?: boolean - } - vibrancy?: string | any - frame?: boolean - center?: boolean - title?: string - titleBarStyle?: string | any - backgroundColor?: string - autoHideMenuBar?: boolean - transparent?: boolean - icon?: string - skipTaskbar?: boolean - alwaysOnTop?: boolean - [propName: string]: any -} - -interface IFileWithPath { - path: string - name?: string -} - -interface IBounds { - x: number - y: number -} - -interface ITalkingDataOptions { - EventId: string - Label?: string - MapKv?: IStringKeyMap -} - -// PicGo Types -type ICtx = import('piclist').PicGo -interface IPicGoPlugin { - name: string - fullName: string - author: string - description: string - logo: string - version: string | number - gui: boolean - config: { - plugin: IPluginMenuConfig - uploader: IPluginMenuConfig - transformer: IPluginMenuConfig - [index: string]: IPluginMenuConfig - } | { - [propName: string]: any - } - enabled?: boolean - homepage: string - guiMenu?: any[] - ing: boolean - hasInstall?: boolean - [propName: string]: any -} - -interface IPicGoPluginConfig { - name: string - type: string - required: boolean - default?: any - alias?: string - choices?: { - name?: string - value?: any - }[] - /** support markdown */ - tips?: string - [propName: string]: any -} - -interface IPicGoPluginOriginConfig { - name: string - type: string - required: boolean - default?: any - alias?: string - choices?: { - name?: string - value?: any - }[] | (() => { - name?: string - value?: any - }[]) - [propName: string]: any -} - -interface IPluginMenuConfig { - name: string - fullName?: string - config: any[] -} - -interface INPMSearchResult { - data: { - objects: INPMSearchResultObject[] - } -} - -interface INPMSearchResultObject { - package: { - name: string - scope: string - version: string - description: string - keywords: string[] - author: { - name: string - } - links: { - npm: string - homepage: string - } - } -} - -type IDispose = () => void - -// GuiApi -interface IGuiApi { - showInputBox: (options: IShowInputBoxOption) => Promise - showFileExplorer: (options: IShowFileExplorerOption) => Promise - upload: (input: IUploadOption) => Promise - showNotification: (options?: IShowNotificationOption) => void - showMessageBox: (options?: IShowMessageBoxOption) => Promise -} -interface IShowInputBoxOption { - value?: string - title: string - placeholder: string -} - -type IShowFileExplorerOption = IObj - -type IUploadOption = string[] - -interface IShowNotificationOption { - title: string - body: string - // icon?: string | import('electron').NativeImage -} - -interface IPrivateShowNotificationOption extends IShowNotificationOption{ - /** - * click notification to copy the body - */ - clickToCopy?: boolean - copyContent?: string // something to copy - clickFn?: () => void -} - -interface IShowMessageBoxOption { - title: string - message: string - type: string - buttons: string[] -} - -interface IShowMessageBoxResult { - result: number - checkboxChecked: boolean -} - -interface IShortKeyHandlerObj { - handle: IShortKeyHandler - key: string - label: string -} - -type IShortKeyHandler = (ctx: ICtx, guiApi?: IGuiApi) => Promise - -type PartialKeys = Omit & Partial> - -interface shortKeyHandlerMap { - from: string - handle: IShortKeyHandler -} - -// PicBeds -interface ITelegraphConfig { - proxy?: string -} - -interface ILocalConfig { - path: string - customUrl?: string - webPath?: string -} - -interface IAliYunConfig { - accessKeyId: string - accessKeySecret: string - bucket: string - area: string - path: string - customUrl: string - options: string -} - -interface IGitHubConfig { - repo: string - token: string - path: string - customUrl: string - branch: string -} - -interface IImgurConfig { - clientId: string - proxy: string - username: string - accessToken: string - album: string -} - -interface IQiniuConfig { - accessKey: string - secretKey: string - bucket: string - url: string - area: 'z0' | 'z1' | 'z2' | 'na0' | 'as0' | string - options: string - path: string -} - -interface ISMMSConfig { - token: string - backupDomain?: string -} - -interface ITcYunConfig { - secretId: string - secretKey: string - bucket: string - appId: string - endpoint: string - area: string - path: string - customUrl: string - version: 'v4' | 'v5' - options: string - slim: boolean -} - -interface IUpYunConfig { - bucket: string - operator: string - password: string - options: string - path: string - url: string - antiLeechToken: string - expireTime: number - endpoint: string -} - -interface IWebdavPlistConfig { - host: string - sslEnabled: boolean - username: string - password: string - path: string - webpath: string - customUrl: string - authType: string - options: string -} - -interface ISftpPlistConfig { - host: string - port?: number - username: string - password?: string - privateKey?: string - passphrase?: string - uploadPath?: string - customUrl?: string - webPath?: string - fileUser?: string - fileMode?: string - dirMode?: string -} - -interface IPicListConfig { - host: string - port?: number - picbed?: string - configName?: string - serverKey?: string -} - -interface ILskyConfig { - version: string - host: string - token: string - strategyId: string - albumId: string - permission: IStringKeyMap -} - -interface IAwsS3PListUserConfig { - accessKeyID: string - secretAccessKey: string - bucketName: string - uploadPath: string - region?: string - endpoint?: string - proxy?: string - urlPrefix?: string - pathStyleAccess?: boolean - rejectUnauthorized?: boolean - acl?: string - disableBucketPrefixToURL?: boolean | string -} - -type ILoggerType = string | Error | boolean | number | undefined - -interface IAppNotification { - title: string - body: string - icon?: string -} - -interface IAnalyticsData { - fromClipboard: boolean - type: string - count: number - duration?: number // 耗时 -} - -interface IStringKeyMap { - [propName: string]: any -} - -type ILogArgvType = string | number - -type ILogArgvTypeWithError = ILogArgvType | Error - -interface IMiniWindowPos { - x: number - y: number - height: number - width: number -} - -type PromiseResType = T extends Promise ? R : T - -// type ILocalesKey = import('#/i18n/zh-CN').ILocalesKey - -interface II18nItem { - label: string - value: string -} - -interface IRemoteNotice { - version: number - list: Array<{ - versions: string[] // matched picgo version - actions: IRemoteNoticeAction[] - versionMatch?: 'exact' | 'gte' | 'lte' - }> -} - -interface IRemoteNoticeAction { - type: import('#/types/enum').IRemoteNoticeActionType - // trigger time - hooks: import('#/types/enum').IRemoteNoticeTriggerHook[] - id: string - // trigger count: always or once; default: once - triggerCount: import('#/types/enum').IRemoteNoticeTriggerCount - - data?: { - title?: string - content?: string - desc?: string // action desc - buttons?: IRemoteNoticeButton[] - url?: string - copyToClipboard?: string - options: any // for other case - } -} - -interface IRemoteNoticeButton { - label: string - labelEN?: string - type: 'confirm' | 'cancel' | 'other' - action: IRemoteNoticeAction -} - -interface IRemoteNoticeLocalCountStorage { - [id: string]: true | number -} - -interface IUploaderListItemMetaInfo { - _id: string - _configName: string - _updatedAt: number - _createdAt: number -} - -interface IUploaderConfig { - [picBedType: string]: IUploaderConfigItem -} - -interface IUploaderConfigItem { - configList: IUploaderConfigListItem[] - defaultId: string -} - -type IUploaderConfigListItem = IStringKeyMap & IUploaderListItemMetaInfo - -type ICheckBoxValueType = boolean | string | number - -interface IHTTPProxy { - host: string - port: number - protocol: string +// global +interface IObj { + [propName: string]: any +} + +interface IObjT { + [propName: string]: T +} + +declare interface ErrnoException extends Error { + errno?: number | string; + code?: string; + path?: string; + syscall?: string; + stack?: string; +} + +declare let __static: string + +declare type ILogType = 'success' | 'info' | 'warn' | 'error' + +// Server +type routeHandler = (ctx: IServerCTX) => Promise + +type IHttpResponse = import('http').ServerResponse + +interface IServerCTX { + response: IHttpResponse + [propName: string]: any +} + +interface IServerConfig { + port: number | string + host: string + enable: boolean +} + +// Sync + +interface ISyncConfig { + type: string + file?: string + username: string + repo: string + branch: string + token: string + endpoint?: string + proxy?: string + interval?: number +} + +// Image && PicBed +interface ImgInfo { + buffer?: Buffer + base64Image?: string + fileName?: string + width?: number + height?: number + extname?: string + imgUrl?: string + id?: string + type?: string + [propName: string]: any +} + +interface IGalleryItem extends ImgInfo { + src: string + key: string + intro: string +} + +interface IPicBedType { + type: string + name: string + visible: boolean +} + +// Config Settings +interface IShortKeyConfig { + enable: boolean + key: string // 按键 + name: string + label: string + from?: string +} + +interface IPluginShortKeyConfig { + key: string + name: string + label: string + handle: IShortKeyHandler +} + +interface IShortKeyConfigs { + [propName: string]: IShortKeyConfig +} + +interface IOldShortKeyConfigs { + upload: string +} + +interface IKeyCommandType { + key: string + command: string +} + +// Main process +interface IBrowserWindowOptions { + height: number + width: number + show: boolean + fullscreenable: boolean + resizable: boolean + webPreferences: { + nodeIntegration: boolean + nodeIntegrationInWorker: boolean + contextIsolation: boolean + backgroundThrottling: boolean + webSecurity?: boolean + } + vibrancy?: string | any + frame?: boolean + center?: boolean + title?: string + titleBarStyle?: string | any + backgroundColor?: string + autoHideMenuBar?: boolean + transparent?: boolean + icon?: string + skipTaskbar?: boolean + alwaysOnTop?: boolean + [propName: string]: any +} + +interface IFileWithPath { + path: string + name?: string +} + +interface IBounds { + x: number + y: number +} + +interface ITalkingDataOptions { + EventId: string + Label?: string + MapKv?: IStringKeyMap +} + +// PicGo Types +type ICtx = import('piclist').PicGo +interface IPicGoPlugin { + name: string + fullName: string + author: string + description: string + logo: string + version: string | number + gui: boolean + config: { + plugin: IPluginMenuConfig + uploader: IPluginMenuConfig + transformer: IPluginMenuConfig + [index: string]: IPluginMenuConfig + } | { + [propName: string]: any + } + enabled?: boolean + homepage: string + guiMenu?: any[] + ing: boolean + hasInstall?: boolean + [propName: string]: any +} + +interface IPicGoPluginConfig { + name: string + type: string + required: boolean + default?: any + alias?: string + choices?: { + name?: string + value?: any + }[] + /** support markdown */ + tips?: string + [propName: string]: any +} + +interface IPicGoPluginOriginConfig { + name: string + type: string + required: boolean + default?: any + alias?: string + choices?: { + name?: string + value?: any + }[] | (() => { + name?: string + value?: any + }[]) + [propName: string]: any +} + +interface IPluginMenuConfig { + name: string + fullName?: string + config: any[] +} + +interface INPMSearchResult { + data: { + objects: INPMSearchResultObject[] + } +} + +interface INPMSearchResultObject { + package: { + name: string + scope: string + version: string + description: string + keywords: string[] + author: { + name: string + } + links: { + npm: string + homepage: string + } + } +} + +type IDispose = () => void + +// GuiApi +interface IGuiApi { + showInputBox: (options: IShowInputBoxOption) => Promise + showFileExplorer: (options: IShowFileExplorerOption) => Promise + upload: (input: IUploadOption) => Promise + showNotification: (options?: IShowNotificationOption) => void + showMessageBox: (options?: IShowMessageBoxOption) => Promise +} +interface IShowInputBoxOption { + value?: string + title: string + placeholder: string +} + +type IShowFileExplorerOption = IObj + +type IUploadOption = string[] + +interface IShowNotificationOption { + title: string + body: string + // icon?: string | import('electron').NativeImage +} + +interface IPrivateShowNotificationOption extends IShowNotificationOption{ + /** + * click notification to copy the body + */ + clickToCopy?: boolean + copyContent?: string // something to copy + clickFn?: () => void +} + +interface IShowMessageBoxOption { + title: string + message: string + type: string + buttons: string[] +} + +interface IShowMessageBoxResult { + result: number + checkboxChecked: boolean +} + +interface IShortKeyHandlerObj { + handle: IShortKeyHandler + key: string + label: string +} + +type IShortKeyHandler = (ctx: ICtx, guiApi?: IGuiApi) => Promise + +type PartialKeys = Omit & Partial> + +interface shortKeyHandlerMap { + from: string + handle: IShortKeyHandler +} + +interface ILocalConfig { + path: string + customUrl?: string + webPath?: string +} + +interface IAliYunConfig { + accessKeyId: string + accessKeySecret: string + bucket: string + area: string + path: string + customUrl: string + options: string +} + +interface IGitHubConfig { + repo: string + token: string + path: string + customUrl: string + branch: string +} + +interface IImgurConfig { + clientId: string + proxy: string + username: string + accessToken: string + album: string +} + +interface IQiniuConfig { + accessKey: string + secretKey: string + bucket: string + url: string + area: 'z0' | 'z1' | 'z2' | 'na0' | 'as0' | string + options: string + path: string +} + +interface ISMMSConfig { + token: string + backupDomain?: string +} + +interface ITcYunConfig { + secretId: string + secretKey: string + bucket: string + appId: string + endpoint: string + area: string + path: string + customUrl: string + version: 'v4' | 'v5' + options: string + slim: boolean +} + +interface IUpYunConfig { + bucket: string + operator: string + password: string + options: string + path: string + url: string + antiLeechToken: string + expireTime: number + endpoint: string +} + +interface IWebdavPlistConfig { + host: string + sslEnabled: boolean + username: string + password: string + path: string + webpath: string + customUrl: string + authType: string + options: string +} + +interface ISftpPlistConfig { + host: string + port?: number + username: string + password?: string + privateKey?: string + passphrase?: string + uploadPath?: string + customUrl?: string + webPath?: string + fileUser?: string + fileMode?: string + dirMode?: string +} + +interface IPicListConfig { + host: string + port?: number + picbed?: string + configName?: string + serverKey?: string +} + +interface ILskyConfig { + version: string + host: string + token: string + strategyId: string + albumId: string + permission: IStringKeyMap +} + +interface IAwsS3PListUserConfig { + accessKeyID: string + secretAccessKey: string + bucketName: string + uploadPath: string + region?: string + endpoint?: string + proxy?: string + urlPrefix?: string + pathStyleAccess?: boolean + rejectUnauthorized?: boolean + acl?: string + disableBucketPrefixToURL?: boolean | string +} + +type ILoggerType = string | Error | boolean | number | undefined + +interface IAppNotification { + title: string + body: string + icon?: string +} + +interface IAnalyticsData { + fromClipboard: boolean + type: string + count: number + duration?: number // 耗时 +} + +interface IStringKeyMap { + [propName: string]: any +} + +type ILogArgvType = string | number + +type ILogArgvTypeWithError = ILogArgvType | Error + +interface IMiniWindowPos { + x: number + y: number + height: number + width: number +} + +type PromiseResType = T extends Promise ? R : T + +// type ILocalesKey = import('#/i18n/zh-CN').ILocalesKey + +interface II18nItem { + label: string + value: string +} + +interface IRemoteNotice { + version: number + list: Array<{ + versions: string[] // matched picgo version + actions: IRemoteNoticeAction[] + versionMatch?: 'exact' | 'gte' | 'lte' + }> +} + +interface IRemoteNoticeAction { + type: import('#/types/enum').IRemoteNoticeActionType + // trigger time + hooks: import('#/types/enum').IRemoteNoticeTriggerHook[] + id: string + // trigger count: always or once; default: once + triggerCount: import('#/types/enum').IRemoteNoticeTriggerCount + + data?: { + title?: string + content?: string + desc?: string // action desc + buttons?: IRemoteNoticeButton[] + url?: string + copyToClipboard?: string + options: any // for other case + } +} + +interface IRemoteNoticeButton { + label: string + labelEN?: string + type: 'confirm' | 'cancel' | 'other' + action: IRemoteNoticeAction +} + +interface IRemoteNoticeLocalCountStorage { + [id: string]: true | number +} + +interface IUploaderListItemMetaInfo { + _id: string + _configName: string + _updatedAt: number + _createdAt: number +} + +interface IUploaderConfig { + [picBedType: string]: IUploaderConfigItem +} + +interface IUploaderConfigItem { + configList: IUploaderConfigListItem[] + defaultId: string +} + +type IUploaderConfigListItem = IStringKeyMap & IUploaderListItemMetaInfo + +type ICheckBoxValueType = boolean | string | number + +interface IHTTPProxy { + host: string + port: number + protocol: string } \ No newline at end of file diff --git a/src/universal/utils/configPaths.ts b/src/universal/utils/configPaths.ts index 64cbb9d..6f693ec 100644 --- a/src/universal/utils/configPaths.ts +++ b/src/universal/utils/configPaths.ts @@ -25,7 +25,6 @@ export interface IConfigStruct { webdavplist?: IWebdavPlistConfig local?: ILocalConfig sftpplist?: ISftpPlistConfig - telegraphplist?: ITelegraphConfig lskyplist?: ILskyConfig 'aws-s3-plist': IAwsS3PListUserConfig proxy?: string diff --git a/src/universal/utils/static.ts b/src/universal/utils/static.ts index ab392f8..e5f7445 100644 --- a/src/universal/utils/static.ts +++ b/src/universal/utils/static.ts @@ -47,7 +47,6 @@ export const picBedManualUrlList: IStringKeyMap = { qiniu: 'https://piclist.cn/configure.html#%E4%B8%83%E7%89%9B%E4%BA%91', sftpplist: 'https://piclist.cn/configure.html#%E5%86%85%E7%BD%AEsftp', smms: 'https://piclist.cn/configure.html#sm-ms', - telegraphplist: 'https://piclist.cn/configure.html#telegra-ph', upyun: 'https://piclist.cn/configure.html#%E5%8F%88%E6%8B%8D%E4%BA%91', webdavplist: 'https://piclist.cn/configure.html#webdav' }, @@ -68,7 +67,6 @@ export const picBedManualUrlList: IStringKeyMap = { qiniu: 'https://piclist.cn/en/configure.html#qiniu-cloud', sftpplist: 'https://piclist.cn/en/configure.html#built-in-sftp', smms: 'https://piclist.cn/en/configure.html#sm-ms', - telegraphplist: 'https://piclist.cn/en/configure.html#telegra-ph', upyun: 'https://piclist.cn/en/configure.html#upyun', webdavplist: 'https://piclist.cn/en/configure.html#webdav' } diff --git a/yarn.lock b/yarn.lock index c87a922..facd982 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11956,10 +11956,10 @@ performance-now@^2.1.0: resolved "https://registry.npmmirror.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== -piclist@^1.9.3: - version "1.9.3" - resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.9.3.tgz#3aa769237935a70fdb786a46f5ed46b762e38dd9" - integrity sha512-nWorUUyBmDJ6ZtHXHVa1dn4PHiKjION9izdj+xcgGkwgQj4xegKWLsivEgdMEV8e+iuulO6e+n1+pQcqOqqasg== +piclist@^1.9.6: + version "1.9.6" + resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.9.6.tgz#010753f7b7cedc076251bd1639f7859e48508386" + integrity sha512-CAUbU43/eibk/Jq+SXPL96TXog1vNjpE1pwbsof+D8A8SEpXRg+K5cLAsRjGXubi/SmLonU+imtbldUNuCoHjA== dependencies: "@aws-sdk/client-s3" "3.421.0" "@aws-sdk/lib-storage" "3.421.0"