From 9781de4edb5aef359a146081f670f44e3c74c0a7 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Mon, 6 Nov 2023 05:17:09 -0800 Subject: [PATCH 1/9] :arrow_up: Upgrade(custom): upgrade vue --- package.json | 4 +- yarn.lock | 133 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 83 insertions(+), 54 deletions(-) diff --git a/package.json b/package.json index 6aa7f653..ba4109f2 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "cos-nodejs-sdk-v5": "^2.12.5", "dexie": "^3.2.4", "electron-updater": "^6.1.4", - "element-plus": "2.4.1", + "element-plus": "2.4.2", "epipebomb": "^1.0.0", "fast-xml-parser": "^4.3.2", "form-data": "^4.0.0", @@ -80,7 +80,7 @@ "upyun": "^3.4.6", "uuid": "^9.0.1", "video.js": "^8.5.2", - "vue": "^3.3.7", + "vue": "^3.3.8", "vue-router": "^4.2.5", "vue3-lazyload": "^0.3.8", "vue3-photo-preview": "^0.3.0", diff --git a/yarn.lock b/yarn.lock index 5f3e0ea1..5eefc8e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4163,47 +4163,47 @@ semver "^7.3.4" strip-ansi "^6.0.0" -"@vue/compiler-core@3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.3.7.tgz#865a5734c971686d9737d85a0c5a08de045b6162" - integrity sha512-pACdY6YnTNVLXsB86YD8OF9ihwpolzhhtdLVHhBL6do/ykr6kKXNYABRtNMGrsQXpEXXyAdwvWWkuTbs4MFtPQ== +"@vue/compiler-core@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.3.8.tgz#301bb60d0245265a88ed5b30e200fbf223acb313" + integrity sha512-hN/NNBUECw8SusQvDSqqcVv6gWq8L6iAktUR0UF3vGu2OhzRqcOiAno0FmBJWwxhYEXRlQJT5XnoKsVq1WZx4g== dependencies: "@babel/parser" "^7.23.0" - "@vue/shared" "3.3.7" + "@vue/shared" "3.3.8" estree-walker "^2.0.2" source-map-js "^1.0.2" -"@vue/compiler-dom@3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.3.7.tgz#a245aa03f9bfcdb537a239bf02842072de0644c9" - integrity sha512-0LwkyJjnUPssXv/d1vNJ0PKfBlDoQs7n81CbO6Q0zdL7H1EzqYRrTVXDqdBVqro0aJjo/FOa1qBAPVI4PGSHBw== +"@vue/compiler-dom@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.3.8.tgz#09d832514b9b8d9415a3816b065d69dbefcc7e9b" + integrity sha512-+PPtv+p/nWDd0AvJu3w8HS0RIm/C6VGBIRe24b9hSyNWOAPEUosFZ5diwawwP8ip5sJ8n0Pe87TNNNHnvjs0FQ== dependencies: - "@vue/compiler-core" "3.3.7" - "@vue/shared" "3.3.7" + "@vue/compiler-core" "3.3.8" + "@vue/shared" "3.3.8" -"@vue/compiler-sfc@3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.3.7.tgz#219d04b3013c7b15fbc536e2279e07810b731cc2" - integrity sha512-7pfldWy/J75U/ZyYIXRVqvLRw3vmfxDo2YLMwVtWVNew8Sm8d6wodM+OYFq4ll/UxfqVr0XKiVwti32PCrruAw== +"@vue/compiler-sfc@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.3.8.tgz#40b18e48aa00260950964d1d72157668521be0e1" + integrity sha512-WMzbUrlTjfYF8joyT84HfwwXo+8WPALuPxhy+BZ6R4Aafls+jDBnSz8PDz60uFhuqFbl3HxRfxvDzrUf3THwpA== dependencies: "@babel/parser" "^7.23.0" - "@vue/compiler-core" "3.3.7" - "@vue/compiler-dom" "3.3.7" - "@vue/compiler-ssr" "3.3.7" - "@vue/reactivity-transform" "3.3.7" - "@vue/shared" "3.3.7" + "@vue/compiler-core" "3.3.8" + "@vue/compiler-dom" "3.3.8" + "@vue/compiler-ssr" "3.3.8" + "@vue/reactivity-transform" "3.3.8" + "@vue/shared" "3.3.8" estree-walker "^2.0.2" magic-string "^0.30.5" postcss "^8.4.31" source-map-js "^1.0.2" -"@vue/compiler-ssr@3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.3.7.tgz#eff4a70f7ceb800d60e68d208b96a030c0f1b636" - integrity sha512-TxOfNVVeH3zgBc82kcUv+emNHo+vKnlRrkv8YvQU5+Y5LJGJwSNzcmLUoxD/dNzv0bhQ/F0s+InlgV0NrApJZg== +"@vue/compiler-ssr@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.3.8.tgz#136eed54411e4694815d961048a237191063fbce" + integrity sha512-hXCqQL/15kMVDBuoBYpUnSYT8doDNwsjvm3jTefnXr+ytn294ySnT8NlsFHmTgKNjwpuFy7XVV8yTeLtNl/P6w== dependencies: - "@vue/compiler-dom" "3.3.7" - "@vue/shared" "3.3.7" + "@vue/compiler-dom" "3.3.8" + "@vue/shared" "3.3.8" "@vue/component-compiler-utils@^3.1.0", "@vue/component-compiler-utils@^3.3.0": version "3.3.0" @@ -4247,14 +4247,14 @@ "@typescript-eslint/parser" "^6.7.0" vue-eslint-parser "^9.3.1" -"@vue/reactivity-transform@3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.3.7.tgz#eb9f5110af5085079b851d162205394bc790d539" - integrity sha512-APhRmLVbgE1VPGtoLQoWBJEaQk4V8JUsqrQihImVqKT+8U6Qi3t5ATcg4Y9wGAPb3kIhetpufyZ1RhwbZCIdDA== +"@vue/reactivity-transform@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.3.8.tgz#6d07649013b0be5c670f0ab6cc7ddd3150ad03f2" + integrity sha512-49CvBzmZNtcHua0XJ7GdGifM8GOXoUMOX4dD40Y5DxI3R8OUhMlvf2nvgUAcPxaXiV5MQQ1Nwy09ADpnLQUqRw== dependencies: "@babel/parser" "^7.23.0" - "@vue/compiler-core" "3.3.7" - "@vue/shared" "3.3.7" + "@vue/compiler-core" "3.3.8" + "@vue/shared" "3.3.8" estree-walker "^2.0.2" magic-string "^0.30.5" @@ -4265,6 +4265,13 @@ dependencies: "@vue/shared" "3.3.7" +"@vue/reactivity@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.3.8.tgz#cce8a03a3fd3539c3eeda53e277ba365d160dd4d" + integrity sha512-ctLWitmFBu6mtddPyOKpHg8+5ahouoTCRtmAHZAXmolDtuZXfjL2T3OJ6DL6ezBPQB1SmMnpzjiWjCiMYmpIuw== + dependencies: + "@vue/shared" "3.3.8" + "@vue/runtime-core@3.3.7": version "3.3.7" resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.3.7.tgz#c1eece1c98f936dc69dd0667d11b464579b128fd" @@ -4273,7 +4280,24 @@ "@vue/reactivity" "3.3.7" "@vue/shared" "3.3.7" -"@vue/runtime-dom@3.3.7", "@vue/runtime-dom@^3.3.7": +"@vue/runtime-core@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.3.8.tgz#fba5a632cbf2b5d29e171489570149cb6975dcdb" + integrity sha512-qurzOlb6q26KWQ/8IShHkMDOuJkQnQcTIp1sdP4I9MbCf9FJeGVRXJFr2mF+6bXh/3Zjr9TDgURXrsCr9bfjUw== + dependencies: + "@vue/reactivity" "3.3.8" + "@vue/shared" "3.3.8" + +"@vue/runtime-dom@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.3.8.tgz#e2d7aa795cf50914dda9a951887765a594b38af4" + integrity sha512-Noy5yM5UIf9UeFoowBVgghyGGPIDPy1Qlqt0yVsUdAVbqI8eeMSsTqBtauaEoT2UFXUk5S64aWVNJN4MJ2vRdA== + dependencies: + "@vue/runtime-core" "3.3.8" + "@vue/shared" "3.3.8" + csstype "^3.1.2" + +"@vue/runtime-dom@^3.3.7": version "3.3.7" resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.3.7.tgz#e7cf88cc01591fdf6e3164825554fdadc3137ffc" integrity sha512-PFQU1oeJxikdDmrfoNQay5nD4tcPNYixUBruZzVX/l0eyZvFKElZUjW4KctCcs52nnpMGO6UDK+jF5oV4GT5Lw== @@ -4282,19 +4306,24 @@ "@vue/shared" "3.3.7" csstype "^3.1.2" -"@vue/server-renderer@3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.3.7.tgz#0cc3dc6ad39a54693e6e8f853caa3c7bb43b0364" - integrity sha512-UlpKDInd1hIZiNuVVVvLgxpfnSouxKQOSE2bOfQpBuGwxRV/JqqTCyyjXUWiwtVMyeRaZhOYYqntxElk8FhBhw== +"@vue/server-renderer@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.3.8.tgz#9b1779010e75783edeed8fcfb97d9c95fc3ac5d2" + integrity sha512-zVCUw7RFskvPuNlPn/8xISbrf0zTWsTSdYTsUTN1ERGGZGVnRxM2QZ3x1OR32+vwkkCm0IW6HmJ49IsPm7ilLg== dependencies: - "@vue/compiler-ssr" "3.3.7" - "@vue/shared" "3.3.7" + "@vue/compiler-ssr" "3.3.8" + "@vue/shared" "3.3.8" "@vue/shared@3.3.7": version "3.3.7" resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.3.7.tgz#0091852fe5cc4237c8440fe32f3ab6bc920ae6d9" integrity sha512-N/tbkINRUDExgcPTBvxNkvHGu504k8lzlNQRITVnm6YjOjwa4r0nnbd4Jb01sNpur5hAllyRJzSK5PvB9PPwRg== +"@vue/shared@3.3.8": + version "3.3.8" + resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.3.8.tgz#f044942142e1d3a395f24132e6203a784838542d" + integrity sha512-8PGwybFwM4x8pcfgqEQFy70NaQxASvOC5DJwLQfpArw1UDfUXrJkdxD3BhVTMS+0Lef/TU7YO0Jvr0jJY8T+mw== + "@vue/vue-loader-v15@npm:vue-loader@^15.9.7": version "15.10.1" resolved "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.1.tgz#c451c4cd05a911aae7b5dbbbc09fb913fb3cca18" @@ -7275,10 +7304,10 @@ electron@^22.0.2: "@types/node" "^16.11.26" extract-zip "^2.0.1" -element-plus@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-2.4.1.tgz#8a5faa69e856d82494b94d77fb485d9e727c8bc1" - integrity sha512-t7nl+vQlkBKVk1Ag6AufSDyFV8YIXxTFsaya4Nz/0tiRlcz65WPN4WMFeNURuFJleu1HLNtP4YyQKMuS7El8uA== +element-plus@2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-2.4.2.tgz#2a24632e0904ccd7bbbd64c269704f6b9969833c" + integrity sha512-E/HwXX7JF1LPvQSjs0fZ8WblIoc0quoXsRXQZiL7QDq7xJdNGSUaXtdk7xiEv7axPmLfEFtxE5du9fFspDrmJw== dependencies: "@ctrl/tinycolor" "^3.4.1" "@element-plus/icons-vue" "^2.0.6" @@ -15695,16 +15724,16 @@ vue3-photo-preview@^0.3.0: dependencies: lodash-es "^4.17.21" -vue@^3.3.7: - version "3.3.7" - resolved "https://registry.yarnpkg.com/vue/-/vue-3.3.7.tgz#972a218682443a3819d121261b2bff914417f4f0" - integrity sha512-YEMDia1ZTv1TeBbnu6VybatmSteGOS3A3YgfINOfraCbf85wdKHzscD6HSS/vB4GAtI7sa1XPX7HcQaJ1l24zA== +vue@^3.3.8: + version "3.3.8" + resolved "https://registry.yarnpkg.com/vue/-/vue-3.3.8.tgz#532ff071af24f6a69e5ecc53a66858a9ee874ffc" + integrity sha512-5VSX/3DabBikOXMsxzlW8JyfeLKlG9mzqnWgLQLty88vdZL7ZJgrdgBOmrArwxiLtmS+lNNpPcBYqrhE6TQW5w== dependencies: - "@vue/compiler-dom" "3.3.7" - "@vue/compiler-sfc" "3.3.7" - "@vue/runtime-dom" "3.3.7" - "@vue/server-renderer" "3.3.7" - "@vue/shared" "3.3.7" + "@vue/compiler-dom" "3.3.8" + "@vue/compiler-sfc" "3.3.8" + "@vue/runtime-dom" "3.3.8" + "@vue/server-renderer" "3.3.8" + "@vue/shared" "3.3.8" watchpack@^2.4.0: version "2.4.0" From 02dc71b424525315bc3618715a09a85b73840d78 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Tue, 7 Nov 2023 16:27:10 -0800 Subject: [PATCH 2/9] :pencil: Docs(custom): add docs for upload service using piclist due to a potential typora bug --- README.md | 2 ++ README_cn.md | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 653692b4..d5322c68 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ 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. + [download link](https://typora.io/releases/all) #### **Version < 1.6.0-dev** diff --git a/README_cn.md b/README_cn.md index 11b1a435..8ab95574 100644 --- a/README_cn.md +++ b/README_cn.md @@ -56,7 +56,9 @@ PicList的内核使用的是原版PicGo-Core基础上修改的[PicList-core](htt #### **1.6.0版本及以上** -**Typora 1.6.0-dev以及以上版本现在已经原生支持PicList了** +**Typora 1.6.0-dev以及以上版本现在已经原生支持PicList了** + +目前Typora中需要同时设置上传服务PicList和PicGo(app)的路径为PicList的安装路径,这可能源于Typora的bug。 [下载地址](https://typora.io/releases/all) From 5658ce6ead9fc7826fe4b7119246ba6121b340b2 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Wed, 8 Nov 2023 18:48:36 -0800 Subject: [PATCH 3/9] :bug: Fix(custom): fix delete event error in server api --- src/main/apis/app/uploader/apis.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/apis/app/uploader/apis.ts b/src/main/apis/app/uploader/apis.ts index a461844a..74884464 100644 --- a/src/main/apis/app/uploader/apis.ts +++ b/src/main/apis/app/uploader/apis.ts @@ -151,7 +151,8 @@ export const deleteChoosedFiles = async (list: ImgInfo[]): Promise => if (item.id) { try { const dbStore = GalleryDB.getInstance() - const file = await dbStore.removeById(item.id) + const file = await dbStore.getById(item.id) + await dbStore.removeById(item.id) if (await picgo.getConfig('settings.deleteCloudFile')) { if (item.type !== undefined && picBedsCanbeDeleted.includes(item.type)) { const noteFunc = (value: boolean) => { From b53c9d495feb62fd2d01153011a5d30341bb4be4 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Wed, 8 Nov 2023 19:20:27 -0800 Subject: [PATCH 4/9] :arrow_up: Upgrade(custom): update package.json dependencies --- package.json | 32 +++++------ yarn.lock | 152 ++++++++++++++++++++++----------------------------- 2 files changed, 82 insertions(+), 102 deletions(-) diff --git a/package.json b/package.json index ba4109f2..2f55ee0f 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,9 @@ "@smithy/node-http-handler": "^2.1.6", "@videojs-player/vue": "^1.0.0", "ali-oss": "^6.18.1", - "axios": "^1.6.0", + "axios": "^1.6.1", "compare-versions": "^4.1.3", - "core-js": "^3.33.1", + "core-js": "^3.33.2", "cos-nodejs-sdk-v5": "^2.12.5", "dexie": "^3.2.4", "electron-updater": "^6.1.4", @@ -62,7 +62,7 @@ "hpagent": "^1.2.0", "keycode": "^2.2.0", "lowdb": "^1.0.0", - "marked": "^9.1.4", + "marked": "^9.1.5", "mime-types": "^2.1.35", "mitt": "^3.0.1", "multer": "^1.4.5-lts.1", @@ -90,21 +90,21 @@ "devDependencies": { "@babel/plugin-proposal-optional-chaining": "^7.21.0", "@electron/notarize": "^2.1.0", - "@types/ali-oss": "^6.16.10", - "@types/electron-devtools-installer": "^2.2.4", - "@types/fs-extra": "^11.0.3", + "@types/ali-oss": "^6.16.11", + "@types/electron-devtools-installer": "^2.2.5", + "@types/fs-extra": "^11.0.4", "@types/inquirer": "^6.5.0", - "@types/js-yaml": "^4.0.8", - "@types/lowdb": "^1.0.14", - "@types/mime-types": "^2.1.3", + "@types/js-yaml": "^4.0.9", + "@types/lowdb": "^1.0.15", + "@types/mime-types": "^2.1.4", "@types/multer": "^1.4.9", "@types/node": "^16.10.2", - "@types/request-promise-native": "^1.0.20", - "@types/semver": "^7.5.4", - "@types/tunnel": "^0.0.5", - "@types/upyun": "^3.4.2", - "@types/uuid": "^9.0.6", - "@types/write-file-atomic": "^4.0.2", + "@types/request-promise-native": "^1.0.21", + "@types/semver": "^7.5.5", + "@types/tunnel": "^0.0.6", + "@types/upyun": "^3.4.3", + "@types/uuid": "^9.0.7", + "@types/write-file-atomic": "^4.0.3", "@typescript-eslint/eslint-plugin": "^6.9.1", "@typescript-eslint/parser": "^6.9.1", "@vue/cli-plugin-babel": "^5.0.8", @@ -114,7 +114,7 @@ "@vue/cli-service": "^5.0.8", "@vue/eslint-config-standard": "^8.0.1", "@vue/eslint-config-typescript": "^12.0.0", - "@vue/runtime-dom": "^3.3.7", + "@vue/runtime-dom": "^3.3.8", "conventional-changelog": "^5.1.0", "cz-customizable": "^7.0.0", "dotenv": "^16.3.1", diff --git a/yarn.lock b/yarn.lock index 5eefc8e9..f236ba24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3196,10 +3196,10 @@ "@tufjs/canonical-json" "1.0.0" minimatch "^9.0.0" -"@types/ali-oss@^6.16.10": - version "6.16.10" - resolved "https://registry.yarnpkg.com/@types/ali-oss/-/ali-oss-6.16.10.tgz#61032e3c83dfe00e9dac509666113c559622f39d" - integrity sha512-0K+YPzSKDKSgj9dVbORgzVgGesTY9Ziu6QPTUrweglFs0coPhC0mVAQquVO1eau4YxVMqmLkZy+dO7o3jWcQAA== +"@types/ali-oss@^6.16.11": + version "6.16.11" + resolved "https://registry.yarnpkg.com/@types/ali-oss/-/ali-oss-6.16.11.tgz#a70fc1ef54abb54809405c8b5d77dac06011557c" + integrity sha512-/AyemPZy93ZXGzEokMsoPFgjH37snpzH4X/fwans/n63HLaCleriCG3PyrkHCPkgHEc9vj9Uo6paqsBN3vJ3OA== "@types/body-parser@*": version "1.19.2" @@ -3260,10 +3260,10 @@ dependencies: "@types/ms" "*" -"@types/electron-devtools-installer@^2.2.4": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@types/electron-devtools-installer/-/electron-devtools-installer-2.2.4.tgz#4d9f9ef0aadfdd741bea6ba511722275bba264db" - integrity sha512-SA7SjTduhf8KSytsFQP4oersLPRxlCZLyg318Lwb53kci7x3JLaUf9M1vcLcLuPAVfo6xgQEAmbyPN3O5br94g== +"@types/electron-devtools-installer@^2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@types/electron-devtools-installer/-/electron-devtools-installer-2.2.5.tgz#33572d0edee2510a6c293d0d5c858ee09f07cd19" + integrity sha512-DhH8z0dadKuDolvH4TiW40Vp7H3VyZbOoZv98hhBaUfnxmvvcXTjkZjzw/54xvAmuG4KFzExOGAiVLg3jM2ojQ== "@types/eslint-scope@^3.7.3": version "3.7.4" @@ -3329,10 +3329,10 @@ "@types/qs" "*" "@types/serve-static" "*" -"@types/fs-extra@^11.0.3": - version "11.0.3" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-11.0.3.tgz#72c3a247c8dd5703c93d900c584e006476146866" - integrity sha512-sF59BlXtUdzEAL1u0MSvuzWd7PdZvZEtnaVkzX5mjpdWTJ8brG0jUqve3jPCzSzvAKKMHTG8F8o/WMQLtleZdQ== +"@types/fs-extra@^11.0.4": + version "11.0.4" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-11.0.4.tgz#e16a863bb8843fba8c5004362b5a73e17becca45" + integrity sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ== dependencies: "@types/jsonfile" "*" "@types/node" "*" @@ -3384,10 +3384,10 @@ "@types/through" "*" rxjs "^6.4.0" -"@types/js-yaml@^4.0.8": - version "4.0.8" - resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.8.tgz#7574e422d70d4a1b41f517d1d9abc61be2299a97" - integrity sha512-m6jnPk1VhlYRiLFm3f8X9Uep761f+CK8mHyS65LutH2OhmBF0BeMEjHgg05usH8PLZMWWc/BUR9RPmkvpWnyRA== +"@types/js-yaml@^4.0.9": + version "4.0.9" + resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.9.tgz#cd82382c4f902fed9691a2ed79ec68c5898af4c2" + integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg== "@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.11" @@ -3440,17 +3440,17 @@ resolved "https://registry.npmmirror.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== -"@types/lowdb@^1.0.14": - version "1.0.14" - resolved "https://registry.yarnpkg.com/@types/lowdb/-/lowdb-1.0.14.tgz#966f79e444767c9192a27f567699d0d8cd7d215c" - integrity sha512-t34ssKfsqGYnRCjkDOMUsLQb4yfuYV6Fl6iJqU2RIiAxuzlvlrMNdMUa86fguWLCt6RFnId2G5pnSIMJ28McnQ== +"@types/lowdb@^1.0.15": + version "1.0.15" + resolved "https://registry.yarnpkg.com/@types/lowdb/-/lowdb-1.0.15.tgz#c1d1859db89bcec2741b6c95f28c16f01472228b" + integrity sha512-xaMNIveDCryK4UvnUJOc2BCOH0lPivdvWHrutsLryo9r9Id3RqZq2RDmT4eddiEPYzu7nJMw6nFIcVifcqjWqg== dependencies: "@types/lodash" "*" -"@types/mime-types@^2.1.3": - version "2.1.3" - resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.3.tgz#0688436864f87a0c8e33ca12be60cd791cc24b36" - integrity sha512-bvxCbHeeS7quxS7uOJShyoOQj/BfLabhF6mk9Rmr+2MRfW8W1yxyyL/0GTxLFTHen41GrIw4K3D4DrLouhb8vg== +"@types/mime-types@^2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.4.tgz#93a1933e24fed4fb9e4adc5963a63efcbb3317a2" + integrity sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w== "@types/mime@*": version "3.0.1" @@ -3517,10 +3517,10 @@ resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== -"@types/request-promise-native@^1.0.20": - version "1.0.20" - resolved "https://registry.yarnpkg.com/@types/request-promise-native/-/request-promise-native-1.0.20.tgz#c3f242eb4e7cb091f759679e9a8703f99b402d02" - integrity sha512-1dfdWY0u6mNkAheZ5UqBGY/ARpDXE5xJ+npN3COoTfrQTt4FmHrwp8548zU6F1LniUK75qk06HoOvCG+hS/8Zw== +"@types/request-promise-native@^1.0.21": + version "1.0.21" + resolved "https://registry.yarnpkg.com/@types/request-promise-native/-/request-promise-native-1.0.21.tgz#9356d70b81475a29e4e20fd43c705a02c91a4332" + integrity sha512-NJ1M6iqWTEUT+qdP+OmXsRZ6tSdkoBdblHKatIWTVP1HdYpHU3IkfpLPf4MWb0+CC4Nl3TtLpYhDlhjZxytDIA== dependencies: "@types/request" "*" @@ -3551,10 +3551,10 @@ resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== -"@types/semver@^7.5.4": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.4.tgz#0a41252ad431c473158b22f9bfb9a63df7541cff" - integrity sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ== +"@types/semver@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.5.tgz#deed5ab7019756c9c90ea86139106b0346223f35" + integrity sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg== "@types/serve-index@^1.9.1": version "1.9.1" @@ -3605,24 +3605,24 @@ resolved "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.1.tgz#8f80dd965ad81f3e1bc26d6f5c727e132721ff40" integrity sha512-Y0K95ThC3esLEYD6ZuqNek29lNX2EM1qxV8y2FTLUB0ff5wWrk7az+mLrnNFUnaXcgKye22+sFBRXOgpPILZNg== -"@types/tunnel@^0.0.5": - version "0.0.5" - resolved "https://registry.yarnpkg.com/@types/tunnel/-/tunnel-0.0.5.tgz#1ddadd75ddcb23f469d0c7fbbe7bcbe38db77383" - integrity sha512-XGvAonhX1CeULtu4BTzy5nrsOWbxE2SzOBO1c+T16y4gyNnL7EPX7O5cjISdL2hSxXcuTXVieLJa+rSsKxGp+g== +"@types/tunnel@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@types/tunnel/-/tunnel-0.0.6.tgz#a7a8758fb090f754cc539ceb6e4c3aadab0adc1f" + integrity sha512-hfaiPQfx9xWwy5x++mdlydyNeV8VJUfOSslxwCtMh9HGjtXysk2oL38TvJhfi+afa2os8sLWW8mZC4Zq5mU50A== dependencies: "@types/node" "*" -"@types/upyun@^3.4.2": - version "3.4.2" - resolved "https://registry.yarnpkg.com/@types/upyun/-/upyun-3.4.2.tgz#95bada247db7a1d4c20ffb25aff7fb4584c74efc" - integrity sha512-h1xLB080SLHWdIloImHt6nw9Vq1lP2H7nuTtyydh6OYy81GquGpZBSgBiXQvJvhkKkRTuLqkhGXhHWpPRfd5YQ== +"@types/upyun@^3.4.3": + version "3.4.3" + resolved "https://registry.yarnpkg.com/@types/upyun/-/upyun-3.4.3.tgz#acc5265c073b5f627ab3e5abe7a4f2aab089b404" + integrity sha512-iTZTvDxt1h4dmZeJnWsB7YeVRwTwEr8GE22LSKM3F464+4VnaUoIYtcwqkWnxEDPV97ZN3XA0BzSgCx84QR8jA== dependencies: "@types/node" "*" -"@types/uuid@^9.0.6": - version "9.0.6" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.6.tgz#c91ae743d8344a54b2b0c691195f5ff5265f6dfb" - integrity sha512-BT2Krtx4xaO6iwzwMFUYvWBWkV2pr37zD68Vmp1CDV196MzczBRxuEpD6Pr395HAgebC/co7hOphs53r8V7jew== +"@types/uuid@^9.0.7": + version "9.0.7" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.7.tgz#b14cebc75455eeeb160d5fe23c2fcc0c64f724d8" + integrity sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g== "@types/verror@^1.10.3": version "1.10.5" @@ -3639,10 +3639,10 @@ resolved "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.16.3.tgz#b776327a73e561b71e7881d0cd6d34a1424db86a" integrity sha512-9gtOPPkfyNoEqCQgx4qJKkuNm/x0R2hKR7fdl7zvTJyHnIisuE/LfvXOsYWL0o3qq6uiBnKZNNNzi3l0y/X+xw== -"@types/write-file-atomic@^4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/write-file-atomic/-/write-file-atomic-4.0.2.tgz#5945cb4959189286d93bdc49b3d1d3e6acbb4408" - integrity sha512-2/wIE+5dGO2sGG3R0DV9HOcvkdnl3ArklT87fTnVMv0CHdJhVCaQc8625wqv3Nl3cRs2xmghuZE+AYP4Iquy8Q== +"@types/write-file-atomic@^4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/write-file-atomic/-/write-file-atomic-4.0.3.tgz#bda169b8369022e2c87028671fa4b742c08d98c9" + integrity sha512-qdo+vZRchyJIHNeuI1nrpsLw+hnkgqP/8mlaN6Wle/NKhydHmUN9l4p3ZE8yP90AJNJW4uB8HQhedb4f1vNayQ== dependencies: "@types/node" "*" @@ -4258,13 +4258,6 @@ estree-walker "^2.0.2" magic-string "^0.30.5" -"@vue/reactivity@3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.3.7.tgz#48b6671a45ba33039da2c0eb25ae702f924486a9" - integrity sha512-cZNVjWiw00708WqT0zRpyAgduG79dScKEPYJXq2xj/aMtk3SKvL3FBt2QKUlh6EHBJ1m8RhBY+ikBUzwc7/khg== - dependencies: - "@vue/shared" "3.3.7" - "@vue/reactivity@3.3.8": version "3.3.8" resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.3.8.tgz#cce8a03a3fd3539c3eeda53e277ba365d160dd4d" @@ -4272,14 +4265,6 @@ dependencies: "@vue/shared" "3.3.8" -"@vue/runtime-core@3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.3.7.tgz#c1eece1c98f936dc69dd0667d11b464579b128fd" - integrity sha512-LHq9du3ubLZFdK/BP0Ysy3zhHqRfBn80Uc+T5Hz3maFJBGhci1MafccnL3rpd5/3wVfRHAe6c+PnlO2PAavPTQ== - dependencies: - "@vue/reactivity" "3.3.7" - "@vue/shared" "3.3.7" - "@vue/runtime-core@3.3.8": version "3.3.8" resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.3.8.tgz#fba5a632cbf2b5d29e171489570149cb6975dcdb" @@ -4288,7 +4273,7 @@ "@vue/reactivity" "3.3.8" "@vue/shared" "3.3.8" -"@vue/runtime-dom@3.3.8": +"@vue/runtime-dom@3.3.8", "@vue/runtime-dom@^3.3.8": version "3.3.8" resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.3.8.tgz#e2d7aa795cf50914dda9a951887765a594b38af4" integrity sha512-Noy5yM5UIf9UeFoowBVgghyGGPIDPy1Qlqt0yVsUdAVbqI8eeMSsTqBtauaEoT2UFXUk5S64aWVNJN4MJ2vRdA== @@ -4297,15 +4282,6 @@ "@vue/shared" "3.3.8" csstype "^3.1.2" -"@vue/runtime-dom@^3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.3.7.tgz#e7cf88cc01591fdf6e3164825554fdadc3137ffc" - integrity sha512-PFQU1oeJxikdDmrfoNQay5nD4tcPNYixUBruZzVX/l0eyZvFKElZUjW4KctCcs52nnpMGO6UDK+jF5oV4GT5Lw== - dependencies: - "@vue/runtime-core" "3.3.7" - "@vue/shared" "3.3.7" - csstype "^3.1.2" - "@vue/server-renderer@3.3.8": version "3.3.8" resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.3.8.tgz#9b1779010e75783edeed8fcfb97d9c95fc3ac5d2" @@ -4314,11 +4290,6 @@ "@vue/compiler-ssr" "3.3.8" "@vue/shared" "3.3.8" -"@vue/shared@3.3.7": - version "3.3.7" - resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.3.7.tgz#0091852fe5cc4237c8440fe32f3ab6bc920ae6d9" - integrity sha512-N/tbkINRUDExgcPTBvxNkvHGu504k8lzlNQRITVnm6YjOjwa4r0nnbd4Jb01sNpur5hAllyRJzSK5PvB9PPwRg== - "@vue/shared@3.3.8": version "3.3.8" resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.3.8.tgz#f044942142e1d3a395f24132e6203a784838542d" @@ -5112,6 +5083,15 @@ axios@^1.6.0: form-data "^4.0.0" proxy-from-env "^1.1.0" +axios@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.1.tgz#76550d644bf0a2d469a01f9244db6753208397d7" + integrity sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + babel-loader@^8.2.2: version "8.3.0" resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.3.0.tgz#124936e841ba4fe8176786d6ff28add1f134d6a8" @@ -6359,10 +6339,10 @@ core-js-compat@^3.25.1, core-js-compat@^3.8.3: dependencies: browserslist "^4.21.4" -core-js@^3.33.1: - version "3.33.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.33.1.tgz#ef3766cfa382482d0a2c2bc5cb52c6d88805da52" - integrity sha512-qVSq3s+d4+GsqN0teRCJtM6tdEEXyWxjzbhVrCHmBS5ZTM0FS2MOS0D13dUXAWDUN6a+lHI/N1hF9Ytz6iLl9Q== +core-js@^3.33.2: + version "3.33.2" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.33.2.tgz#312bbf6996a3a517c04c99b9909cdd27138d1ceb" + integrity sha512-XeBzWI6QL3nJQiHmdzbAOiMYqjrb7hwU7A39Qhvd/POSa/t9E1AeZyEZx3fNvp/vtM8zXwhoL0FsiS0hD0pruQ== core-js@^3.8.3: version "3.27.0" @@ -10943,10 +10923,10 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== -marked@^9.1.4: - version "9.1.4" - resolved "https://registry.yarnpkg.com/marked/-/marked-9.1.4.tgz#68d50848f1b1e264b8fa031946b4b0c3352827e9" - integrity sha512-Mq83CCaClhXqhf8sLQ57c1unNelHEuFadK36ga+GeXR4FeT/5ssaC5PaCRVqMA74VYorzYRqdAaxxteIanh3Kw== +marked@^9.1.5: + version "9.1.5" + resolved "https://registry.yarnpkg.com/marked/-/marked-9.1.5.tgz#fcada4702ea64a5c05a4ff0e0639628aac8a1e5f" + integrity sha512-14QG3shv8Kg/xc0Yh6TNkMj90wXH9mmldi5941I2OevfJ/FQAFLEwtwU2/FfgSAOMlWHrEukWSGQf8MiVYNG2A== matcher@^3.0.0: version "3.0.0" From e968a65cca7b1cb21989ceb77ff8cdbd36f9155c Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Mon, 13 Nov 2023 20:21:23 -0800 Subject: [PATCH 5/9] :sparkles: Feature(custom): add new config field temp dir path ISSUES CLOSED: #112 --- public/i18n/en.yml | 1 + public/i18n/zh-CN.yml | 1 + public/i18n/zh-TW.yml | 1 + src/main/manage/events/ipcList.ts | 7 +++++++ src/main/manage/utils/common.ts | 20 +++++++++++++++----- src/renderer/pages/PicGoSetting.vue | 25 ++++++++++++++++++++++++- src/universal/types/i18n.d.ts | 1 + src/universal/types/view.d.ts | 3 ++- 8 files changed, 52 insertions(+), 7 deletions(-) diff --git a/public/i18n/en.yml b/public/i18n/en.yml index a27fa9dd..07dfaf17 100644 --- a/public/i18n/en.yml +++ b/public/i18n/en.yml @@ -296,6 +296,7 @@ SETTINGS_TAB_SYNC_CONFIG: Sync and Configuration SETTINGS_TAB_UPLOAD: Upload SETTINGS_TAB_ADVANCED: Advanced SETTINGS_TAB_UPDATE: Update +SETTINGS_GENERAL_TEMP_DIR_PATH: Temporary directory path # shortcut-page BUILTIN_CLIPBOARD_TIPS: Use builtin clipboard function to upload instead of using scripts diff --git a/public/i18n/zh-CN.yml b/public/i18n/zh-CN.yml index 4acf3fca..06c11a66 100644 --- a/public/i18n/zh-CN.yml +++ b/public/i18n/zh-CN.yml @@ -299,6 +299,7 @@ SETTINGS_TAB_SYNC_CONFIG: 同步与配置 SETTINGS_TAB_UPLOAD: 上传设置 SETTINGS_TAB_ADVANCED: 高级设置 SETTINGS_TAB_UPDATE: 更新 +SETTINGS_GENERAL_TEMP_DIR_PATH: 临时文件夹路径 # shortcut-page SHORTCUT_NAME: 快捷键名称 diff --git a/public/i18n/zh-TW.yml b/public/i18n/zh-TW.yml index 31c627f1..4608322f 100644 --- a/public/i18n/zh-TW.yml +++ b/public/i18n/zh-TW.yml @@ -297,6 +297,7 @@ SETTINGS_TAB_SYNC_CONFIG: 同步與配置 SETTINGS_TAB_UPLOAD: 上傳設置 SETTINGS_TAB_ADVANCED: 高級設置 SETTINGS_TAB_UPDATE: 更新 +SETTINGS_GENERAL_TEMP_DIR_PATH: 本地暫存路徑 # shortcut-page SHORTCUT_NAME: 快捷鍵名稱 diff --git a/src/main/manage/events/ipcList.ts b/src/main/manage/events/ipcList.ts index 6d3f03d0..5368e496 100644 --- a/src/main/manage/events/ipcList.ts +++ b/src/main/manage/events/ipcList.ts @@ -67,6 +67,13 @@ export const manageIpcList = { return res }) + ipcMain.handle('openDirectorySelectDialog', async () => { + const res = await dialog.showOpenDialog({ + properties: ['openDirectory'] + }) + return res.filePaths[0] + }) + ipcMain.handle('openFileSelectDialog', async () => { const res = await dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] diff --git a/src/main/manage/utils/common.ts b/src/main/manage/utils/common.ts index 03ee781b..a22300ec 100644 --- a/src/main/manage/utils/common.ts +++ b/src/main/manage/utils/common.ts @@ -48,8 +48,18 @@ export function isInputConfigValid (config: any): boolean { export const getFileMimeType = (filePath: string): string => mime.lookup(filePath) || 'application/octet-stream' -const checkTempFolderExist = async () => { - const tempPath = path.join(app.getPath('downloads'), 'piclistTemp') +const getTempDirPath = () => { + const defaultPath = path.join(app.getPath('downloads'), 'piclistTemp') + try { + const configFilePath = path.join(app.getPath('userData'), 'data.json') + const { settings: { tempDirPath = '' } = {} } = fs.readJSONSync(configFilePath) || {} + return tempDirPath ? path.join(tempDirPath, 'piclistTemp') : defaultPath + } catch (e) { + return defaultPath + } +} + +const checkTempFolderExist = async (tempPath: string) => { try { await fs.access(tempPath) } catch (e) { @@ -58,8 +68,8 @@ const checkTempFolderExist = async () => { } export const downloadFileFromUrl = async (urls: string[]) => { - const tempPath = path.join(app.getPath('downloads'), 'piclistTemp') - await checkTempFolderExist() + const tempPath = getTempDirPath() + await checkTempFolderExist(tempPath) const result = [] as string[] for (let i = 0; i < urls.length; i++) { const finishDownload = promisify(Stream.finished) @@ -78,7 +88,7 @@ export const downloadFileFromUrl = async (urls: string[]) => { return result } -export const clearTempFolder = () => fs.emptyDirSync(path.join(app.getPath('downloads'), 'piclistTemp')) +export const clearTempFolder = () => fs.emptyDirSync(getTempDirPath()) export const md5 = (str: string, code: 'hex' | 'base64'): string => crypto.createHash('md5').update(str).digest(code) diff --git a/src/renderer/pages/PicGoSetting.vue b/src/renderer/pages/PicGoSetting.vue index 50237cad..00f75e92 100644 --- a/src/renderer/pages/PicGoSetting.vue +++ b/src/renderer/pages/PicGoSetting.vue @@ -194,6 +194,18 @@ {{ $T('SETTINGS_CLICK_TO_SET') }} + + + {{ $T('SETTINGS_CLICK_TO_SET') }} + + @@ -1725,7 +1737,8 @@ const form = reactive({ yourlsSignature: '', deleteLocalFile: false, serverKey: '', - aesPassword: '' + aesPassword: '', + tempDirPath: '' }) const languageList = i18nManager.languageList.map(item => ({ @@ -1890,6 +1903,7 @@ async function initData () { form.deleteLocalFile = settings.deleteLocalFile || false form.serverKey = settings.serverKey || '' form.aesPassword = settings.aesPassword || 'PicList-aesPassword' + form.tempDirPath = settings.tempDirPath || '' currentLanguage.value = settings.language ?? 'zh-CN' currentStartMode.value = settings.startMode || 'quiet' customLink.value = settings.customLink || '![$fileName]($url)' @@ -2195,6 +2209,15 @@ function handleMiniWindowOntop (val: ICheckBoxValueType) { $message.info($T('TIPS_NEED_RELOAD')) } +async function handleTempDirPath (evt: Event) { + const result = await invokeToMain('openDirectorySelectDialog') + if (result) { + form.tempDirPath = result + saveConfig('settings.tempDirPath', form.tempDirPath) + $message.info($T('TIPS_NEED_RELOAD')) + } +} + async function handleMiniIconPath (evt: Event) { const result = await invokeToMain('openFileSelectDialog') if (result && result[0]) { diff --git a/src/universal/types/i18n.d.ts b/src/universal/types/i18n.d.ts index 354d618c..0f8ec3e6 100644 --- a/src/universal/types/i18n.d.ts +++ b/src/universal/types/i18n.d.ts @@ -292,6 +292,7 @@ interface ILocales { SETTINGS_TAB_UPLOAD: string SETTINGS_TAB_ADVANCED: string SETTINGS_TAB_UPDATE: string + SETTINGS_GENERAL_TEMP_DIR_PATH: string SHORTCUT_NAME: string SHORTCUT_BIND: string SHORTCUT_STATUS: string diff --git a/src/universal/types/view.d.ts b/src/universal/types/view.d.ts index c5acabcf..83760696 100644 --- a/src/universal/types/view.d.ts +++ b/src/universal/types/view.d.ts @@ -29,7 +29,8 @@ interface ISettingForm { yourlsSignature: string, deleteLocalFile: boolean, serverKey: string, - aesPassword: string + aesPassword: string, + tempDirPath: string, } interface IShortKeyMap { From 4aae2c3fbeec190552f3e1a4f33d6a716d546c44 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Mon, 13 Nov 2023 21:07:57 -0800 Subject: [PATCH 6/9] :hammer: Refactor(custom): change default temp dir to system temp dir path ISSUES CLOSED: #112 --- public/i18n/en.yml | 1 - public/i18n/zh-CN.yml | 1 - public/i18n/zh-TW.yml | 1 - src/main/manage/events/ipcList.ts | 7 ------- src/main/manage/utils/common.ts | 9 +-------- src/renderer/pages/PicGoSetting.vue | 25 +------------------------ src/universal/types/i18n.d.ts | 1 - src/universal/types/view.d.ts | 1 - 8 files changed, 2 insertions(+), 44 deletions(-) diff --git a/public/i18n/en.yml b/public/i18n/en.yml index 07dfaf17..a27fa9dd 100644 --- a/public/i18n/en.yml +++ b/public/i18n/en.yml @@ -296,7 +296,6 @@ SETTINGS_TAB_SYNC_CONFIG: Sync and Configuration SETTINGS_TAB_UPLOAD: Upload SETTINGS_TAB_ADVANCED: Advanced SETTINGS_TAB_UPDATE: Update -SETTINGS_GENERAL_TEMP_DIR_PATH: Temporary directory path # shortcut-page BUILTIN_CLIPBOARD_TIPS: Use builtin clipboard function to upload instead of using scripts diff --git a/public/i18n/zh-CN.yml b/public/i18n/zh-CN.yml index 06c11a66..4acf3fca 100644 --- a/public/i18n/zh-CN.yml +++ b/public/i18n/zh-CN.yml @@ -299,7 +299,6 @@ SETTINGS_TAB_SYNC_CONFIG: 同步与配置 SETTINGS_TAB_UPLOAD: 上传设置 SETTINGS_TAB_ADVANCED: 高级设置 SETTINGS_TAB_UPDATE: 更新 -SETTINGS_GENERAL_TEMP_DIR_PATH: 临时文件夹路径 # shortcut-page SHORTCUT_NAME: 快捷键名称 diff --git a/public/i18n/zh-TW.yml b/public/i18n/zh-TW.yml index 4608322f..31c627f1 100644 --- a/public/i18n/zh-TW.yml +++ b/public/i18n/zh-TW.yml @@ -297,7 +297,6 @@ SETTINGS_TAB_SYNC_CONFIG: 同步與配置 SETTINGS_TAB_UPLOAD: 上傳設置 SETTINGS_TAB_ADVANCED: 高級設置 SETTINGS_TAB_UPDATE: 更新 -SETTINGS_GENERAL_TEMP_DIR_PATH: 本地暫存路徑 # shortcut-page SHORTCUT_NAME: 快捷鍵名稱 diff --git a/src/main/manage/events/ipcList.ts b/src/main/manage/events/ipcList.ts index 5368e496..6d3f03d0 100644 --- a/src/main/manage/events/ipcList.ts +++ b/src/main/manage/events/ipcList.ts @@ -67,13 +67,6 @@ export const manageIpcList = { return res }) - ipcMain.handle('openDirectorySelectDialog', async () => { - const res = await dialog.showOpenDialog({ - properties: ['openDirectory'] - }) - return res.filePaths[0] - }) - ipcMain.handle('openFileSelectDialog', async () => { const res = await dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] diff --git a/src/main/manage/utils/common.ts b/src/main/manage/utils/common.ts index a22300ec..c11031e8 100644 --- a/src/main/manage/utils/common.ts +++ b/src/main/manage/utils/common.ts @@ -49,14 +49,7 @@ export function isInputConfigValid (config: any): boolean { export const getFileMimeType = (filePath: string): string => mime.lookup(filePath) || 'application/octet-stream' const getTempDirPath = () => { - const defaultPath = path.join(app.getPath('downloads'), 'piclistTemp') - try { - const configFilePath = path.join(app.getPath('userData'), 'data.json') - const { settings: { tempDirPath = '' } = {} } = fs.readJSONSync(configFilePath) || {} - return tempDirPath ? path.join(tempDirPath, 'piclistTemp') : defaultPath - } catch (e) { - return defaultPath - } + return path.join(app.getPath('temp'), 'piclistTemp') } const checkTempFolderExist = async (tempPath: string) => { diff --git a/src/renderer/pages/PicGoSetting.vue b/src/renderer/pages/PicGoSetting.vue index 00f75e92..50237cad 100644 --- a/src/renderer/pages/PicGoSetting.vue +++ b/src/renderer/pages/PicGoSetting.vue @@ -194,18 +194,6 @@ {{ $T('SETTINGS_CLICK_TO_SET') }} - - - {{ $T('SETTINGS_CLICK_TO_SET') }} - - @@ -1737,8 +1725,7 @@ const form = reactive({ yourlsSignature: '', deleteLocalFile: false, serverKey: '', - aesPassword: '', - tempDirPath: '' + aesPassword: '' }) const languageList = i18nManager.languageList.map(item => ({ @@ -1903,7 +1890,6 @@ async function initData () { form.deleteLocalFile = settings.deleteLocalFile || false form.serverKey = settings.serverKey || '' form.aesPassword = settings.aesPassword || 'PicList-aesPassword' - form.tempDirPath = settings.tempDirPath || '' currentLanguage.value = settings.language ?? 'zh-CN' currentStartMode.value = settings.startMode || 'quiet' customLink.value = settings.customLink || '![$fileName]($url)' @@ -2209,15 +2195,6 @@ function handleMiniWindowOntop (val: ICheckBoxValueType) { $message.info($T('TIPS_NEED_RELOAD')) } -async function handleTempDirPath (evt: Event) { - const result = await invokeToMain('openDirectorySelectDialog') - if (result) { - form.tempDirPath = result - saveConfig('settings.tempDirPath', form.tempDirPath) - $message.info($T('TIPS_NEED_RELOAD')) - } -} - async function handleMiniIconPath (evt: Event) { const result = await invokeToMain('openFileSelectDialog') if (result && result[0]) { diff --git a/src/universal/types/i18n.d.ts b/src/universal/types/i18n.d.ts index 0f8ec3e6..354d618c 100644 --- a/src/universal/types/i18n.d.ts +++ b/src/universal/types/i18n.d.ts @@ -292,7 +292,6 @@ interface ILocales { SETTINGS_TAB_UPLOAD: string SETTINGS_TAB_ADVANCED: string SETTINGS_TAB_UPDATE: string - SETTINGS_GENERAL_TEMP_DIR_PATH: string SHORTCUT_NAME: string SHORTCUT_BIND: string SHORTCUT_STATUS: string diff --git a/src/universal/types/view.d.ts b/src/universal/types/view.d.ts index 83760696..1f098640 100644 --- a/src/universal/types/view.d.ts +++ b/src/universal/types/view.d.ts @@ -30,7 +30,6 @@ interface ISettingForm { deleteLocalFile: boolean, serverKey: string, aesPassword: string, - tempDirPath: string, } interface IShortKeyMap { From b8e02f66ae40a4490d70cab541a8d64cec6a9bba Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Thu, 16 Nov 2023 19:23:49 -0800 Subject: [PATCH 7/9] :arrow_up: Upgrade(custom): update dependencies and editor settings --- .vscode/settings.json | 9 +++++++-- package.json | 4 ++-- yarn.lock | 27 +++++++++------------------ 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2444ffe2..329bd7b3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,9 +20,14 @@ "stylusSupremacy.sortProperties": "grouped", "stylusSupremacy.quoteChar": "\"", "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "githubPullRequests.ignoredPullRequestBranches": [ "dev" - ] + ], + "[go]": { + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + } + } } \ No newline at end of file diff --git a/package.json b/package.json index 2f55ee0f..115e0325 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@smithy/node-http-handler": "^2.1.6", "@videojs-player/vue": "^1.0.0", "ali-oss": "^6.18.1", - "axios": "^1.6.1", + "axios": "^1.6.2", "compare-versions": "^4.1.3", "core-js": "^3.33.2", "cos-nodejs-sdk-v5": "^2.12.5", @@ -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.6.5", + "piclist": "^1.6.6", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.0", "proxy-agent": "^5.0.0", diff --git a/yarn.lock b/yarn.lock index f236ba24..611b78d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5074,19 +5074,10 @@ axios@^0.27.2: follow-redirects "^1.14.9" form-data "^4.0.0" -axios@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" - integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -axios@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.1.tgz#76550d644bf0a2d469a01f9244db6753208397d7" - integrity sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g== +axios@^1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2" + integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A== dependencies: follow-redirects "^1.15.0" form-data "^4.0.0" @@ -12359,14 +12350,14 @@ 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.6.5: - version "1.6.5" - resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.6.5.tgz#d53c78f07c152a3a07617e5ba061ebe18b18e62a" - integrity sha512-PFErxuBPL/xRzKVwmwG1e2FaUbdvHRW8ChedrkCAcRUOH9V8n3sgxZm/k03c6l3fOooEhwTZep4oDwV6lt/LyQ== +piclist@^1.6.6: + version "1.6.6" + resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.6.6.tgz#68979cbbc23390f15329e75d1a81635aa7d62814" + integrity sha512-syY0iDAyJlXBIgofPsUQt4rfx+q4V3A1kTGIMaJxDFVoo4pnX3g6UpFIJeTLHvIpurTLyXUbK9yi60WgUaq0CQ== dependencies: "@picgo/i18n" "^1.0.0" "@picgo/store" "^2.1.0" - axios "^1.6.0" + axios "^1.6.2" chalk "^2.4.1" commander "^8.1.0" cross-spawn "^7.0.3" From c897c234d2d4237190341252bc20f0ea4bce8d45 Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Fri, 17 Nov 2023 01:03:41 -0800 Subject: [PATCH 8/9] :pencil: Docs(custom): update docs --- currentVersion.md | 7 +++---- currentVersion_en.md | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/currentVersion.md b/currentVersion.md index 4da96922..3ea9ddc2 100644 --- a/currentVersion.md +++ b/currentVersion.md @@ -1,9 +1,8 @@ ✨ Features -- 现在配置同步支持使用Gitea -- 现在当图片转换后格式与原格式相同时,不会进行转换 -- 优化了使用Cloudflare R2作为图床时的删除处理 +- 核心库版本更新 +- 现在默认缓存目录会在系统temp路径下新建 🐛 Bug Fixes -- 修复了使用gitee同步配置时,下载文件错误日志没有正确记录的问题 +- 修复了使用内置服务器的删除接口时,相册删除事件不能正确触发的问题 \ No newline at end of file diff --git a/currentVersion_en.md b/currentVersion_en.md index dda902d7..66df307d 100644 --- a/currentVersion_en.md +++ b/currentVersion_en.md @@ -1,9 +1,8 @@ ✨ Features -- Now the configuration synchronization supports the use of Gitea -- Now when the converted image format is the same as the original format, it will not be converted -- Optimized the deletion processing when using Cloudflare R2 as the image bed +- Update core library version +- Now the default cache directory will be created in the system temp path 🐛 Bug Fixes -- Fixed the issue where the error log was not correctly recorded when synchronizing configurations using Gitee and downloading files +- Fixed the problem that the album delete event cannot be triggered correctly when using the built-in server delete interface From a5f16c06733ed39f7a8094879717ca9df3f1462e Mon Sep 17 00:00:00 2001 From: Kuingsmile Date: Fri, 17 Nov 2023 01:04:09 -0800 Subject: [PATCH 9/9] :tada: Release: v2.6.7 --- CHANGELOG.md | 20 ++++++++++++++++++++ package.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a374c99e..ae2ec56f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +## :tada: 2.6.7 (2023-11-17) + + +### :sparkles: Features + +* **custom:** add new config field temp dir path ([e968a65](https://github.com/Kuingsmile/piclist/commit/e968a65)), closes [#112](https://github.com/Kuingsmile/piclist/issues/112) + + +### :bug: Bug Fixes + +* **custom:** fix delete event error in server api ([5658ce6](https://github.com/Kuingsmile/piclist/commit/5658ce6)) + + +### :pencil: Documentation + +* **custom:** add docs for upload service using piclist due to a potential typora bug ([02dc71b](https://github.com/Kuingsmile/piclist/commit/02dc71b)) +* **custom:** update docs ([c897c23](https://github.com/Kuingsmile/piclist/commit/c897c23)) + + + ## :tada: 2.6.6 (2023-10-31) diff --git a/package.json b/package.json index 115e0325..81e5454d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "piclist", - "version": "2.6.6", + "version": "2.6.7", "author": { "name": "Kuingsmile", "email": "pkukuing@gmail.com"