diff --git a/CHANGELOG.md b/CHANGELOG.md index d9fe3bee..73484c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,32 @@ +## :tada: 2.7.1 (2024-01-15) + + +### :sparkles: Features + +* **custom:** add manual page open setting ([e4f957d](https://github.com/Kuingsmile/piclist/commit/e4f957d)) +* **custom:** add new option to open download page when new version available ([bbbfbda](https://github.com/Kuingsmile/piclist/commit/bbbfbda)), closes [#128](https://github.com/Kuingsmile/piclist/issues/128) +* **custom:** add options setting for webdav ([2dde06d](https://github.com/Kuingsmile/piclist/commit/2dde06d)), closes [#131](https://github.com/Kuingsmile/piclist/issues/131) +* **custom:** add support for lskypro uploader ([531b387](https://github.com/Kuingsmile/piclist/commit/531b387)) +* **custom:** enable mozJPEG encoder by default ([98abeaa](https://github.com/Kuingsmile/piclist/commit/98abeaa)) +* **custom:** manual url will be based on lanaguage setting ([9338fc6](https://github.com/Kuingsmile/piclist/commit/9338fc6)) +* **custom:** support build-in lsky sync delete ([4c03260](https://github.com/Kuingsmile/piclist/commit/4c03260)) +* **custom:** support specific format option for image conversion ([9083a1c](https://github.com/Kuingsmile/piclist/commit/9083a1c)), closes [#124](https://github.com/Kuingsmile/piclist/issues/124) + + +### :bug: Bug Fixes + +* **custom:** fix i18n error ([2a8c435](https://github.com/Kuingsmile/piclist/commit/2a8c435)) +* **custom:** fix sftp upload error when file name is the same ([269a7bf](https://github.com/Kuingsmile/piclist/commit/269a7bf)), closes [#129](https://github.com/Kuingsmile/piclist/issues/129) + + +### :pencil: Documentation + +* **custom:** update docs ([7055f5b](https://github.com/Kuingsmile/piclist/commit/7055f5b)) +* **custom:** update FAQ ([fc0ac6c](https://github.com/Kuingsmile/piclist/commit/fc0ac6c)) +* **custom:** update new version changelog ([3e09dc4](https://github.com/Kuingsmile/piclist/commit/3e09dc4)) + + + # :tada: 2.7.0 (2023-12-28) diff --git a/FAQ.md b/FAQ.md index ef758d97..8e31b5ab 100644 --- a/FAQ.md +++ b/FAQ.md @@ -10,7 +10,7 @@ PicList项目fork自PicGo项目,基于PicGo进行了二次开发,同时核心功能内核PicGo-Core也进行了二次开发,重命名为[PicList-Core](https://github.com/Kuingsmile/PicList-Core)。 -PicList所有新功能的添加没有影响到PicGo的原有功能,所以你可以在PicList中使用PicGo的所有插件。同时仍然可以配合typora、obsidian等软件进行使用。 +PicList所有新功能的添加没有影响到PicGo的原有功能,所以你可以在PicList中使用PicGo的大部分插件。同时仍然可以配合typora、obsidian等软件进行使用。 ## 2. 使用图床管理功能时,出现无法获取目录等错误 @@ -34,6 +34,7 @@ PicList所有新功能的添加没有影响到PicGo的原有功能,所以你 - 多吉云 - 华为云 OBS - Alist +- 兰空图床 ## 4. 能否支持上传视频文件 @@ -53,6 +54,9 @@ PicList本体支持了如下图床: - `Webdav` - `本地图床` - `SFTP` +- `Telegra.ph` +- `兰空图床` +- `PicList(套娃)` PicList计划整合和优化现有插件,内置更多的常用图床。 diff --git a/FAQ_EN.md b/FAQ_EN.md index 0a063409..618ea53c 100644 --- a/FAQ_EN.md +++ b/FAQ_EN.md @@ -34,6 +34,7 @@ Currently, the supported image hosting platforms are: - Doge Cloud - Huawei Cloud OBS - Alist +- Lsky Pro ## 4. Is it possible to upload video files? @@ -53,6 +54,9 @@ PicList itself supports the following image hosting platforms: - Webdav - Local path - SFTP +- Telegra.ph +- Lsky Pro +- PicList (nested) PicList plans to integrate and optimize existing plugins and embed more commonly used image hosting platforms. diff --git a/README.md b/README.md index d63b9d00..ec9bfe8a 100644 --- a/README.md +++ b/README.md @@ -34,12 +34,12 @@ 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, 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 and Telegra.ph. 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. - Upload interface supports form upload files, can be shared by multiple computers -- Configuration can be synchronized to Github or Gitee repositories. +- Configuration can be synchronized to Github/Gitee/Gitea repositories. - Manages over ten types of image hosting platforms, allowing online viewing of cloud directories, file searching, batch uploading, batch downloading, file deletion, and more. - Support previewing multiple formats of files, including pictures, videos, plain text files and markdown files, etc. For the specific formats supported, please refer to [Supported file format list](https://github.com/Kuingsmile/PicList/blob/dev/supported_format.md) - Supports the use of regular expressions for batch renaming of cloud files. @@ -60,7 +60,7 @@ Please install my matching plugin [VS-PicList](https://marketplace.visualstudio. **Typora 1.6.0-dev and above versions now support PicList natively** -Now you need to set the upload service PicList and PicGo (app) to the installation path of PicList at the same time, which may be due to a bug in Typora. +Now you need to set the upload service PicList and PicGo (app) to the installation path of PicList at the same time, it has been fixed in latest dev version. [download link](https://typora.io/releases/all) @@ -148,6 +148,8 @@ docker-compose up -d | Built-in SFTP | ✔️ | ✔️ | | Doge Cloud | ✔️ | ✔️ | | PicList(Lasso-Doll) | ✔️ | ✔️ | +| Telegra.ph | ✔️ | × | +| Lsky Pro | ✔️ | ✔️ | | Plugin | Album cloud deletion | | :----------------------------------------------------------------------------------------: | :------------------: | diff --git a/README_cn.md b/README_cn.md index a87fcdb4..092e8587 100644 --- a/README_cn.md +++ b/README_cn.md @@ -34,12 +34,12 @@ PicList的内核使用的是原版PicGo-Core基础上修改的[PicList-core](htt ## 特色功能 - 保留了PicGo的所有功能,兼容绝大部分已有的PicGo插件,包括和Typora、Obsidian等软件的搭配 -- 新增了多个内置图床,如WebDav、本地图床、SFTP和Telegra.ph等,原内置imgur图床额外支持登录账号上传 +- 新增了多个内置图床,如WebDav、兰空图床、本地图床、SFTP和Telegra.ph等,原内置imgur图床额外支持登录账号上传 - 相册中可同步删除云端图片,支持所有内置图床和多个插件 - 相册新增了高级搜索和排序,批量修改URL等功能 - 内置水印添加、图片压缩、图片缩放、图片旋转和图片格式转换等功能,同时支持高级重命名 - 上传接口支持表单上传文件,可多电脑共用 -- 支持配置同步至Github或Gitee仓库 +- 支持配置同步至Github/Gitee/Gitea仓库 - 支持管理十余种图床,可以在线进行云端目录查看、文件搜索、批量上传、批量下载、删除文件等 - 支持预览多种格式的文件,包括图片、视频、纯文本文件和markdown文件等,具体支持的格式请参考[支持的文件格式列表](https://github.com/Kuingsmile/PicList/blob/dev/supported_format.md) - 支持启用正则表达式的批量云端文件重命名 @@ -60,7 +60,7 @@ PicList的内核使用的是原版PicGo-Core基础上修改的[PicList-core](htt **Typora 1.6.0-dev以及以上版本现在已经原生支持PicList了** -目前Typora中需要同时设置上传服务PicList和PicGo(app)的路径为PicList的安装路径,这可能源于Typora的bug。 +目前Typora中需要同时设置上传服务PicList和PicGo(app)的路径为PicList的安装路径,已经在最新的Dev版本中修复。 [下载地址](https://typora.io/releases/all) @@ -148,6 +148,8 @@ docker-compose up -d | 内置SFTP | ✔️ | ✔️ | | 多吉云 | ✔️ | ✔️ | | PicList(套娃) | ✔️ | ✔️ | +| Telegra.ph | ✔️ | x | +| 兰空图床 | ✔️ | ✔️ | | 插件 | 相册云删除 | | :----------------------------------------------------------------------------------------: | :--------: | diff --git a/currentVersion.md b/currentVersion.md index ed5d7872..3572b8a5 100644 --- a/currentVersion.md +++ b/currentVersion.md @@ -1,16 +1,15 @@ -Happy New Year! 🎉 - ✨ Features -- 现在移除exif信息选项不再错误的处理svg图片 -- 添加了管理功能log文件和软件GUI界面log文件的快捷打开选项 -- 现在支持更多类型的文本文件预览 -- 现在移除配置前会进行额外的确认以避免误删除 -- 现在如果对应图床不支持重命名操作,不会再显示重命名按钮 -- 优化了管理界面文件浏览页的文字显示 -- 移除了赞助窗口~~ +- 新增内置兰空图床上传和删除支持 +- Webdav图床现在支持设置URL参数后缀 +- 现在支持指定每种图片格式对应的转换后格式 +- 现在默认启用mozJPEG编码器以减小文件体积 +- 现在打开手册页面会询问打开方式 +- 优化了重命名选项的提示 +- 更新提示窗口现在提供跳转至版本发布页手动下载的选项 🐛 Bug Fixes -- 修复了表单上传模式下,中文文件名乱码的问题 -- 修复了管理界面入口页的显示bug \ No newline at end of file +- 修复了sftp图床上传相同文件名的图片会报错的问题 +- 修复了imgur图床转换格式为webp时,文件名错误的问题 +- 修复了部分i18n错误的问题 \ No newline at end of file diff --git a/currentVersion_en.md b/currentVersion_en.md index 4c075f49..e5efbcf0 100644 --- a/currentVersion_en.md +++ b/currentVersion_en.md @@ -1,16 +1,15 @@ -Happy New Year! 🎉 - ✨ Features -- Now the option to remove exif information will no longer incorrectly process svg images -- Added a shortcut to open the log file of the management function and the GUI interface log file -- Now supports more types of text file preview -- Now there will be extra confirmation before removing the configuration to avoid accidental deletion -- Now if the corresponding image bed does not support the rename operation, the rename button will not be displayed -- Optimized the text display of the file browsing page of the management interface -- Removed the sponsorship window~~ +- Add built-in Lsky Pro image bed upload and delete support +- Webdav image bed now supports setting URL parameter suffix +- Now you can specify the converted format for each image format +- Now enable the mozJPEG encoder by default to reduce file size +- Now the open manual page will ask for the open method +- Optimize the prompt of the rename option +- The update prompt window now provides an option to jump to the version release page to download manually 🐛 Bug Fixes -- Fixed the problem of garbled Chinese file names in form upload mode -- Fixed the display bug of the management interface entry page +- Fixed the problem that uploading images with the same file name to the sftp image bed will report an error +- Fixed the problem that the file name is incorrect when converting the format of the imgur image bed to webp +- Fixed some i18n errors diff --git a/package.json b/package.json index c7116904..c0462f59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "piclist", - "version": "2.7.0", + "version": "2.7.1", "author": { "name": "Kuingsmile", "email": "pkukuing@gmail.com" @@ -68,7 +68,7 @@ "multer": "^1.4.5-lts.1", "node-ssh-no-cpu-features": "^1.0.1", "nodejs-file-downloader": "^4.12.1", - "piclist": "^1.7.0", + "piclist": "^1.7.6", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.0", "proxy-agent": "^5.0.0", diff --git a/public/i18n/en.yml b/public/i18n/en.yml index abc09164..eaaf774d 100644 --- a/public/i18n/en.yml +++ b/public/i18n/en.yml @@ -50,6 +50,11 @@ TOOLBOX_CHECK_PROXY_PROXY_IS_NOT_WORKING: Proxy settings unavailable TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_TIPS: "The temporary folder path for clipboard pictures is: ${path}" TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_NOT_EXIST_TIPS: "The temporary folder for clipboard pictures does not exist: ${path}" TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_ERROR_TIPS: "Please create the folder yourself: ${path}" +MANUAL_PAGE_OPEN_TIP: Please select the way to open the manual +MANUAL_PAGE_OPEN_TIP_TITLE: Tips +MANUAL_PAGE_OPEN_BY_BROWSER: Browser +MANUAL_PAGE_OPEN_BY_BUILD_IN: Built-in +MANUAL_PAGE_OPEN_SETTING_TIP: Select the way to open the manual # ---renderer i18n begin--- @@ -115,6 +120,7 @@ UPLOAD_PAGE_IMAGE_PROCESS_ISREMOVEEXIF: Remove EXIF Info UPLOAD_PAGE_IMAGE_PROCESS_QUALITY: Compression Quality UPLOAD_PAGE_IMAGE_PROCESS_ISCONVERT: Convert Format UPLOAD_PAGE_IMAGE_PROCESS_CONVERTFORMAT: Destination Format +UPLOAD_PAGE_IMAGE_PROCESS_CONVERTFORMAT_SPECIFIC: 'Specific Format, Please enter in json format, e.g. {"png": "jpg"}' UPLOAD_PAGE_IMAGE_PROCESS_ISFLIP: Whether to flip vertically UPLOAD_PAGE_IMAGE_PROCESS_ISFLOP: Whether to flip horizontally UPLOAD_PAGE_IMAGE_PROCESS_ISRESIZE: Resize to fixed size @@ -169,7 +175,7 @@ SETTINGS_CLOSE_MINI_WINDOW_SYNC: Close Mini Window When open Main Window SETTINGS_CLOSE_MAIN_WINDOW_SYNC: Close Main Window When open Mini Window SETTINGS_ACCEPT_BETA_UPDATE: Accept Beta Update SETTINGS_LAUNCH_ON_BOOT: Launch On Boot -SETTINGS_RENAME_BEFORE_UPLOAD: Rename Before Upload +SETTINGS_RENAME_BEFORE_UPLOAD: Manual Rename SETTINGS_TIMESTAMP_RENAME: Timestamp Rename SETTINGS_ADVANCED_RENAME: Advanced Rename SETTINGS_ADVANCED_RENAME_ENABLE: Enable Advanced Rename diff --git a/public/i18n/zh-CN.yml b/public/i18n/zh-CN.yml index 6ae07beb..7cb81ebd 100644 --- a/public/i18n/zh-CN.yml +++ b/public/i18n/zh-CN.yml @@ -50,6 +50,11 @@ TOOLBOX_CHECK_PROXY_PROXY_IS_NOT_WORKING: 代理设置不可用 TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_TIPS: 剪贴板图片临时文件夹路径是:${path} TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_NOT_EXIST_TIPS: 剪贴板图片临时文件夹不存在:${path} TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_ERROR_TIPS: 请自行创建文件夹:${path} +MANUAL_PAGE_OPEN_TIP: 请选择打开方式 +MANUAL_PAGE_OPEN_TIP_TITLE: Tips +MANUAL_PAGE_OPEN_BY_BROWSER: 浏览器 +MANUAL_PAGE_OPEN_BY_BUILD_IN: 内置 +MANUAL_PAGE_OPEN_SETTING_TIP: 选择手册打开方式 # ---renderer i18n begin--- @@ -115,6 +120,7 @@ UPLOAD_PAGE_IMAGE_PROCESS_ISREMOVEEXIF: 是否移除EXIF信息 UPLOAD_PAGE_IMAGE_PROCESS_QUALITY: 压缩质量 UPLOAD_PAGE_IMAGE_PROCESS_ISCONVERT: 是否转换格式 UPLOAD_PAGE_IMAGE_PROCESS_CONVERTFORMAT: 转换目的格式 +UPLOAD_PAGE_IMAGE_PROCESS_CONVERTFORMAT_SPECIFIC: '精细化转换格式, 请输入JSON格式,如: {"png": "jpg"}' UPLOAD_PAGE_IMAGE_PROCESS_ISFLIP: 是否进行垂直翻转 UPLOAD_PAGE_IMAGE_PROCESS_ISFLOP: 是否进行水平翻转 UPLOAD_PAGE_IMAGE_PROCESS_ISRESIZE: 是否按固定尺寸调整图片 @@ -171,7 +177,7 @@ SETTINGS_CLOSE_MINI_WINDOW_SYNC: 打开主窗口时关闭mini窗口 SETTINGS_CLOSE_MAIN_WINDOW_SYNC: 打开mini窗口时关闭主窗口 SETTINGS_ACCEPT_BETA_UPDATE: 接受Beta版本更新 SETTINGS_LAUNCH_ON_BOOT: 开机自启 -SETTINGS_RENAME_BEFORE_UPLOAD: 上传前重命名 +SETTINGS_RENAME_BEFORE_UPLOAD: 手动重命名 SETTINGS_TIMESTAMP_RENAME: 时间戳重命名 SETTINGS_ADVANCED_RENAME: 高级重命名 SETTINGS_ADVANCED_RENAME_ENABLE: 开启高级重命名 diff --git a/public/i18n/zh-TW.yml b/public/i18n/zh-TW.yml index 28c58cb0..48c8efd9 100644 --- a/public/i18n/zh-TW.yml +++ b/public/i18n/zh-TW.yml @@ -50,6 +50,11 @@ TOOLBOX_CHECK_PROXY_PROXY_IS_NOT_WORKING: 代理設置不可用 TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_TIPS: 剪貼板圖片臨時文件夾路徑是:${path} TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_NOT_EXIST_TIPS: 剪貼板圖片臨時文件夾不存在:${path} TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_ERROR_TIPS: 請自行創建文件夾:${path} +MANUAL_PAGE_OPEN_TIP: 請選擇打開方式 +MANUAL_PAGE_OPEN_TIP_TITLE: Tips +MANUAL_PAGE_OPEN_BY_BROWSER: 瀏覽器 +MANUAL_PAGE_OPEN_BY_BUILD_IN: 內置 +MANUAL_PAGE_OPEN_SETTING_TIP: 選擇打開手冊方式 # ---renderer i18n begin--- @@ -115,6 +120,7 @@ UPLOAD_PAGE_IMAGE_PROCESS_ISREMOVEEXIF: 是否移除EXIF信息 UPLOAD_PAGE_IMAGE_PROCESS_QUALITY: 壓縮質量 UPLOAD_PAGE_IMAGE_PROCESS_ISCONVERT: 是否轉換格式 UPLOAD_PAGE_IMAGE_PROCESS_CONVERTFORMAT: 轉換目的格式 +UPLOAD_PAGE_IMAGE_PROCESS_CONVERTFORMAT_SPECIFIC: '指定格式, 请输入JSON格式配置,如{"jpg":"png"}' UPLOAD_PAGE_IMAGE_PROCESS_ISFLIP: 是否進行垂直翻轉 UPLOAD_PAGE_IMAGE_PROCESS_ISFLOP: 是否進行水平翻轉 UPLOAD_PAGE_IMAGE_PROCESS_ISRESIZE: 是否按固定尺寸調整圖片 @@ -169,7 +175,7 @@ SETTINGS_CLOSE_MINI_WINDOW_SYNC: 開主窗口同步關閉mini窗口 SETTINGS_CLOSE_MAIN_WINDOW_SYNC: 關mini窗口同步關閉主窗口 SETTINGS_ACCEPT_BETA_UPDATE: 接受Beta版本更新 SETTINGS_LAUNCH_ON_BOOT: 開機時啟動 -SETTINGS_RENAME_BEFORE_UPLOAD: 上傳前重新命名 +SETTINGS_RENAME_BEFORE_UPLOAD: 手动重新命名 SETTINGS_TIMESTAMP_RENAME: 以時間戳命名 SETTINGS_ADVANCED_RENAME: 高級命名 SETTINGS_ADVANCED_RENAME_ENABLE: 啟用高級命名 diff --git a/src/main.ts b/src/main.ts index 75c620a4..a35d890f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -55,7 +55,10 @@ app.config.globalProperties.$builtInPicBed = [ 'github', 'webdavplist', 'local', - 'sftpplist' + 'sftpplist', + 'telegraphplist', + 'piclist', + 'lskyplist' ] app.config.globalProperties.$$db = db diff --git a/src/main/lifeCycle/index.ts b/src/main/lifeCycle/index.ts index 5cb796af..b0450980 100644 --- a/src/main/lifeCycle/index.ts +++ b/src/main/lifeCycle/index.ts @@ -5,7 +5,8 @@ import { protocol, Notification, dialog, - screen + screen, + shell } from 'electron' import { createProtocol @@ -84,7 +85,7 @@ autoUpdater.on('update-available', async (info: UpdateInfo) => { dialog.showMessageBox({ type: 'info', title: T('FIND_NEW_VERSION'), - buttons: ['Yes', 'No'], + buttons: ['Yes', 'Go to download page'], message: T('TIPS_FIND_NEW_VERSION', { v: info.version }) + '\n\n' + updateLog, @@ -93,6 +94,8 @@ autoUpdater.on('update-available', async (info: UpdateInfo) => { }).then((result) => { if (result.response === 0) { autoUpdater.downloadUpdate() + } else { + shell.openExternal('https://github.com/Kuingsmile/PicList/releases/latest') } db.set('settings.showUpdateTip', !result.checkboxChecked) }).catch((err) => { diff --git a/src/main/server/index.ts b/src/main/server/index.ts index 5af763d0..d092d6f9 100644 --- a/src/main/server/index.ts +++ b/src/main/server/index.ts @@ -23,14 +23,12 @@ const multerStorage = multer.diskStorage({ cb(null, serverTempDir) }, filename: function (_req: any, file: { originalname: any }, cb: (arg0: null, arg1: any) => void) { - console.log(file.originalname) // eslint-disable-next-line no-control-regex if (!/[^\u0000-\u00ff]/.test(file.originalname)) { file.originalname = Buffer.from(file.originalname, 'latin1').toString( 'utf8' ) } - console.log(file.originalname) cb(null, file.originalname) } }) diff --git a/src/renderer/apis/allApi.ts b/src/renderer/apis/allApi.ts index 743f6bd8..d5cbde91 100644 --- a/src/renderer/apis/allApi.ts +++ b/src/renderer/apis/allApi.ts @@ -13,6 +13,7 @@ import DogeCloudApi from './dogecloud' import HuaweicloudApi from './huaweiyun' import AlistApi from './alist' import PiclistApi from './piclist' +import LskyplistApi from './lskyplist' const apiMap: IStringKeyMap = { aliyun: AliyunApi, @@ -29,7 +30,8 @@ const apiMap: IStringKeyMap = { dogecloud: DogeCloudApi, 'huaweicloud-uploader': HuaweicloudApi, alist: AlistApi, - piclist: PiclistApi + piclist: PiclistApi, + lskyplist: LskyplistApi } export default class ALLApi { diff --git a/src/renderer/apis/lskyplist.ts b/src/renderer/apis/lskyplist.ts new file mode 100644 index 00000000..2db38427 --- /dev/null +++ b/src/renderer/apis/lskyplist.ts @@ -0,0 +1,39 @@ +import axios, { AxiosResponse } from 'axios' +import https from 'https' + +export default class LskyplistApi { + static async delete (configMap: IStringKeyMap): Promise { + const { hash, config } = configMap + if (!hash || !config || !config.token) { + console.error('LskyplistApi.delete: invalid params') + return false + } + + const { host, token, version } = config + if (version !== 'V2') { + console.error('LskyplistApi.delete: invalid version') + return false + } + + const v2Headers = { + Accept: 'application/json', + Authorization: token || undefined + } + + const requestAgent = new https.Agent({ + rejectUnauthorized: false + }) + try { + const response: AxiosResponse = await axios.delete( + `${host}/api/v1/images/${hash}`, { + headers: v2Headers, + timeout: 30000, + httpsAgent: requestAgent + }) + return response.status === 200 && response.data.status === true + } catch (error) { + console.error(error) + return false + } + } +} diff --git a/src/renderer/layouts/Main.vue b/src/renderer/layouts/Main.vue index f7dde7d5..37b210cf 100644 --- a/src/renderer/layouts/Main.vue +++ b/src/renderer/layouts/Main.vue @@ -124,7 +124,9 @@ {{ $T('PLUGIN_SETTINGS') }} - + @@ -232,7 +234,7 @@ import { } from '@element-plus/icons-vue' // Element Plus 消息框组件 -import { ElMessage as $message } from 'element-plus' +import { ElMessage as $message, ElMessageBox } from 'element-plus' // 国际化函数 import { T as $T } from '@/i18n/index' @@ -275,7 +277,8 @@ import { } from '~/universal/events/constants' // 数据发送工具函数 -import { getConfig, sendToMain } from '@/utils/dataSender' +import { getConfig, saveConfig, sendToMain } from '@/utils/dataSender' +import { openURL } from '@/utils/common' const version = ref(process.env.NODE_ENV === 'production' ? pkg.version : 'Dev') const routerConfig = reactive(config) @@ -320,10 +323,30 @@ const handleGetPicPeds = () => { sendToMain(GET_PICBEDS) } -const handleSelect = (index: string) => { +const handleSelect = async (index: string) => { defaultActive.value = index if (index === routerConfig.DocumentPage) { - ipcRenderer.send('openManualWindow') + const manualPageOpenSetting = await getConfig('settings.manualPageOpen') + const lang = await getConfig('settings.language') || 'zh-CN' + const openManual = () => ipcRenderer.send('openManualWindow') + const openExternal = () => openURL(lang === 'zh-CN' ? 'https://piclist.cn/app.html' : 'https://piclist.cn/en/app.html') + + if (!manualPageOpenSetting) { + ElMessageBox.confirm($T('MANUAL_PAGE_OPEN_TIP'), $T('MANUAL_PAGE_OPEN_TIP_TITLE'), { + confirmButtonText: $T('MANUAL_PAGE_OPEN_BY_BROWSER'), + cancelButtonText: $T('MANUAL_PAGE_OPEN_BY_BUILD_IN'), + type: 'info', + center: true + }).then(() => { + saveConfig('settings.manualPageOpen', 'browser') + openExternal() + }).catch(() => { + saveConfig('settings.manualPageOpen', 'window') + openManual() + }) + } else { + manualPageOpenSetting === 'window' ? openManual() : openExternal() + } return } const type = index.match(routerConfig.UPLOADER_CONFIG_PAGE) diff --git a/src/renderer/pages/PicGoSetting.vue b/src/renderer/pages/PicGoSetting.vue index 8bd762a3..7cc3afb1 100644 --- a/src/renderer/pages/PicGoSetting.vue +++ b/src/renderer/pages/PicGoSetting.vue @@ -92,6 +92,26 @@ /> + + + + + + + + @@ -1622,6 +1653,16 @@ const shortUrlServerList = [{ } ] +const manualPageOpenList = [{ + label: $T('MANUAL_PAGE_OPEN_BY_BUILD_IN'), + value: 'window' +}, +{ + label: $T('MANUAL_PAGE_OPEN_BY_BROWSER'), + value: 'browser' +} +] + const waterMarkPositionMap = new Map([ ['north', $T('UPLOAD_PAGE_IMAGE_PROCESS_POSITION_TOP')], ['northeast', $T('UPLOAD_PAGE_IMAGE_PROCESS_POSITION_TOP_RIGHT')], @@ -1634,6 +1675,8 @@ const waterMarkPositionMap = new Map([ ['centre', $T('UPLOAD_PAGE_IMAGE_PROCESS_POSITION_CENTER')] ]) +const imageExtList = ['jpg', 'jpeg', 'png', 'webp', 'bmp', 'tiff', 'tif', 'svg', 'ico', 'avif', 'heif', 'heic'] + const availableFormat = ['avif', 'dz', 'fits', 'gif', 'heif', 'input', 'jpeg', 'jpg', 'jp2', 'jxl', 'magick', 'openslide', 'pdf', 'png', 'ppm', 'raw', 'svg', 'tiff', 'tif', 'v', 'webp'] const waterMarkForm = reactive({ @@ -1656,13 +1699,15 @@ const compressForm = reactive({ isReSize: false, reSizeWidth: 500, reSizeHeight: 500, + skipReSizeOfSmallImg: false, isReSizeByPercent: false, reSizePercent: 50, isRotate: false, rotateDegree: 0, isRemoveExif: false, isFlip: false, - isFlop: false + isFlop: false, + formatConvertObj: '{}' }) function closeDialog () { @@ -1670,6 +1715,17 @@ function closeDialog () { } function handleSaveConfig () { + let formatConvertObj = {} + try { + formatConvertObj = JSON.parse(compressForm.formatConvertObj) + } catch (error) { + } + const formatConvertObjEntries = Object.entries(formatConvertObj) + const formatConvertObjEntriesFilter = formatConvertObjEntries.filter((item: any) => { + return imageExtList.includes(item[0]) && availableFormat.includes(item[1]) + }) + const formatConvertObjFilter = Object.fromEntries(formatConvertObjEntriesFilter) + compressForm.formatConvertObj = formatConvertObjFilter saveConfig('buildIn.compress', toRaw(compressForm)) saveConfig('buildIn.watermark', toRaw(waterMarkForm)) closeDialog() @@ -1693,6 +1749,11 @@ async function initForm () { compressForm.isRemoveExif = compress.isRemoveExif ?? false compressForm.isFlip = compress.isFlip ?? false compressForm.isFlop = compress.isFlop ?? false + try { + compressForm.formatConvertObj = JSON.stringify(compress.formatConvertObj ?? {}) + } catch (error) { + compressForm.formatConvertObj = '{}' + } } if (watermark) { waterMarkForm.isAddWatermark = watermark.isAddWatermark ?? false @@ -1749,7 +1810,8 @@ const form = reactive({ yourlsSignature: '', deleteLocalFile: false, serverKey: '', - aesPassword: '' + aesPassword: '', + manualPageOpen: 'browser' }) const languageList = i18nManager.languageList.map(item => ({ @@ -1914,6 +1976,7 @@ async function initData () { form.deleteLocalFile = settings.deleteLocalFile || false form.serverKey = settings.serverKey || '' form.aesPassword = settings.aesPassword || 'PicList-aesPassword' + form.manualPageOpen = settings.manualPageOpen || 'window' currentLanguage.value = settings.language ?? 'zh-CN' currentStartMode.value = settings.startMode || 'quiet' customLink.value = settings.customLink || '![$fileName]($url)' @@ -2428,6 +2491,12 @@ function handleStartModeChange (val: 'quiet' | 'mini' | 'main' | 'no-tray') { }) } +function handleManualPageOpenChange (val: string) { + saveConfig({ + 'settings.manualPageOpen': val + }) +} + function goConfigPage () { sendToMain(OPEN_URL, 'https://piclist.cn/configure.html') } diff --git a/src/renderer/pages/Upload.vue b/src/renderer/pages/Upload.vue index e559e1c0..d05d3b39 100644 --- a/src/renderer/pages/Upload.vue +++ b/src/renderer/pages/Upload.vue @@ -303,6 +303,17 @@ /> + + + @@ -474,6 +485,8 @@ const waterMarkPositionMap = new Map([ ['centre', $T('UPLOAD_PAGE_IMAGE_PROCESS_POSITION_CENTER')] ]) +const imageExtList = ['jpg', 'jpeg', 'png', 'webp', 'bmp', 'tiff', 'tif', 'svg', 'ico', 'avif', 'heif', 'heic'] + const availableFormat = ['avif', 'dz', 'fits', 'gif', 'heif', 'input', 'jpeg', 'jpg', 'jp2', 'jxl', 'magick', 'openslide', 'pdf', 'png', 'ppm', 'raw', 'svg', 'tiff', 'tif', 'v', 'webp'] const waterMarkForm = reactive({ @@ -503,7 +516,8 @@ const compressForm = reactive({ rotateDegree: 0, isRemoveExif: false, isFlip: false, - isFlop: false + isFlop: false, + formatConvertObj: '{}' }) function closeDialog () { @@ -511,6 +525,17 @@ function closeDialog () { } function handleSaveConfig () { + let formatConvertObj = {} + try { + formatConvertObj = JSON.parse(compressForm.formatConvertObj) + } catch (error) { + } + const formatConvertObjEntries = Object.entries(formatConvertObj) + const formatConvertObjEntriesFilter = formatConvertObjEntries.filter((item: any) => { + return imageExtList.includes(item[0]) && availableFormat.includes(item[1]) + }) + const formatConvertObjFilter = Object.fromEntries(formatConvertObjEntriesFilter) + compressForm.formatConvertObj = formatConvertObjFilter saveConfig('buildIn.compress', toRaw(compressForm)) saveConfig('buildIn.watermark', toRaw(waterMarkForm)) closeDialog() @@ -534,6 +559,11 @@ async function initData () { compressForm.isRemoveExif = compress.isRemoveExif ?? false compressForm.isFlip = compress.isFlip ?? false compressForm.isFlop = compress.isFlop ?? false + try { + compressForm.formatConvertObj = JSON.stringify(compress.formatConvertObj ?? {}) + } catch (error) { + compressForm.formatConvertObj = '{}' + } } if (watermark) { waterMarkForm.isAddWatermark = watermark.isAddWatermark ?? false diff --git a/src/universal/types/i18n.d.ts b/src/universal/types/i18n.d.ts index 7f4bc606..f3c494df 100644 --- a/src/universal/types/i18n.d.ts +++ b/src/universal/types/i18n.d.ts @@ -51,6 +51,11 @@ interface ILocales { TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_TIPS: string TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_NOT_EXIST_TIPS: string TOOLBOX_CHECK_CLIPBOARD_FILE_PATH_ERROR_TIPS: string + MANUAL_PAGE_OPEN_TIP: string + MANUAL_PAGE_OPEN_TIP_TITLE: string + MANUAL_PAGE_OPEN_BY_BROWSER: string + MANUAL_PAGE_OPEN_BY_BUILD_IN: string + MANUAL_PAGE_OPEN_SETTING_TIP: string CHOOSE_YOUR_DEFAULT_PICBED: string UPLOAD_AREA: string UPLOAD_VIEW_HINT: string @@ -112,6 +117,7 @@ interface ILocales { UPLOAD_PAGE_IMAGE_PROCESS_QUALITY: string UPLOAD_PAGE_IMAGE_PROCESS_ISCONVERT: string UPLOAD_PAGE_IMAGE_PROCESS_CONVERTFORMAT: string + UPLOAD_PAGE_IMAGE_PROCESS_CONVERTFORMAT_SPECIFIC: string UPLOAD_PAGE_IMAGE_PROCESS_ISFLIP: string UPLOAD_PAGE_IMAGE_PROCESS_ISFLOP: string UPLOAD_PAGE_IMAGE_PROCESS_ISRESIZE: string diff --git a/src/universal/types/view.d.ts b/src/universal/types/view.d.ts index 1f098640..ebb16938 100644 --- a/src/universal/types/view.d.ts +++ b/src/universal/types/view.d.ts @@ -30,6 +30,7 @@ interface ISettingForm { deleteLocalFile: boolean, serverKey: string, aesPassword: string, + manualPageOpen: string } interface IShortKeyMap { diff --git a/src/universal/utils/static.ts b/src/universal/utils/static.ts index 8d3ad846..c7965c21 100644 --- a/src/universal/utils/static.ts +++ b/src/universal/utils/static.ts @@ -21,5 +21,6 @@ export const picBedsCanbeDeleted = [ 'dogecloud', 'huaweicloud-uploader', 'alist', - 'piclist' + 'piclist', + 'lskyplist' ] diff --git a/yarn.lock b/yarn.lock index adef07a2..3eee5093 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12362,10 +12362,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.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.7.0.tgz#a348859d1754510e41013afce5896f14ffa7d229" - integrity sha512-X+pGgJ63k4hq6iOuU8t0R+AW/N4zrCk3nC6pdsAjK3yykwDfG3AOg0Yb1Dcx2o9AiFNQd+9LllFakDwQAfMfkA== +piclist@^1.7.6: + version "1.7.6" + resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.7.6.tgz#687796a2a933d692fe226f04999547ab87743d8a" + integrity sha512-6e2gRCrTMWZnpKcWKa0dZSGkgn/0FAd66/UXsGeJcZsegbPNvUNM4/bhWfe74kHKp/Aenb9bzwtMx6HEwUOPUA== dependencies: "@picgo/i18n" "^1.0.0" "@picgo/store" "^2.1.0"