From 914ec15361bde953f8fe9be045c830c79b89b4e4 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Tue, 30 Jan 2024 21:39:20 -0800 Subject: [PATCH 01/11] :bug: Fix(custom): fix buildin s3 config item bug --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0eaedaf..f1aeb98 100644 --- a/package.json +++ b/package.json @@ -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.9", + "piclist": "^1.7.10", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.0", "proxy-agent": "^5.0.0", diff --git a/yarn.lock b/yarn.lock index 672a550..0e3f378 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12392,10 +12392,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.9: - version "1.7.9" - resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.7.9.tgz#1677f63c0596d0b23fd082ce4a3f10c6b4f7244a" - integrity sha512-+H32vNqfe3bCNhkreEJXzWT4fUOyPntNxCPjeo5btxAhbaVEfP8GwXA1XfX8NrJb3ml6sQzIk26FrQ2bzK+Bwg== +piclist@^1.7.10: + version "1.7.10" + resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.7.10.tgz#2374a86d13aacdc9950b15390a84d0a92e6b8761" + integrity sha512-oGTlY6pNyf7YjTecFAQOUlgjfbhwwxKHQ3wyp5/peHKdeKv0PpIbRIHb61y0OhZjS+hWSnTvv5yL86GQUMwkyg== dependencies: "@aws-sdk/client-s3" "3.421.0" "@aws-sdk/lib-storage" "3.421.0" From 0767fbcea4f4b73b2a5255d5c1e5007165a89091 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Wed, 7 Feb 2024 05:46:25 -0800 Subject: [PATCH 02/11] :bug: Fix(custom): optimize github remote delete ISSUES CLOSED: #158 --- src/renderer/apis/github.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer/apis/github.ts b/src/renderer/apis/github.ts index 9bd753b..638dac4 100644 --- a/src/renderer/apis/github.ts +++ b/src/renderer/apis/github.ts @@ -19,9 +19,10 @@ export default class GithubApi { } private static createKey (path: string | undefined, fileName: string): string { + const formatedFileName = fileName.replace(/%2F/g, '/') return path && path !== '/' - ? `${path.replace(/^\/+|\/+$/, '')}/${fileName}` - : fileName + ? `${path.replace(/^\/+|\/+$/, '')}/${formatedFileName}` + : formatedFileName } static async delete (configMap: IConfigMap): Promise { From 4c70946dc6cd1c5202bfb5f00839d84c0ea9c020 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Fri, 16 Feb 2024 22:14:30 -0800 Subject: [PATCH 03/11] :bug: Fix(custom): fix config import name error --- src/renderer/pages/picbeds/index.vue | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/renderer/pages/picbeds/index.vue b/src/renderer/pages/picbeds/index.vue index 6470317..bf614cc 100644 --- a/src/renderer/pages/picbeds/index.vue +++ b/src/renderer/pages/picbeds/index.vue @@ -185,7 +185,7 @@ async function handleConfigImport (configItem: IUploaderConfigListItem) { $configForm.value?.updateRuleForm(key, value) } } - $configForm.value?.updateRuleForm('_configName', dayjs(_updatedAt).format('YYYYMMDDHHmmss')) + $configForm.value?.updateRuleForm('_configName', dayjs().format('YYYYMMDDHHmmss')) } const handleReset = async () => { @@ -227,14 +227,7 @@ function handleNameClick () { async function handleCopyApi () { try { - const serverConfig = await getConfig('settings.server') || { - port: 36677, - host: '127.0.0.1' - } - let { port, host } = serverConfig - if (host === '0.0.0.0') { - host = '127.0.0.1' - } + const { port = 36677, host = '127.0.0.1' } = await getConfig('settings.server') || {} const serverKey = await getConfig('settings.serverKey') || '' const uploader = await getConfig('uploader') as IStringKeyMap || {} const picBedConfigList = uploader[$route.params.type as string].configList || [] @@ -243,12 +236,9 @@ async function handleCopyApi () { ElMessage.error('No config found') return } - let apiUrl = `http://${host}:${port}/upload?picbed=${$route.params.type}&configName=${picBedConfig?._configName}` - if (serverKey) { - apiUrl += `&key=${serverKey}` - } + const apiUrl = `http://${host === '0.0.0.0' ? '127.0.0.1' : host}:${port}/upload?picbed=${$route.params.type}&configName=${picBedConfig._configName}${serverKey ? `&key=${serverKey}` : ''}` clipboard.writeText(apiUrl) - ElMessage.success($T('MANAGE_BUCKET_COPY_SUCCESS') + ' ' + apiUrl) + ElMessage.success(`${$T('MANAGE_BUCKET_COPY_SUCCESS')} ${apiUrl}`) } catch (error) { console.log(error) ElMessage.error('Copy failed') From 21cc1154ac99f08b66ea7f2bd241adbb3b2992a8 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Sun, 18 Feb 2024 22:05:21 -0800 Subject: [PATCH 04/11] :pencil: Docs(custom): update docs for docker usage --- README.md | 4 ++-- README_cn.md | 4 ++-- src/renderer/pages/PicGoSetting.vue | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e279ca9..8f71af9 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ In the community plugins, search for and install the Image auto upload Plugin. N #### docker run -Change the `./piclist` to your own path, and change the `piclist123456` to your own secret key. +Change the `./piclist` to your own path, this is the path where you put your `config.json` file, and change the `piclist123456` to your own secret key. ```bash docker run -d \ @@ -123,7 +123,7 @@ services: command: node /usr/local/bin/picgo-server -k piclist123456 ``` -You can change the `volumes` to your own path and change the `command` to your own secret key. +You can change the `./piclist` to your own path, this is the path where you put your `config.json` file, and change the `command` to your own secret key. Then run: diff --git a/README_cn.md b/README_cn.md index 05f4035..3568fb0 100644 --- a/README_cn.md +++ b/README_cn.md @@ -92,7 +92,7 @@ MacOS: #### docker run -修改`./piclist`为你自己的路径,修改`piclist123456`为你自己的密钥。 +修改`./piclist`为你自己的配置文件`config.json`所在的路径,修改`piclist123456`为你自己的密钥。 ```bash docker run -d \ @@ -123,7 +123,7 @@ services: command: node /usr/local/bin/picgo-server -k piclist123456 ``` -你可以修改`volumes`为你自己的路径,修改`command`为你自己的密钥。 +你可以修改`./piclist`为你自己的配置文件`config.json`所在的路径,修改`command`为你自己的密钥。 然后运行 diff --git a/src/renderer/pages/PicGoSetting.vue b/src/renderer/pages/PicGoSetting.vue index 2646bc1..0103123 100644 --- a/src/renderer/pages/PicGoSetting.vue +++ b/src/renderer/pages/PicGoSetting.vue @@ -1,5 +1,5 @@