From 9382c6e1b399011a5d5345ac6c9063bc71d48090 Mon Sep 17 00:00:00 2001 From: tanknee Date: Sat, 26 Sep 2020 19:23:59 +0800 Subject: [PATCH 01/93] =?UTF-8?q?20200925=201.=20=E8=AE=B0=E5=BF=86?= =?UTF-8?q?=E4=B8=8A=E6=AC=A1=E6=89=93=E5=BC=80=E7=9A=84=E7=AC=94=E8=AE=B0?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=202.=20=E4=BF=AE=E6=94=B9ctrl=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E7=9A=84=E5=88=A4=E5=AE=9A=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8Mac=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Vditor.vue | 7 ++----- src/store/server/actions.js | 1 + src/store/server/getters.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/Vditor.vue b/src/components/Vditor.vue index 38ffff8..b12bff0 100644 --- a/src/components/Vditor.vue +++ b/src/components/Vditor.vue @@ -86,7 +86,7 @@ export default { await files.map(async file => await that.uploadImage(file)) } }, - debugger: true, + debugger: process.env.DEV, after: () => { if (this.contentEditor?.vditor?.element) { this.contentEditor.vditor.element.addEventListener('mousedown', that.linkClickHandler) @@ -95,12 +95,10 @@ export default { }) }, registerKeyboardHotKey: function (e) { - // register ctrl+s key const key = window.event.keyCode ? window.event.keyCode : window.event.which - const { ctrlKey } = e - if (ctrlKey) { + if (helper.isCtrl(e)) { switch (key) { case 83: this.updateNote(this.contentEditor.getValue()) @@ -109,7 +107,6 @@ export default { break } } - console.log(key) }, registerEventHandler: function () { bus.$on(events.INSERT_IMAGE, url => { diff --git a/src/store/server/actions.js b/src/store/server/actions.js index a870279..598e8e6 100644 --- a/src/store/server/actions.js +++ b/src/store/server/actions.js @@ -138,6 +138,7 @@ export default { async updateCurrentCategory ({ commit }, category) { await this.dispatch('server/getCategoryNotes', { category }) commit(types.UPDATE_CURRENT_CATEGORY, category) + commit(types.SAVE_TO_LOCAL_STORE_SYNC, ['currentCategory', category]) }, /** * 更新笔记信息,例如笔记title等 diff --git a/src/store/server/getters.js b/src/store/server/getters.js index 0406b95..d984416 100644 --- a/src/store/server/getters.js +++ b/src/store/server/getters.js @@ -49,7 +49,7 @@ export default { } else { result = helper.extractMarkdownFromMDNote(html, kbGuid, docGuid, resources) } - return result + return helper.isNullOrEmpty(result) ? `# ${currentNote.info.title}` : result }, categories: ({ categories }) => { return helper.generateCategoryNodeTree(categories) From 0f739f2cf6b1da49adb90b9bbbb81bbf996ff869 Mon Sep 17 00:00:00 2001 From: TankNee Date: Sat, 26 Sep 2020 20:22:09 +0800 Subject: [PATCH 02/93] Create main.yml --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3f42e4d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +# This is a basic workflow to help you get started with Actions + +name: Neeto-Vue Release Action + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: windows-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Check out branch + uses: actions/checkout@master + + - name: Install Node.js, NPM and Yarn + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: Build + run: | + - npm install + - npm run build-all From 85644ffda3750c5412b625798dc8542b6fa14431 Mon Sep 17 00:00:00 2001 From: TankNee Date: Sat, 26 Sep 2020 20:25:06 +0800 Subject: [PATCH 03/93] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f42e4d..5dd9a40 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,5 +30,5 @@ jobs: - name: Build run: | - - npm install - - npm run build-all + npm install + npm run build-all From 1967c25fb1d9216fd6060449cb03d67bbc105e3c Mon Sep 17 00:00:00 2001 From: TankNee Date: Sat, 26 Sep 2020 21:34:50 +0800 Subject: [PATCH 04/93] Update main.yml --- .github/workflows/main.yml | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5dd9a40..79192f8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,3 +32,57 @@ jobs: run: | npm install npm run build-all + - name: Upload Win Package + uses: actions/upload-artifact@v1 + with: + name: Linux_Dist + path: dist/electron/Neeto-Vue-win32-x64 + - name: Upload Win Package + uses: actions/upload-artifact@v1 + with: + name: Windows_Dist + path: dist/electron/Neeto-Vue-linux-x64 + - name: Upload Win Package + uses: actions/upload-artifact@v1 + with: + name: MacOS_Dist + path: dist/electron/Neeto-Vue-darwin-x64 + release: + needs: [build] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Download pre-built packages for Linux + uses: actions/download-artifact@v1 + with: + name: Linux_Dist + path: artifacts + - name: Download pre-built packages for Windows + uses: actions/download-artifact@v1 + with: + name: Windows_Dist + path: artifacts + - name: Download pre-built packages for MacOS + uses: actions/download-artifact@v1 + with: + name: MacOS_Dist + path: artifacts + - name: Create Release Notes + id: release_notes + run: | + version=0.0.5 + notes_zh="CHANGELOG.md" + content=$(cat ${notes_zh}) + printf "${content}\n" > dist/changes-${version}.md + echo "::set-output name=version::${version}" + echo "::set-output name=content_file::dist/changes-${version}.md" + - name: Create Release + id: create_release + uses: ncipollo/release-action@v1 + with: + name: Neeto-Vue v${{ steps.release_notes.outputs.version }} + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: "artifacts/*" + bodyFile: ${{ steps.release_notes.outputs.content_file }} + draft: true + prerelease: true From 4d09b67aa9a76508e0b39514c76b01f2a01cb1b8 Mon Sep 17 00:00:00 2001 From: TankNee Date: Sat, 26 Sep 2020 21:43:07 +0800 Subject: [PATCH 05/93] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79192f8..bd57480 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,7 +75,7 @@ jobs: content=$(cat ${notes_zh}) printf "${content}\n" > dist/changes-${version}.md echo "::set-output name=version::${version}" - echo "::set-output name=content_file::dist/changes-${version}.md" + echo "::set-output name=content_file::${version}" - name: Create Release id: create_release uses: ncipollo/release-action@v1 From 51f0f109dd39c035078fb75e6e9fc9b8c83f7491 Mon Sep 17 00:00:00 2001 From: TankNee Date: Sat, 26 Sep 2020 21:53:58 +0800 Subject: [PATCH 06/93] Update and rename main.yml to BuildAndRelease.yml --- .github/workflows/{main.yml => BuildAndRelease.yml} | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) rename .github/workflows/{main.yml => BuildAndRelease.yml} (96%) diff --git a/.github/workflows/main.yml b/.github/workflows/BuildAndRelease.yml similarity index 96% rename from .github/workflows/main.yml rename to .github/workflows/BuildAndRelease.yml index bd57480..4477306 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -7,8 +7,6 @@ name: Neeto-Vue Release Action on: push: branches: [ master ] - pull_request: - branches: [ master ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -37,12 +35,12 @@ jobs: with: name: Linux_Dist path: dist/electron/Neeto-Vue-win32-x64 - - name: Upload Win Package + - name: Upload Linux Package uses: actions/upload-artifact@v1 with: name: Windows_Dist path: dist/electron/Neeto-Vue-linux-x64 - - name: Upload Win Package + - name: Upload Mac Package uses: actions/upload-artifact@v1 with: name: MacOS_Dist From a2dc59756cd172c097cf6647ecc00f23a6e0b56c Mon Sep 17 00:00:00 2001 From: TankNee Date: Sat, 26 Sep 2020 22:02:57 +0800 Subject: [PATCH 07/93] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 4477306..ccda64d 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -65,22 +65,12 @@ jobs: with: name: MacOS_Dist path: artifacts - - name: Create Release Notes - id: release_notes - run: | - version=0.0.5 - notes_zh="CHANGELOG.md" - content=$(cat ${notes_zh}) - printf "${content}\n" > dist/changes-${version}.md - echo "::set-output name=version::${version}" - echo "::set-output name=content_file::${version}" - name: Create Release id: create_release uses: ncipollo/release-action@v1 with: - name: Neeto-Vue v${{ steps.release_notes.outputs.version }} + name: Neeto-Vue New Version token: ${{ secrets.GITHUB_TOKEN }} artifacts: "artifacts/*" - bodyFile: ${{ steps.release_notes.outputs.content_file }} draft: true prerelease: true From db077cb387b863b8b10467c1d065deec62b4be76 Mon Sep 17 00:00:00 2001 From: TankNee Date: Sat, 26 Sep 2020 22:57:25 +0800 Subject: [PATCH 08/93] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index ccda64d..ad1ad59 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -6,7 +6,10 @@ name: Neeto-Vue Release Action # events but only for the master branch on: push: - branches: [ master ] + branches: + - master + tags: + - v0.* # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -48,6 +51,7 @@ jobs: release: needs: [build] runs-on: ubuntu-latest + if: contains(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v1 - name: Download pre-built packages for Linux @@ -69,7 +73,7 @@ jobs: id: create_release uses: ncipollo/release-action@v1 with: - name: Neeto-Vue New Version + name: Neeto-Vue New v0.0.6 token: ${{ secrets.GITHUB_TOKEN }} artifacts: "artifacts/*" draft: true From 5a7bdddb304e3742f71d72b96f8174a71ca43921 Mon Sep 17 00:00:00 2001 From: tanknee Date: Sat, 26 Sep 2020 23:04:13 +0800 Subject: [PATCH 09/93] =?UTF-8?q?20200926=201.=20=E6=9B=B4=E6=96=B0ChangeL?= =?UTF-8?q?og?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 799d33e..aa46c53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGE LOG +## 2020 09 26 Update 0.0.5 + +1. 优化Ctrl键的逻辑 + ## 2020 09 25 Update 0.0.4 1. 优化macos下的header显示 @@ -17,4 +21,4 @@ 2. 记得要先点击图片要插入的位置,否则会直接插入到上一次点击的地方,我暂时没找到办法修复 3. 修复编辑器区域大小的问题 4. 添加笔记修改日期的显示 -5. 修复了翻译缺失的问题 \ No newline at end of file +5. 修复了翻译缺失的问题 From aafd75458770f1fff14af7fb3f2392d71b78e155 Mon Sep 17 00:00:00 2001 From: tanknee Date: Sat, 26 Sep 2020 23:11:48 +0800 Subject: [PATCH 10/93] =?UTF-8?q?20200926=201.=20=E6=9B=B4=E6=96=B0ChangeL?= =?UTF-8?q?og?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 799d33e..886421a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGE LOG +## 2020 09 26 Update 0.0.5 + +1. 添加github自动构建 + + ## 2020 09 25 Update 0.0.4 1. 优化macos下的header显示 @@ -17,4 +22,4 @@ 2. 记得要先点击图片要插入的位置,否则会直接插入到上一次点击的地方,我暂时没找到办法修复 3. 修复编辑器区域大小的问题 4. 添加笔记修改日期的显示 -5. 修复了翻译缺失的问题 \ No newline at end of file +5. 修复了翻译缺失的问题 From 72f9d11e44489ad37dfc0af0e8eb77cccbbacffd Mon Sep 17 00:00:00 2001 From: TankNee Date: Sat, 26 Sep 2020 23:18:35 +0800 Subject: [PATCH 11/93] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index ad1ad59..90451a1 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -36,12 +36,12 @@ jobs: - name: Upload Win Package uses: actions/upload-artifact@v1 with: - name: Linux_Dist + name: Windows_Dist path: dist/electron/Neeto-Vue-win32-x64 - name: Upload Linux Package uses: actions/upload-artifact@v1 with: - name: Windows_Dist + name: Linux_Dist path: dist/electron/Neeto-Vue-linux-x64 - name: Upload Mac Package uses: actions/upload-artifact@v1 From 5cb09e654e1a12b430a952a4ec5e0debaa211457 Mon Sep 17 00:00:00 2001 From: TankNee Date: Sun, 27 Sep 2020 09:30:03 +0800 Subject: [PATCH 12/93] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 90451a1..ea1e99a 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -33,21 +33,26 @@ jobs: run: | npm install npm run build-all + - name: Compress Bundle + run: | + zip -r Neeto-Vue-win32-x64.zip dist/electron/Neeto-Vue-win32-x64 + zip -r Neeto-Vue-linux-x64.zip dist/electron/Neeto-Vue-linux-x64 + zip -r Neeto-Vue-darwin-x64.zip dist/electron/Neeto-Vue-darwin-x64 - name: Upload Win Package uses: actions/upload-artifact@v1 with: name: Windows_Dist - path: dist/electron/Neeto-Vue-win32-x64 + path: Neeto-Vue-win32-x64.zip - name: Upload Linux Package uses: actions/upload-artifact@v1 with: name: Linux_Dist - path: dist/electron/Neeto-Vue-linux-x64 + path: Neeto-Vue-linux-x64.zip - name: Upload Mac Package uses: actions/upload-artifact@v1 with: name: MacOS_Dist - path: dist/electron/Neeto-Vue-darwin-x64 + path: Neeto-Vue-darwin-x64.zip release: needs: [build] runs-on: ubuntu-latest From 1e7da43bb229818e51e81d932da924a7978c5508 Mon Sep 17 00:00:00 2001 From: TankNee Date: Sun, 27 Sep 2020 09:40:48 +0800 Subject: [PATCH 13/93] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index ea1e99a..2d66e10 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -35,9 +35,10 @@ jobs: npm run build-all - name: Compress Bundle run: | - zip -r Neeto-Vue-win32-x64.zip dist/electron/Neeto-Vue-win32-x64 - zip -r Neeto-Vue-linux-x64.zip dist/electron/Neeto-Vue-linux-x64 - zip -r Neeto-Vue-darwin-x64.zip dist/electron/Neeto-Vue-darwin-x64 + npm install -g bestzip + bestzip -r Neeto-Vue-win32-x64.zip dist/electron/Neeto-Vue-win32-x64 + bestzip -r Neeto-Vue-linux-x64.zip dist/electron/Neeto-Vue-linux-x64 + bestzip -r Neeto-Vue-darwin-x64.zip dist/electron/Neeto-Vue-darwin-x64 - name: Upload Win Package uses: actions/upload-artifact@v1 with: From 8a28e1a95ebeee5e547ed4d7bfcb86e3263adf3b Mon Sep 17 00:00:00 2001 From: TankNee Date: Sun, 27 Sep 2020 09:47:48 +0800 Subject: [PATCH 14/93] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 2d66e10..c3d7ae4 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -36,9 +36,9 @@ jobs: - name: Compress Bundle run: | npm install -g bestzip - bestzip -r Neeto-Vue-win32-x64.zip dist/electron/Neeto-Vue-win32-x64 - bestzip -r Neeto-Vue-linux-x64.zip dist/electron/Neeto-Vue-linux-x64 - bestzip -r Neeto-Vue-darwin-x64.zip dist/electron/Neeto-Vue-darwin-x64 + bestzip Neeto-Vue-win32-x64.zip dist/electron/Neeto-Vue-win32-x64/* + bestzip Neeto-Vue-linux-x64.zip dist/electron/Neeto-Vue-linux-x64/* + bestzip Neeto-Vue-darwin-x64.zip dist/electron/Neeto-Vue-darwin-x64/* - name: Upload Win Package uses: actions/upload-artifact@v1 with: From 34ac6134ac91cfc1cb3a2cde2502924318f4204d Mon Sep 17 00:00:00 2001 From: TankNee Date: Sun, 27 Sep 2020 10:07:50 +0800 Subject: [PATCH 15/93] Update BuildAndRelease.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加条件,只有在带tag的时候才会构建 --- .github/workflows/BuildAndRelease.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index c3d7ae4..7c9f812 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -9,7 +9,7 @@ on: branches: - master tags: - - v0.* + - v* # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -17,7 +17,7 @@ jobs: build: # The type of runner that the job will run on runs-on: windows-latest - + if: contains(github.ref, 'refs/tags/v') # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it From 016b499b2ed475395359a0f363bed10e7449a26d Mon Sep 17 00:00:00 2001 From: TankNee Date: Sun, 27 Sep 2020 10:10:23 +0800 Subject: [PATCH 16/93] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 7c9f812..4b5f91c 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -79,7 +79,7 @@ jobs: id: create_release uses: ncipollo/release-action@v1 with: - name: Neeto-Vue New v0.0.6 + name: Neeto-Vue token: ${{ secrets.GITHUB_TOKEN }} artifacts: "artifacts/*" draft: true From 5db24eaaf7f4216dffcdc3cd5d85e496494dd041 Mon Sep 17 00:00:00 2001 From: TankNee Date: Sun, 27 Sep 2020 10:22:33 +0800 Subject: [PATCH 17/93] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 54 ++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 4b5f91c..64df177 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -14,7 +14,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" - build: + build-windows: # The type of runner that the job will run on runs-on: windows-latest if: contains(github.ref, 'refs/tags/v') @@ -24,7 +24,7 @@ jobs: - name: Check out branch uses: actions/checkout@master - - name: Install Node.js, NPM and Yarn + - name: Install Node.js, NPM uses: actions/setup-node@v1 with: node-version: 14 @@ -32,30 +32,72 @@ jobs: - name: Build run: | npm install - npm run build-all + npm run build-publish - name: Compress Bundle run: | npm install -g bestzip bestzip Neeto-Vue-win32-x64.zip dist/electron/Neeto-Vue-win32-x64/* - bestzip Neeto-Vue-linux-x64.zip dist/electron/Neeto-Vue-linux-x64/* - bestzip Neeto-Vue-darwin-x64.zip dist/electron/Neeto-Vue-darwin-x64/* - name: Upload Win Package uses: actions/upload-artifact@v1 with: name: Windows_Dist path: Neeto-Vue-win32-x64.zip + build-linux: + # The type of runner that the job will run on + runs-on: ubuntu-latest + if: contains(github.ref, 'refs/tags/v') + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Check out branch + uses: actions/checkout@master + + - name: Install Node.js, NPM + uses: actions/setup-node@v1 + with: + node-version: 14 + - name: Build + run: | + npm install + npm run build-publish + - name: Compress Bundle + run: | + npm install -g bestzip + bestzip Neeto-Vue-linux-x64.zip dist/electron/Neeto-Vue-linux-x64/* - name: Upload Linux Package uses: actions/upload-artifact@v1 with: name: Linux_Dist path: Neeto-Vue-linux-x64.zip + build-mac: + # The type of runner that the job will run on + runs-on: macos-latest + if: contains(github.ref, 'refs/tags/v') + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Check out branch + uses: actions/checkout@master + + - name: Install Node.js, NPM + uses: actions/setup-node@v1 + with: + node-version: 14 + - name: Build + run: | + npm install + npm run build-publish + - name: Compress Bundle + run: | + npm install -g bestzip + bestzip Neeto-Vue-darwin-x64.zip dist/electron/Neeto-Vue-darwin-x64/* - name: Upload Mac Package uses: actions/upload-artifact@v1 with: name: MacOS_Dist path: Neeto-Vue-darwin-x64.zip release: - needs: [build] + needs: [build-windows] runs-on: ubuntu-latest if: contains(github.ref, 'refs/tags/v') steps: From c44e0a836854f6f888914f22c467302de4ba4afa Mon Sep 17 00:00:00 2001 From: TankNee Date: Sun, 27 Sep 2020 10:23:44 +0800 Subject: [PATCH 18/93] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 64df177..ea249e7 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -97,7 +97,7 @@ jobs: name: MacOS_Dist path: Neeto-Vue-darwin-x64.zip release: - needs: [build-windows] + needs: [build-windows, build-linux, build-mac] runs-on: ubuntu-latest if: contains(github.ref, 'refs/tags/v') steps: From 5853775dcd3a1a448062708c3667f324d0e8bab7 Mon Sep 17 00:00:00 2001 From: tanknee Date: Sun, 27 Sep 2020 17:41:15 +0800 Subject: [PATCH 19/93] =?UTF-8?q?20200927=201.=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=99=BB=E5=BD=95=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 6 +++--- src/components/Header.vue | 19 ++++++++++++++----- src/components/ui/LoginDialog.vue | 7 ++++++- src/store/server/actions.js | 4 ++-- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3e44803..9eaba1d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,11 +15,11 @@ const { mapActions: mapClientActions } = createNamespacedHelpers('client') const { mapActions: mapServerActions, mapState: mapServerState } = createNamespacedHelpers('server') export default { name: 'App', - mounted () { + async mounted () { RegisterErrorHandler() RegisterScheduleJobs(this) - this.initClientStore() - this.initServerStore() + await this.initClientStore() + await this.initServerStore() }, methods: { ...mapClientActions(['initClientStore']), diff --git a/src/components/Header.vue b/src/components/Header.vue index e942326..d447a56 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -11,13 +11,13 @@ {{ $t('noteCategory') }} + >{{ $t('noteCategory') }} diff --git a/src/components/ui/LoginDialog.vue b/src/components/ui/LoginDialog.vue index 52a63fc..02a3460 100644 --- a/src/components/ui/LoginDialog.vue +++ b/src/components/ui/LoginDialog.vue @@ -1,5 +1,10 @@ - + diff --git a/src/components/Vditor.vue b/src/components/Vditor.vue index b12bff0..f08b01e 100644 --- a/src/components/Vditor.vue +++ b/src/components/Vditor.vue @@ -5,6 +5,7 @@ class="fit" style="max-width: 80%" v-show="!isCurrentNoteLoading && dataLoaded" + v-close-popup > @@ -135,13 +136,14 @@ export default { } return false }, - ...mapServerActions(['updateNote', 'uploadImage']) + ...mapServerActions(['updateNote', 'uploadImage', 'updateContentsList']) }, watch: { currentNote: function (currentData) { try { this.contentEditor.setValue(currentData, true) this.contentEditor.focus() + this.updateContentsList(this.contentEditor.vditor.ir.element) } catch (e) { if (e.message.indexOf('Md2V') !== -1) return debugLogger.Error(e.message) diff --git a/src/components/ui/CategoryDrawer.vue b/src/components/ui/CategoryDrawer.vue index a81ef3f..e43190d 100644 --- a/src/components/ui/CategoryDrawer.vue +++ b/src/components/ui/CategoryDrawer.vue @@ -12,7 +12,6 @@ :class="`exclude-header note-list${$q.dark.isActive ? '-dark' : ''}`" >
+ @@ -58,11 +60,12 @@ import bus from 'components/bus' import events from 'src/constants/events' import helper from 'src/utils/helper' import { createNamespacedHelpers } from 'vuex' -const { mapGetters } = createNamespacedHelpers('server') +import NoteOutline from 'components/NoteOutline' +const { mapGetters, mapState } = createNamespacedHelpers('server') // import Sidebar from '../components/Sidebar' export default { name: 'PageIndex', - components: { Vditor, NoteList }, + components: { NoteOutline, Vditor, NoteList }, computed: { thumbStyle () { return { @@ -78,10 +81,13 @@ export default { } }, dataLoaded: function () { - console.log(this.currentNote) return !helper.isNullOrEmpty(this.currentNote) }, - ...mapGetters(['currentNote']) + contentsListLoaded: function () { + return !!this.contentsList.length + }, + ...mapGetters(['currentNote']), + ...mapState(['contentsList']) }, data () { return { @@ -92,6 +98,16 @@ export default { refreshCurrentNote: function () { bus.$emit(events.SAVE_NOTE) } + }, + mounted () { + const that = this + bus.$on(events.SCROLL_TO_HEADER, (item) => { + if (!item.element) return + const rect = item.element.getBoundingClientRect() + const top = that.$refs.vditorScrollArea.getScrollPosition() + + rect.top - window.innerHeight * 0.065 + that.$refs.vditorScrollArea.setScrollPosition(top, 300) + }) } } diff --git a/src/store/server/actions.js b/src/store/server/actions.js index eaf3078..dfc8a7a 100644 --- a/src/store/server/actions.js +++ b/src/store/server/actions.js @@ -167,7 +167,7 @@ export default { const { kbGuid, docGuid, category, title } = state.currentNote.info const { resources } = state.currentNote const isLite = category.replace(/\//g, '') === 'Lite' - await api.KnowledgeBaseApi.updateNote({ + const result = await api.KnowledgeBaseApi.updateNote({ kbGuid, docGuid, data: { @@ -186,6 +186,7 @@ export default { icon: 'check' }) await this.dispatch('server/getCategoryNotes') + commit(types.UPDATE_CURRENT_NOTE, result) }, /** * 创建笔记 @@ -369,5 +370,9 @@ export default { if (isCurrentCategory || helper.isNullOrEmpty(currentCategory)) { await this.dispatch('server/getCategoryNotes') } + }, + updateContentsList ({ commit }, editorRootElement) { + const list = helper.updateContentsList(editorRootElement) + commit(types.UPDATE_CONTENTS_LIST, list) } } diff --git a/src/store/server/mutations.js b/src/store/server/mutations.js index c3a37bc..e76ec56 100644 --- a/src/store/server/mutations.js +++ b/src/store/server/mutations.js @@ -38,7 +38,13 @@ export default { return state }, [types.UPDATE_CURRENT_NOTE] (state, payload) { - state.currentNote = payload + if (payload.html) { + state.currentNote = payload + } else { + const { currentNote } = state + currentNote.info = payload + state.currentNote = currentNote + } return state }, [types.SAVE_TO_LOCAL_STORE_SYNC] (state, [key, value]) { @@ -63,5 +69,8 @@ export default { }, [types.CLEAR_CURRENT_NOTE] (state) { state.currentNote = {} + }, + [types.UPDATE_CONTENTS_LIST] (state, list) { + state.contentsList = list } } diff --git a/src/store/server/state.js b/src/store/server/state.js index 55f6d5d..be13eb7 100644 --- a/src/store/server/state.js +++ b/src/store/server/state.js @@ -13,6 +13,7 @@ export default function () { isCurrentNotesLoading: false, // current notes loading state, categories: [], currentCategory: '', - uploadImageUrl: '' + uploadImageUrl: '', + contentsList: [] } } diff --git a/src/store/server/types.js b/src/store/server/types.js index fca2a25..b4ece60 100644 --- a/src/store/server/types.js +++ b/src/store/server/types.js @@ -9,5 +9,6 @@ export default { UPDATE_CURRENT_CATEGORY: 'update_current_category', UPDATE_CURRENT_NOTE_LOADING_STATE: 'update_current_note_loading_state', UPDATE_CURRENT_NOTES_LOADING_STATE: 'update_current_notes_loading_state', - CLEAR_CURRENT_NOTE: 'clear_current_note' + CLEAR_CURRENT_NOTE: 'clear_current_note', + UPDATE_CONTENTS_LIST: 'update_contents_list' } diff --git a/src/utils/helper.js b/src/utils/helper.js index c775261..ac1cea4 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -196,6 +196,12 @@ function getFileNameWithExt (filePath) { return fileName } + +/** + * 兼容Windows与MacOS的Ctrl键判断 + * @param event + * @returns {boolean} + */ function isCtrl (event) { if (Platform.is.mac) { if (event.metaKey && !event.ctrlKey) { @@ -223,6 +229,78 @@ function filterParentElement (dom, root, filterFn, self = false) { } return null } + +/** + * 更新笔记目录数据结构 + * @param {HTMLElement} editorRootElement + */ +function updateContentsList (editorRootElement) { + const list = [] + for (let i = 0; i < editorRootElement.childElementCount; i++) { + const tagName = editorRootElement.children[i].tagName.toLowerCase() + if (/^h[1-6]$/.test(tagName)) { + const rank = parseInt(tagName[1], 10) + if (list.length) { + let target = list + for (let j = 1; j < rank; j++) { + if (target.length === 0) { + target.push({ + key: `${i}-${rank}`, + children: [], + open: true + }) + } else if (!target[target.length - 1].children) { + target[target.length - 1].children = [] + } + target = target[target.length - 1].children + } + target.push({ + key: `${i}-${rank}`, + label: editorRootElement.children[i].innerText.replace(/^#+\s/, ''), + element: editorRootElement.children[i], + open: true, + selectable: true + }) + } else { + list.push({}) + let item = list[list.length - 1] + for (let j = 0; j < rank; j++) { + if (j === rank - 1) { + item.key = `${i}-${j}` + item.label = editorRootElement.children[i].innerText.replace( + /^#+\s/, + '' + ) + item.element = editorRootElement.children[i] + } else { + item.key = `${i}-${j}` + item.children = [{}] + item = item.children[0] + } + item.open = true + item.selectable = true + } + } + } + } + return list +} + +/** + * 根据key查找node对象 + * @param {node[]} nodeList + * @param {string} key + * @returns {null|*} + */ +function findNodeByNodeKey (nodeList, key) { + for (let i = 0; i < nodeList.length; i++) { + if (nodeList[i].key === key) return nodeList[i] + if (!nodeList[i].children) continue + const node = findNodeByNodeKey(nodeList[i].children, key) + if (node) return node + } + return null +} export default { isNullOrEmpty, convertHtml2Markdown, @@ -232,7 +310,9 @@ export default { embedMDNote, displayDateElegantly, createFileSelectDialog, + updateContentsList, getFileNameWithExt, isCtrl, - filterParentElement + filterParentElement, + findNodeByNodeKey } From c51944058e617730bc8c3faf1561f9f36eeaa555 Mon Sep 17 00:00:00 2001 From: tanknee Date: Thu, 1 Oct 2020 10:14:48 +0800 Subject: [PATCH 25/93] =?UTF-8?q?202001001=201.=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=8C=E7=82=B9=E5=87=BB=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=9A=90=E8=97=8F=E7=9B=AE=E5=BD=95=202.=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NoteList.vue | 1 + src/components/NoteOutline.vue | 12 +++++++++++- src/components/Sidebar.vue | 4 +++- src/components/Vditor.vue | 12 ++++++------ src/css/style.css | 6 ++++++ src/pages/Index.vue | 9 ++++++--- src/utils/helper.js | 4 +++- 7 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/components/NoteList.vue b/src/components/NoteList.vue index 764c503..73aacac 100644 --- a/src/components/NoteList.vue +++ b/src/components/NoteList.vue @@ -27,6 +27,7 @@ {{category}} diff --git a/src/components/NoteOutline.vue b/src/components/NoteOutline.vue index 7bf601f..e2198b0 100644 --- a/src/components/NoteOutline.vue +++ b/src/components/NoteOutline.vue @@ -21,6 +21,7 @@ selected-color="primary" class="non-selectable" :selected.sync="selected" + :expanded.sync="expanded" @update:selected="v => { $refs.drawer.hide() nodeClickHandler(v) @@ -29,6 +30,14 @@ /> + @@ -59,7 +68,8 @@ export default { }, data () { return { - selected: '' + selected: '', + expanded: [] } }, methods: { diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 39f43b2..d033907 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -9,6 +9,7 @@ + @@ -16,9 +17,10 @@ diff --git a/src/components/Vditor.vue b/src/components/Vditor.vue index d53d836..52e367d 100644 --- a/src/components/Vditor.vue +++ b/src/components/Vditor.vue @@ -40,12 +40,7 @@ export default { ...mapServerGetters(['currentNote', 'uploadImageUrl']), ...mapServerState(['isCurrentNoteLoading', 'contentsList']), ...mapClientState([ - 'darkMode', - 'apiServerUrl', - 'postParam', - 'jsonPath', - 'customHeader', - 'customBody' + 'darkMode' ]) }, data () { diff --git a/src/css/vditor.css b/src/css/vditor.css index 54fda82..5eb0d9a 100644 --- a/src/css/vditor.css +++ b/src/css/vditor.css @@ -798,6 +798,7 @@ line-height: 28px; font-size: 16px; word-break: break-word; + padding-bottom: 30px; } .vditor-reset--anchor { padding-left: 20px; diff --git a/src/pages/Index.vue b/src/pages/Index.vue index 02266ae..4d9b4cc 100644 --- a/src/pages/Index.vue +++ b/src/pages/Index.vue @@ -20,6 +20,11 @@ > + + From bcf4afabafc6ca97e4f1ed18ea1dc14a571d8155 Mon Sep 17 00:00:00 2001 From: tanknee Date: Tue, 6 Oct 2020 18:00:12 +0800 Subject: [PATCH 35/93] =?UTF-8?q?202001007=201.=20=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E7=AE=80=E6=98=93=E7=9A=84=E7=AC=94=E8=AE=B0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=8F=90=E5=8D=87=E7=AC=94=E8=AE=B0=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- quasar.conf.js | 4 +- src/components/ui/dialog/SettingsDialog.vue | 14 +++++- .../en-us/components/ui/SettingsDialog.js | 3 +- .../zh-cn/components/ui/SettingsDialog.js | 3 +- src/store/server/actions.js | 47 +++++++++++++++---- src/utils/api.js | 12 ++++- src/utils/fileStorage.js | 24 ++++++++++ 8 files changed, 93 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index ed78d35..d45d896 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neeto.vue.elctron", - "version": "0.0.6", + "version": "0.0.9", "description": "An Awesome WizNote Desktop Application", "productName": "Neeto-Vue", "author": "tanknee ", diff --git a/quasar.conf.js b/quasar.conf.js index 8b4b294..86931cc 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -109,9 +109,9 @@ module.exports = function (/* ctx */) { ] }, - animations: 'all', // --- includes all animations + // animations: 'all', // --- includes all animations // https://quasar.dev/options/animations - // animations: [], + animations: ['fadeIn', 'fadeOut'], // https://quasar.dev/quasar-cli/developing-ssr/configuring-ssr ssr: { diff --git a/src/components/ui/dialog/SettingsDialog.vue b/src/components/ui/dialog/SettingsDialog.vue index 4aa24c6..db2087a 100644 --- a/src/components/ui/dialog/SettingsDialog.vue +++ b/src/components/ui/dialog/SettingsDialog.vue @@ -72,6 +72,13 @@ /> + +
+
+ {{ $t('currentVersion',{version}) }} + +
+
@@ -122,6 +129,7 @@ import { createNamespacedHelpers } from 'vuex' import ImageUploadServiceDialog from './ImageUploadServiceDialog' import { i18n } from 'boot/i18n' +import { version } from '../../../../package.json' const { mapState, mapActions } = createNamespacedHelpers('client') export default { @@ -140,7 +148,8 @@ export default { 'wizOfficialImageUploadService', 'customWebUploadService', 'smmsImageUploadService' - ] + ], + version: version } }, computed: { @@ -173,6 +182,9 @@ export default { ) this.updateStateAndStore({ imageUploadService: servicePlain }) }, + checkUpdateHandler: function () { + this.$q.electron.shell.openExternal('https://github.com/TankNee/Neeto-Vue/releases') + }, ...mapActions([ 'toggleDarkMode', 'toggleChanged', diff --git a/src/i18n/en-us/components/ui/SettingsDialog.js b/src/i18n/en-us/components/ui/SettingsDialog.js index 4b84f3b..ea9fca9 100644 --- a/src/i18n/en-us/components/ui/SettingsDialog.js +++ b/src/i18n/en-us/components/ui/SettingsDialog.js @@ -10,5 +10,6 @@ export default { imageUploadService: 'Image Upload Service', wizOfficialImageUploadService: 'WizNote Official Image Upload Service (unavailable)', customWebUploadService: 'Custom Web Image Upload Service', - smmsImageUploadService: 'SMMS Image Upload Service (unavailable)' + smmsImageUploadService: 'SMMS Image Upload Service (unavailable)', + currentVersion: 'Current Version: {version}' } diff --git a/src/i18n/zh-cn/components/ui/SettingsDialog.js b/src/i18n/zh-cn/components/ui/SettingsDialog.js index 8949b90..314413d 100644 --- a/src/i18n/zh-cn/components/ui/SettingsDialog.js +++ b/src/i18n/zh-cn/components/ui/SettingsDialog.js @@ -10,5 +10,6 @@ export default { imageUploadService: '图片上传服务', wizOfficialImageUploadService: '为知官方图片上传服务 (暂时不可用)', customWebUploadService: '自定义Web图片服务器', - smmsImageUploadService: 'SMMS图片上传服务 (暂时不可用)' + smmsImageUploadService: 'SMMS图片上传服务 (暂时不可用)', + currentVersion: '当前版本: {version}' } diff --git a/src/store/server/actions.js b/src/store/server/actions.js index 3c32bb9..244d420 100644 --- a/src/store/server/actions.js +++ b/src/store/server/actions.js @@ -116,15 +116,30 @@ export default { commit(types.UPDATE_CURRENT_NOTE_LOADING_STATE, true) const { kbGuid } = state const { docGuid } = payload - - const result = await api.KnowledgeBaseApi.getNoteContent({ + const { info } = await api.KnowledgeBaseApi.getNoteContent({ kbGuid, docGuid, data: { - downloadInfo: 1, - downloadData: 1 + downloadInfo: 1 } }) + // dataModified + const cacheKey = api.KnowledgeBaseApi.getCacheKey(kbGuid, docGuid) + const note = fileStorage.getCachedNote(info, cacheKey) + let result + if (!helper.isNullOrEmpty(note)) { + result = note + } else { + result = await api.KnowledgeBaseApi.getNoteContent({ + kbGuid, + docGuid, + data: { + downloadInfo: 1, + downloadData: 1 + } + }) + fileStorage.setCachedNote(result, cacheKey) + } commit(types.UPDATE_CURRENT_NOTE, result) commit(types.UPDATE_CURRENT_NOTE_LOADING_STATE, false) @@ -167,19 +182,21 @@ export default { const { kbGuid, docGuid, category, title } = state.currentNote.info const { resources } = state.currentNote const isLite = category.replace(/\//g, '') === 'Lite' + const html = helper.embedMDNote(markdown, { wrapWithPreTag: isLite }) const result = await api.KnowledgeBaseApi.updateNote({ kbGuid, docGuid, data: { + html, title, kbGuid, docGuid, category, resources, - html: helper.embedMDNote(markdown, { wrapWithPreTag: isLite }), type: isLite ? 'lite/markdown' : 'document' } }) + fileStorage.setCachedNote({ info: result, html }, api.KnowledgeBaseApi.getCacheKey(kbGuid, docGuid)) Notify.create({ color: 'primary', message: i18n.t('saveNoteSuccessfully'), @@ -296,7 +313,8 @@ export default { } } = rootState - let data = {}, options = {} + let data = {}, + options = {} switch (imageUploadService) { case 'wizOfficialImageUploadService': formData.append('data', file) @@ -333,12 +351,19 @@ export default { const result = await api.UploadImageApi(imageUploadService, data, options) if (result) { - bus.$emit(events.INSERT_IMAGE, getters.imageUrl(result, imageUploadService)) + bus.$emit( + events.INSERT_IMAGE, + getters.imageUrl(result, imageUploadService) + ) } }, async moveNote ({ commit }, noteInfo) { const { kbGuid, docGuid } = noteInfo - await api.KnowledgeBaseApi.updateNoteInfo({ kbGuid, docGuid, data: noteInfo }) + await api.KnowledgeBaseApi.updateNoteInfo({ + kbGuid, + docGuid, + data: noteInfo + }) await this.dispatch('server/getCategoryNotes') }, async copyNote ({ commit, state }, noteInfo) { @@ -361,7 +386,11 @@ export default { data: { category: category, kbGuid, - title: isCurrentCategory ? `${title.replace(/\.md/, '')}-${i18n.t('duplicate')}${title.indexOf('.md') !== -1 ? '.md' : ''}` : title, + title: isCurrentCategory + ? `${title.replace(/\.md/, '')}-${i18n.t('duplicate')}${ + title.indexOf('.md') !== -1 ? '.md' : '' + }` + : title, owner: userId, html, type: category === '/Lite/' ? 'lite/markdown' : type diff --git a/src/utils/api.js b/src/utils/api.js index 9b859f0..90f8699 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -80,6 +80,15 @@ const KnowledgeBaseApi = { setBaseUrl (url) { KnowledgeBaseBaseUrl = url }, + /** + * 根据ServerUrl,kbGuid和docGuid定位一篇笔记 + * @param kbGuid + * @param docGuid + * @returns {string} + */ + getCacheKey (kbGuid, docGuid) { + return `${this.getBaseUrl()}_${kbGuid}_${docGuid}` + }, /** * 获取用户文件夹 @@ -131,7 +140,8 @@ const KnowledgeBaseApi = { async getNoteInfo (params) { return await execRequest( 'GET', - `${KnowledgeBaseBaseUrl}/ks/note/info/${params.kbGuid}/${params.docGuid}?clientType=web&clientVersion=3.0&lang=zh-cn` + `${KnowledgeBaseBaseUrl}/ks/note/info/${params.kbGuid}/${params.docGuid}?clientType=web&clientVersion=3.0&lang=zh-cn`, + params.data ) }, diff --git a/src/utils/fileStorage.js b/src/utils/fileStorage.js index f72ee67..4e9e103 100644 --- a/src/utils/fileStorage.js +++ b/src/utils/fileStorage.js @@ -87,5 +87,29 @@ class FileStorage { removeItemFromStore (key) { return this._store.delete(key) } + + /** + * 获取缓存在本地的笔记数据 + * @param dataModified 笔记修改的时间戳 + * @param cacheKey 缓存key + */ + getCachedNote ({ dataModified }, cacheKey) { + const note = this.getItemFromStore(cacheKey) + if (helper.isNullOrEmpty(note) || helper.isNullOrEmpty(note.info)) { + return null + } + if (note.info.dataModified === dataModified) return note + else this.removeItemFromStore(cacheKey) + return null + } + + /** + * 设置笔记缓存 + * @param note + * @param cacheKey + */ + setCachedNote (note, cacheKey) { + this.setItemInStore(cacheKey, note) + } } export default new FileStorage() From 79a20fec9860b000516ab2504d55fdb4485418b6 Mon Sep 17 00:00:00 2001 From: tanknee Date: Tue, 6 Oct 2020 18:46:50 +0800 Subject: [PATCH 36/93] =?UTF-8?q?202001007=201.=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=9B=B4=E6=96=B0=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/boot/request.js | 23 ++++---- src/components/NoteOutline.vue | 1 - src/components/ui/dialog/SettingsDialog.vue | 53 ++++++++++++++++--- .../en-us/components/ui/SettingsDialog.js | 5 +- .../zh-cn/components/ui/SettingsDialog.js | 5 +- src/store/client/actions.js | 4 ++ src/utils/api.js | 12 +++++ 7 files changed, 83 insertions(+), 20 deletions(-) diff --git a/src/boot/request.js b/src/boot/request.js index 58e53ab..a2092e3 100644 --- a/src/boot/request.js +++ b/src/boot/request.js @@ -4,22 +4,23 @@ import events from 'src/constants/events' import fileStorage from 'src/utils/fileStorage' import NeetoError from 'app/share/error' -axios.defaults.timeout = 5000 // 响应时间 +axios.defaults.timeout = 50000 // 响应时间 // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8' // 配置请求头 const baseUrl = 'https://ac.wiz.cn' axios.defaults.baseURL = baseUrl /** - * exec network request - * @param method - * @param url - * @param body + * execute network request + * @param {string} method + * @param {string} url + * @param {Object} body * @param token - * @param extraConfig - * @param returnFullResult + * @param {Object} extraConfig + * @param {boolean} returnFullResult + * @param {boolean} ignoreStatusCode * @returns {Promise<*>} */ -export async function execRequest (method, url, body, token, extraConfig, returnFullResult = false) { +export async function execRequest (method, url, body, token, extraConfig, returnFullResult = false, ignoreStatusCode) { const config = { url, method, @@ -41,7 +42,7 @@ export async function execRequest (method, url, body, token, extraConfig, return const res = await axios(config) const data = res.data - if (data.returnCode !== 200 && data.code !== 200) { + if (data.returnCode !== 200 && data.code !== 200 && !ignoreStatusCode) { const { returnMessage, returnCode, externCode } = data bus.$emit(events.REQUEST_ERROR, new NeetoError(returnMessage, returnCode, externCode)) const err = new Error(returnMessage) @@ -50,7 +51,9 @@ export async function execRequest (method, url, body, token, extraConfig, return throw err } - return ('result' in data || !returnFullResult) ? data.result : data + return typeof data === 'object' && ('result' in data || !returnFullResult) + ? data.result + : data } export default ({ app }) => { diff --git a/src/components/NoteOutline.vue b/src/components/NoteOutline.vue index 07f2556..e03f2db 100644 --- a/src/components/NoteOutline.vue +++ b/src/components/NoteOutline.vue @@ -98,7 +98,6 @@ export default { mounted () { const that = this document.addEventListener('click', (e) => { - console.log(e) if (e.path[1].className.indexOf('q-tree__node') !== -1) return that.hide() }) diff --git a/src/components/ui/dialog/SettingsDialog.vue b/src/components/ui/dialog/SettingsDialog.vue index db2087a..e94b72e 100644 --- a/src/components/ui/dialog/SettingsDialog.vue +++ b/src/components/ui/dialog/SettingsDialog.vue @@ -75,8 +75,15 @@
- {{ $t('currentVersion',{version}) }} - + {{ $t('currentVersion', { version }) }} +
@@ -93,7 +100,14 @@ @input="imageUploadServiceChangeHandler" > @@ -121,7 +135,7 @@ - + @@ -182,13 +196,38 @@ export default { ) this.updateStateAndStore({ imageUploadService: servicePlain }) }, - checkUpdateHandler: function () { - this.$q.electron.shell.openExternal('https://github.com/TankNee/Neeto-Vue/releases') + checkUpdateHandler: async function () { + const result = await this.getLatestVersion() + const latestVersion = /Release Neeto-Vue v(.*\d) /.exec(result)[1] + const that = this + if (version !== latestVersion) { + this.$q.notify({ + message: that.$t('getNewerVersion', { version: latestVersion }), + color: 'primary', + actions: [ + { + label: that.$t('update'), + color: 'white', + handler: () => { + that.$q.electron.shell.openExternal( + 'https://github.com/TankNee/Neeto-Vue/releases' + ) + } + } + ] + }) + } else { + this.$q.notify({ + message: that.$t('noNewerVersion'), + color: 'green' + }) + } }, ...mapActions([ 'toggleDarkMode', 'toggleChanged', - 'updateStateAndStore' + 'updateStateAndStore', + 'getLatestVersion' ]) } } diff --git a/src/i18n/en-us/components/ui/SettingsDialog.js b/src/i18n/en-us/components/ui/SettingsDialog.js index ea9fca9..345828f 100644 --- a/src/i18n/en-us/components/ui/SettingsDialog.js +++ b/src/i18n/en-us/components/ui/SettingsDialog.js @@ -11,5 +11,8 @@ export default { wizOfficialImageUploadService: 'WizNote Official Image Upload Service (unavailable)', customWebUploadService: 'Custom Web Image Upload Service', smmsImageUploadService: 'SMMS Image Upload Service (unavailable)', - currentVersion: 'Current Version: {version}' + currentVersion: 'Current Version: {version}', + getNewerVersion: 'Get Newer Version: {version} !', + update: 'Update', + noNewerVersion: 'No Newer Version !' } diff --git a/src/i18n/zh-cn/components/ui/SettingsDialog.js b/src/i18n/zh-cn/components/ui/SettingsDialog.js index 314413d..c48a606 100644 --- a/src/i18n/zh-cn/components/ui/SettingsDialog.js +++ b/src/i18n/zh-cn/components/ui/SettingsDialog.js @@ -11,5 +11,8 @@ export default { wizOfficialImageUploadService: '为知官方图片上传服务 (暂时不可用)', customWebUploadService: '自定义Web图片服务器', smmsImageUploadService: 'SMMS图片上传服务 (暂时不可用)', - currentVersion: '当前版本: {version}' + currentVersion: '当前版本: {version}', + getNewerVersion: '检查到最新版本: {version} !', + update: '更新', + noNewerVersion: '当前已是最新版本 !' } diff --git a/src/store/client/actions.js b/src/store/client/actions.js index 64efaf9..2ccfebf 100644 --- a/src/store/client/actions.js +++ b/src/store/client/actions.js @@ -1,6 +1,7 @@ import types from 'src/store/client/types' import fileStorage from 'src/utils/fileStorage' import { Dark } from 'quasar' +import api from 'src/utils/api' export default { initClientStore ({ commit, state }) { @@ -20,5 +21,8 @@ export default { updateStateAndStore ({ commit }, options) { commit(types.UPDATE_STATES, options) commit(types.SAVE_ITEMS_TO_LOCAL_STORE_SYNC, options) + }, + async getLatestVersion () { + return await api.ThirdPartApi.getLatestVersion() } } diff --git a/src/utils/api.js b/src/utils/api.js index 90f8699..bf27940 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -284,6 +284,18 @@ const ThirdPartApi = { null, true ) + }, + async getLatestVersion () { + return await execRequest( + 'GET', + // 'https://cdn.jsdelivr.net/gh/TankNee/Neeto-Vue@latest/package.json', + 'https://github.com/TankNee/Neeto-Vue/releases/latest', + null, + null, + null, + true, + true + ) } } /** From fd413ee6722b3f0cca77a800ca578b07b3fc9c28 Mon Sep 17 00:00:00 2001 From: TankNee Date: Tue, 6 Oct 2020 23:24:59 +0800 Subject: [PATCH 37/93] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bc0b580 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 TankNee + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 98f5ddfd4243f76571b814b1daa49b3698fc21b9 Mon Sep 17 00:00:00 2001 From: tanknee Date: Thu, 8 Oct 2020 12:18:01 +0800 Subject: [PATCH 38/93] =?UTF-8?q?20201008=201.=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=AA=97=E5=8F=A3=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=202.=20=E5=A2=9E=E5=8A=A0=E6=B3=A8=E5=86=8C=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ui/dialog/LoginDialog.vue | 22 +++++-------------- .../components/{Sidebar.js => Header.js} | 3 ++- src/i18n/en-us/components/index.js | 4 ++-- src/i18n/en-us/components/ui/LoginDialog.js | 3 ++- .../components/{Sidebar.js => Header.js} | 3 ++- src/i18n/zh-cn/components/index.js | 4 ++-- src/i18n/zh-cn/components/ui/LoginDialog.js | 4 ++-- src/utils/api.js | 13 +++++++---- 8 files changed, 27 insertions(+), 29 deletions(-) rename src/i18n/en-us/components/{Sidebar.js => Header.js} (69%) rename src/i18n/zh-cn/components/{Sidebar.js => Header.js} (67%) diff --git a/src/components/ui/dialog/LoginDialog.vue b/src/components/ui/dialog/LoginDialog.vue index 449601b..56933da 100644 --- a/src/components/ui/dialog/LoginDialog.vue +++ b/src/components/ui/dialog/LoginDialog.vue @@ -1,7 +1,6 @@ @@ -205,7 +218,8 @@ export default { 'markdownOnly', 'imageUploadService', 'lightCodeTheme', - 'darkCodeTheme' + 'darkCodeTheme', + 'flomoApiUrl' ]), languageOptions: function () { return i18n.availableLocales.map(l => i18n.t(l)) @@ -298,6 +312,25 @@ export default { }) } }, + flomoSettingHandler: async function () { + this.$q.dialog({ + prompt: { + model: this.flomoApiUrl + }, + title: this.$t('flomo'), + ok: { + label: this.$t('submit') + }, + cancel: { + label: this.$t('cancel') + } + }).onOk(data => { + this.updateStateAndStore({ flomoApiUrl: data }) + }) + // this.$q.electron.shell.openExternal( + // 'https://flomoapp.com/mine?source=incoming_webhook' + // ) + }, ...mapActions([ 'toggleDarkMode', 'toggleChanged', diff --git a/src/components/ui/menu/NoteItemContextMenu.vue b/src/components/ui/menu/NoteItemContextMenu.vue index dffc665..e5e1b5b 100644 --- a/src/components/ui/menu/NoteItemContextMenu.vue +++ b/src/components/ui/menu/NoteItemContextMenu.vue @@ -13,6 +13,9 @@ {{ $t('export') }} + + {{ $t('flomo') }} + {{ $t('share') }} @@ -48,6 +51,10 @@ export default { types: Function, default: () => {} }, + flomo: { + types: Function, + default: () => {} + }, share: { types: Function, default: () => {} diff --git a/src/i18n/en-us/components/ui/ImageUploadServiceDialog.js b/src/i18n/en-us/components/ui/ImageUploadServiceDialog.js index 5927d41..a14e1a6 100644 --- a/src/i18n/en-us/components/ui/ImageUploadServiceDialog.js +++ b/src/i18n/en-us/components/ui/ImageUploadServiceDialog.js @@ -3,5 +3,6 @@ export default { postParam: 'Post Param', jsonPath: 'JSON Path', customHeader: 'Custom Header (JSON Schema)', - customBody: 'Custom Body (JSON Schema)' + customBody: 'Custom Body (JSON Schema)', + submit: 'Submit' } diff --git a/src/i18n/en-us/components/ui/NoteItemContextMenu.js b/src/i18n/en-us/components/ui/NoteItemContextMenu.js index ca7305c..cc22008 100644 --- a/src/i18n/en-us/components/ui/NoteItemContextMenu.js +++ b/src/i18n/en-us/components/ui/NoteItemContextMenu.js @@ -2,6 +2,7 @@ export default { rename: 'Rename', copy: 'Copy', move: 'Move', + flomo: 'Flomo', share: 'Share', export: 'Export', delete: 'Delete', diff --git a/src/i18n/en-us/errors.js b/src/i18n/en-us/errors.js index 9aeca47..4ec500a 100644 --- a/src/i18n/en-us/errors.js +++ b/src/i18n/en-us/errors.js @@ -1,5 +1,6 @@ export default { requestError: 'Request Error', + flomoApiUrlIsEmpty: 'Flomo Api is empty, you should set it in Settings. (Settings >> Server >> Flomo)', 301: 'Invalid Token', 304: 'Traffic Limit', 305: 'Storage Limit', diff --git a/src/i18n/en-us/notification.js b/src/i18n/en-us/notification.js index 5998d5c..289bfe9 100644 --- a/src/i18n/en-us/notification.js +++ b/src/i18n/en-us/notification.js @@ -1,5 +1,6 @@ export default { saveNoteSuccessfully: 'Save Note Successfully', deleteNoteSuccessfully: 'Delete Note Successfully', - deleteCategorySuccessfully: 'Delete Category Successfully' + deleteCategorySuccessfully: 'Delete Category Successfully', + sendToFlomoSuccessfully: 'Send to Flomo Successfully' } diff --git a/src/i18n/zh-cn/components/ui/ImageUploadServiceDialog.js b/src/i18n/zh-cn/components/ui/ImageUploadServiceDialog.js index 068d305..ef8991f 100644 --- a/src/i18n/zh-cn/components/ui/ImageUploadServiceDialog.js +++ b/src/i18n/zh-cn/components/ui/ImageUploadServiceDialog.js @@ -3,5 +3,6 @@ export default { postParam: '请求参数', jsonPath: '返回参数的JSON路径', customHeader: '自定义请求头 (JSON格式)', - customBody: '自定义请求体 (JSON格式)' + customBody: '自定义请求体 (JSON格式)', + submit: '提交' } diff --git a/src/i18n/zh-cn/components/ui/NoteItemContextMenu.js b/src/i18n/zh-cn/components/ui/NoteItemContextMenu.js index c341fb8..2a639af 100644 --- a/src/i18n/zh-cn/components/ui/NoteItemContextMenu.js +++ b/src/i18n/zh-cn/components/ui/NoteItemContextMenu.js @@ -2,6 +2,7 @@ export default { rename: '重命名', copy: '复制', move: '移动', + flomo: '浮墨', share: '分享', export: '导出', delete: '删除', diff --git a/src/i18n/zh-cn/errors.js b/src/i18n/zh-cn/errors.js index fcb54a3..c59250d 100644 --- a/src/i18n/zh-cn/errors.js +++ b/src/i18n/zh-cn/errors.js @@ -1,5 +1,6 @@ export default { requestError: '网络请求错误', + flomoApiUrlIsEmpty: '浮墨接口地址为空,请在设置中完善信息。(设置 >> 服务 >> 浮墨)', 301: 'token过期,请尝试重新登陆', 304: '上传限制', 305: '容量达到上限', diff --git a/src/store/client/actions.js b/src/store/client/actions.js index c435e21..c3ec929 100644 --- a/src/store/client/actions.js +++ b/src/store/client/actions.js @@ -1,7 +1,10 @@ import types from 'src/store/client/types' -import { Dark } from 'quasar' +import { Dark, Notify } from 'quasar' import api from 'src/utils/api' import ClientFileStorage from 'src/utils/storage/ClientFileStorage' +import helper from 'src/utils/helper' +import { i18n } from 'boot/i18n' +import _ from 'lodash' export default { initClientStore ({ commit, state }) { @@ -24,5 +27,38 @@ export default { }, async getLatestVersion () { return await api.ThirdPartApi.getLatestVersion() + }, + async sendToFlomo ({ state, rootState }, docGuid) { + const { flomoApiUrl } = state + if (helper.isNullOrEmpty(flomoApiUrl)) { + Notify.create({ + message: i18n.t('flomoApiUrlIsEmpty'), + color: 'red-10', + caption: i18n.t('requestError') + }) + return + } + const { kbGuid } = rootState.server + const note = await this.dispatch('server/getContent', { + kbGuid, + docGuid + }) + const isHtml = !_.endsWith(note.info.title, '.md') + let content + const { + html, + resources + } = note + if (isHtml) { + content = helper.convertHtml2Markdown(html, kbGuid, docGuid, resources) + } else { + content = helper.extractMarkdownFromMDNote(html, kbGuid, docGuid, resources) + } + await api.ThirdPartApi.sendToFlomo(content, flomoApiUrl) + Notify.create({ + message: i18n.t('sendToFlomoSuccessfully'), + color: 'green-10', + icon: 'check' + }) } } diff --git a/src/store/client/state.js b/src/store/client/state.js index f5f9b40..53b3577 100644 --- a/src/store/client/state.js +++ b/src/store/client/state.js @@ -16,6 +16,7 @@ export default function () { shrinkInTray: false, lightCodeTheme: 'github', darkCodeTheme: 'monokai', - noteListVisible: true + noteListVisible: true, + flomoApiUrl: '' } } diff --git a/src/store/server/actions.js b/src/store/server/actions.js index 27f8424..2bdece7 100644 --- a/src/store/server/actions.js +++ b/src/store/server/actions.js @@ -11,7 +11,7 @@ import _ from 'lodash' import FormData from 'form-data' import { exportMarkdownFile, exportMarkdownFiles } from 'src/ApiHandler' -async function getContent (kbGuid, docGuid) { +export async function _getContent (kbGuid, docGuid) { const { info } = await api.KnowledgeBaseApi.getNoteContent({ kbGuid, docGuid, @@ -64,6 +64,9 @@ export default { await this.dispatch('server/login', { userId, password, url }) } }, + async getContent (payload, { kbGuid, docGuid }) { + return await _getContent(kbGuid, docGuid) + }, /** * 用户登录接口 * @param commit @@ -175,7 +178,7 @@ export default { commit(types.UPDATE_CURRENT_NOTE_LOADING_STATE, true) const { kbGuid } = state const { docGuid } = payload - const result = await getContent(kbGuid, docGuid) + const result = await _getContent(kbGuid, docGuid) commit(types.UPDATE_CURRENT_NOTE, result) commit(types.UPDATE_CURRENT_NOTE_LOADING_STATE, false) @@ -420,7 +423,9 @@ export default { getters.imageUrl(result, imageUploadService) ) } - if (imageUploadService === 'wizOfficialImageUploadService') { commit(types.UPDATE_CURRENT_NOTE_RESOURCE, result) } + if (imageUploadService === 'wizOfficialImageUploadService') { + commit(types.UPDATE_CURRENT_NOTE_RESOURCE, result) + } }, async moveNote ({ commit }, noteInfo) { const { kbGuid, docGuid, category, type } = noteInfo @@ -488,14 +493,19 @@ export default { async exportMarkdownFile ({ state }, noteField) { const { kbGuid } = state const { docGuid } = noteField - const result = await getContent(kbGuid, docGuid) + const result = await _getContent(kbGuid, docGuid) const isHtml = !_.endsWith(result.info.title, '.md') const { html, resources } = result let content if (isHtml) { content = helper.convertHtml2Markdown(html, kbGuid, docGuid, resources) } else { - content = helper.extractMarkdownFromMDNote(html, kbGuid, docGuid, resources) + content = helper.extractMarkdownFromMDNote( + html, + kbGuid, + docGuid, + resources + ) } await exportMarkdownFile(content) Notify.create({ @@ -513,19 +523,31 @@ export default { }) for (const noteField of noteFields) { const { docGuid } = noteField - const result = await getContent(kbGuid, docGuid) + const result = await _getContent(kbGuid, docGuid) results.push(result) } const contents = results.map(result => { const isHtml = !_.endsWith(result.info.title, '.md') - const { html, info: { docGuid }, resources } = result + const { + html, + info: { docGuid }, + resources + } = result let content if (isHtml) { content = helper.convertHtml2Markdown(html, kbGuid, docGuid, resources) } else { - content = helper.extractMarkdownFromMDNote(html, kbGuid, docGuid, resources) + content = helper.extractMarkdownFromMDNote( + html, + kbGuid, + docGuid, + resources + ) + } + return { + content, + title: isHtml ? result.info.title : result.info.title.replace('.md', '') } - return { content, title: isHtml ? result.info.title : result.info.title.replace('.md', '') } }) Loading.hide() await exportMarkdownFiles(contents) diff --git a/src/utils/api.js b/src/utils/api.js index 3e4cb7c..8998275 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -87,7 +87,7 @@ const KnowledgeBaseApi = { * @returns {string} */ getCacheKey (kbGuid, docGuid) { - return `${this.getBaseUrl()}_${kbGuid}_${docGuid}` + return `${this.getBaseUrl().replace(/\./g, '_')}_${kbGuid}_${docGuid}` }, /** @@ -301,6 +301,9 @@ const ThirdPartApi = { true, true ) + }, + async sendToFlomo (content, url) { + return await execRequest('POST', url, { content }, null, null, true, true) } } /** diff --git a/src/utils/helper.js b/src/utils/helper.js index 9e4f9c1..dce429a 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -4,7 +4,6 @@ import { i18n } from 'boot/i18n' import { Platform } from 'quasar' import TurndownService from 'turndown' import cheerio from 'cheerio' -const { dialog, BrowserWindow } = require('electron').remote const turndownService = new TurndownService({ codeBlockStyle: 'fenced', headingStyle: 'atx' }) function isNullOrEmpty (obj) { obj = _.toString(obj) @@ -71,26 +70,6 @@ function embedMDNote (markdown, resources, options) { return wizMarkdownParser.embed(markdown, options) } -/** - * remove deprecatedTags - * @param {string} html - */ -function removeDeprecatedTags (html) { - const patterns = [ - //g, - //g - ] - patterns.forEach(pattern => { - html = html.replace(pattern, '') - }) - // html = html.replace(/\s/g, '- [ ]') - html = html - .replace(/>/g, '>') - .replace(/</g, '<') - .replace(/&/g, '&') - return html -} - /** * remove markdown tags while rendering note list * @param {string} markdown @@ -204,15 +183,6 @@ function generateCategoryNodeTree (categories) { return result } -/** - * 开启一个图片选择弹窗 - * @param options - * @returns {string[]} - */ -function createFileSelectDialog (options) { - return dialog.showOpenDialogSync(BrowserWindow.getFocusedWindow(), options) -} - /** * 获取文件的拓展名 * @param filePath 文件路径 @@ -348,8 +318,6 @@ export default { removeMarkdownTag, embedMDNote, displayDateElegantly, - createFileSelectDialog, - removeDeprecatedTags, updateContentsList, getFileNameWithExt, isCtrl, From 59020ece111e5028ab901e274362e133fe648edb Mon Sep 17 00:00:00 2001 From: tanknee Date: Sat, 19 Dec 2020 11:47:55 +0800 Subject: [PATCH 80/93] =?UTF-8?q?202001219=201.=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=AD=E6=96=87Readme=E6=96=87=E4=BB=B6=202.=20=E5=AE=8C?= =?UTF-8?q?=E5=96=84readme=E6=8F=8F=E8=BF=B0=203.=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=AC=94=E8=AE=B0=E9=94=81=E5=AE=9A=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=9B=B4=E6=96=B9=E4=BE=BF=E7=9A=84=E7=AC=94?= =?UTF-8?q?=E8=AE=B0=E6=9F=A5=E9=98=85=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++ README-zh_cn.md | 77 ++++++++++++++++++++++ README.md | 29 +++++++- screenshot/qrcode_for_gh_wizcommunity.png | Bin 0 -> 27381 bytes src/components/Header.vue | 28 +++++++- src/components/Vditor.vue | 12 +++- src/css/vditor.css | 4 +- src/pages/Index.vue | 2 +- src/store/client/state.js | 5 +- 9 files changed, 151 insertions(+), 12 deletions(-) create mode 100644 README-zh_cn.md create mode 100644 screenshot/qrcode_for_gh_wizcommunity.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 5069142..81403f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGE LOG +## 2020 12 19 Update 0.0.22 + +1. 添加中文Readme文件 +2. 完善readme描述 +3. 添加笔记锁定功能,实现更方便的笔记查阅。 + ## 2020 12 17 Update 0.0.21 1. 添加Flomo Api的支持。 设置 >> 服务 >> 浮墨. 然后在列表中使用右键菜单即可将笔记发送到Flomo diff --git a/README-zh_cn.md b/README-zh_cn.md new file mode 100644 index 0000000..1872123 --- /dev/null +++ b/README-zh_cn.md @@ -0,0 +1,77 @@ +

Neeto Vue

+ +

又一个设计优良的为知笔记客户端

+ +

English | 简体中文

+ +### 目录 + +[TOC] + +### 状态 + +![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/TankNee/Neeto-Vue/Neeto-Vue%20Release%20Action/master?label=REALSE%20ACTION&style=for-the-badge) ![GitHub Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/latest/total?style=for-the-badge) ![GitHub All Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/total?style=for-the-badge) ![GitHub Release Date](https://img.shields.io/github/release-date/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub repo size](https://img.shields.io/github/repo-size/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/TankNee/Neeto-Vue?style=for-the-badge) + +### 介绍 + +[为了记笔记,我写了一个笔记客户端](https://www.tanknee.cn/2020/10/02/%E6%88%91%E4%B8%BA%E4%BA%86%E8%AE%B0%E7%AC%94%E8%AE%B0%E6%89%8B%E5%86%99%E4%BA%86%E4%B8%80%E4%B8%AA%E5%AE%A2%E6%88%B7%E7%AB%AF/) + +### 为知社区 + +关注为知社区订阅号,获取最新信息: + +![qrcode_for_gh_wizcommunity](./screenshot/qrcode_for_gh_wizcommunity.png) + +如果你愿意促进社区发展,那[加入我们](https://github.com/altairwei/WizNotePlus/blob/master/加入我们)吧! + +### 软件截图 + +![image-20200925170200202](./screenshot/image-20200925170200202.png) + +![image-20200925170301170](./screenshot/image-20200925170301170.png) + +![image-20200925170327136](./screenshot/image-20200925170327136.png) + +### 下载 + +[发行版](https://github.com/TankNee/Neeto-Vue/releases/latest) + +您也可以在设置弹窗中检查笔记的最新版本 + +![image-20201011103144579](./screenshot/image-20201011103144579.png) + +### 特色 + +- 更加舒适的设计 + +- 更加使用的功能 + +- 相对更小的空间占用 + +- 更好的黑暗模式 + +- 方便的笔记层级展示 + +- 加载动画 + +- 新版本检测 + +- 国际化,支持简体中文与英文 + +- 快捷键: [vditor 快捷键](https://ld246.com/guide/markdown) + + +### 注意事项 + +- 移动笔记时还存在一些问题。暂时不可用。 +- 图片上传还只支持拖拽上传和直接填写图片链接 +- 使用为知官方图片服务时只会显示图片的临时地址 +- 图片上传服务暂时只可用第三方web上传服务。(设置 >> 编辑器 >> 图片上传服务)参数填写方式请参照:[picgo-plugin-web-uploader](https://github.com/yuki-xin/picgo-plugin-web-uploader) + - `url`: 图床上传API地址 + - `paramName`: POST参数名(eg:`image`) + - `jsonPath`: 图片URL所在返回值的`JsonPath(eg:data.url)` + - `customHeader`: 自定义请求头 标准JSON(eg: `{"key":"value"}`) + - `customBody`: 自定义Body 标准JSON(eg: `{"key":"value"}`) + +### [更新日志](./CHANGELOG.md) + diff --git a/README.md b/README.md index 1f54294..880c116 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ -## Neeto Vue -An Awesome Wiz Note Client +

Neeto Vue

+ +

An Awesome Wiz Note Client

+ +

English | 简体中文

+ +### Content + +[TOC] ### Status @@ -7,7 +14,15 @@ An Awesome Wiz Note Client ### Introduction -[为了记笔记,我专门写了一个笔记客户端](https://www.tanknee.cn/2020/10/02/%E6%88%91%E4%B8%BA%E4%BA%86%E8%AE%B0%E7%AC%94%E8%AE%B0%E6%89%8B%E5%86%99%E4%BA%86%E4%B8%80%E4%B8%AA%E5%AE%A2%E6%88%B7%E7%AB%AF/) +[In order to write notes, I develop a note application](https://www.tanknee.cn/2020/10/02/%E6%88%91%E4%B8%BA%E4%BA%86%E8%AE%B0%E7%AC%94%E8%AE%B0%E6%89%8B%E5%86%99%E4%BA%86%E4%B8%80%E4%B8%AA%E5%AE%A2%E6%88%B7%E7%AB%AF/) + +### Wiz Community + +Follow Wiz Community in WeChat: + +![qrcode_for_gh_wizcommunity](./screenshot/qrcode_for_gh_wizcommunity.png) + +If you intend to prompt the development of Wiz Community,join us pls! ### ScreenShot @@ -49,6 +64,14 @@ You are also be able to check update in Neeto-Vue Settings Dialog ### Attention - There's another problem with copying notes, Since I haven't handled the transfer of note resources, I don't recommend copying notes for the time being +- Image upload service only supports drag and drop upload or fill in picture link directly +- When using the wiz official image service, only the temporary address of the image will be displayed +- For the time being, only the third-party Web upload service is available. (Settings > > editor > > image upload service) please refer to:[picgo-plugin-web-uploader](https://github.com/yuki-xin/picgo-plugin-web-uploader) + - `url`: Picture upload api url + - `paramName`: POST parameter name(eg:`image`) + - `jsonPath`: Jsonpath of the return value of the image URL`(eg:data.url)` + - `customHeader`: custom request http headers,using standard JSON schema(eg: `{"key":"value"}`) + - `customBody`: custom request body, using standard JSON schema(eg: `{"key":"value"}`) ### [Change Log](./CHANGELOG.md) diff --git a/screenshot/qrcode_for_gh_wizcommunity.png b/screenshot/qrcode_for_gh_wizcommunity.png new file mode 100644 index 0000000000000000000000000000000000000000..42504c74279ba6fecc309c018571525593d3298e GIT binary patch literal 27381 zcmd6Qc|c5i|Nlu6N}-Yz;}Ri+P|@vhU9t~CmdhXvqLHm)nq#et)WuB*+^!@AS(S7b^w$C}A&wF{jU$56_^R&fS*XdKH zO~Lf^Fia2rhiMD2Ntk}ScIY?!Y7f5+IvNC|x%sySarqdJ#Q+cusqRP6h^@%)1zMF>muPZ3@<{qh33` zcKUk#uy)<_^tQq)GF!)0TlRM9+{3b`Rj&a9?FJ1V zGJ4EdCuf&&lYXB(#eM3u=^pbJEc9Hoc!}5QHEY@H)^FIlZTk*C|A3wQ_8$le{`26W zW5@pvKM`^A)aeTsFJ1m8>dMt?v2nNK?6 zRqk|>j@M$79ktk?UMwxvf1VagovX#(tK0@^v3Kytvv!25qU1A5`9W?*{$?KXh>&=^ zis8e zMMQ7j7~Weq0~seoy;T!e@?eHkydjo)6us|hP1W!L%yWY*GW(2n9g#D_-*&EQCoh$+ zd%`$*#6H(9^b@M^H4ms<`U%5IiDQf3WcG2gxso%=xo_@sJl;;~F3VCpSDKY__7NS_ zv$R;Ju#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#rUb6tZs= zNV8R7ung^Bnpv1N(L&<4Xko?X4~ygp={{v~+gxPoi$`F+;R_cQf|(@IY#ba9zQGpO z)XWyAT-E~5!EI6P?8c4omHdK;rlzCGVH7B`t;vl#ifrR`swa!;!vtM-Z%8Q#YI}il z7XD!g^#lw=7$W>RE-B9m2JsuyQL{uUPB@zw21sxvDLU=~#GQ3pbMb=4Cb1nc;2*}1t2JtkI02J9XG+DRi!D6&_gEE z6vlYeL$;zYipAerS$fy9N;pVz*+X80tN?Z2guxZZ7B!$o0~rBMztLpZW3$^^9IUng z8xei|(zS-V?@>S&XCO7^s2!V|Sm;7^jWt+){!D7j*v*P92kF9EVQ8`y*oYj|(Kvwl zv{XT&Ch7*LGxDHoZ`KHdtMvC@)u2cKQ)d*7h9OgDDIw8IQ literal 0 HcmV?d00001 diff --git a/src/components/Header.vue b/src/components/Header.vue index f97d1dc..23593ba 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -31,6 +31,23 @@ >{{ $t('noteCategory') }}
+ + + {{ enableVditor ? $t('lock') : $t('unLock') }} + + 30) { - title = `${title.substr(0, 9)}...${title.substring(title.length - 12)}` + title = `${title.substr(0, 9)}...${title.substring( + title.length - 12 + )}` } if (this.noteState !== 'default') { return `${title} —— ${this.$t(this.noteState)}` diff --git a/src/components/Vditor.vue b/src/components/Vditor.vue index 76a4de8..ccdef49 100644 --- a/src/components/Vditor.vue +++ b/src/components/Vditor.vue @@ -37,7 +37,7 @@ export default { }, ...mapServerGetters(['currentNote', 'uploadImageUrl', 'currentNoteResources', 'currentNoteResourceUrl']), ...mapServerState(['isCurrentNoteLoading', 'contentsList']), - ...mapClientState(['darkMode', 'lightCodeTheme', 'darkCodeTheme']) + ...mapClientState(['darkMode', 'lightCodeTheme', 'darkCodeTheme', 'enableVditor']) }, data () { return { @@ -46,6 +46,7 @@ export default { }, mounted () { this.contentEditor = this.initVditor() + this.enableVditor ? this.contentEditor.enable() : this.contentEditor.disabled() document.onkeydown = this.registerKeyboardHotKey.bind(this) this.registerEventHandler() }, @@ -174,7 +175,7 @@ export default { if (e.message.indexOf('Md2V') !== -1) return debugLogger.Error(e.message) } - this.contentEditor.enable() + // this.contentEditor.enable() }, darkMode: function (darkMode) { this.contentEditor.setTheme( @@ -196,6 +197,13 @@ export default { this.darkMode ? 'dark' : 'light', this.darkMode ? this.darkCodeTheme : currentData ) + }, + enableVditor: function (currentData) { + if (currentData) { + this.contentEditor.enable() + } else { + this.contentEditor.disabled() + } } } } diff --git a/src/css/vditor.css b/src/css/vditor.css index db345c1..ffda45e 100644 --- a/src/css/vditor.css +++ b/src/css/vditor.css @@ -1471,8 +1471,8 @@ box-sizing: border-box; } .vditor-ir pre.vditor-reset[contenteditable='false'] { - opacity: 0.3; - cursor: not-allowed; + opacity: 0.7; + cursor: default; } .vditor-ir pre.vditor-reset:empty:before { content: attr(placeholder); diff --git a/src/pages/Index.vue b/src/pages/Index.vue index 1874561..78012ca 100644 --- a/src/pages/Index.vue +++ b/src/pages/Index.vue @@ -58,7 +58,7 @@ color="#26A69A" v-show="dataLoaded && !isOutlineShow" v-ripple - key="cached" + key="save" /> diff --git a/src/store/client/state.js b/src/store/client/state.js index 53b3577..c0c4b96 100644 --- a/src/store/client/state.js +++ b/src/store/client/state.js @@ -4,7 +4,7 @@ export default function () { autoLogin: false, rememberPassword: true, darkMode: false, - markdownOnly: true, + markdownOnly: false, enableSelfHostServer: false, imageUploadService: 'customWebUploadService', imageUploadServiceParam: {}, @@ -17,6 +17,7 @@ export default function () { lightCodeTheme: 'github', darkCodeTheme: 'monokai', noteListVisible: true, - flomoApiUrl: '' + flomoApiUrl: '', + enableVditor: true } } From e63ccf29a416f4275f9396f019da2abd7afa23d4 Mon Sep 17 00:00:00 2001 From: tanknee Date: Sat, 19 Dec 2020 11:50:19 +0800 Subject: [PATCH 81/93] 202001219 1. update readme as well as package.json --- README-zh_cn.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README-zh_cn.md b/README-zh_cn.md index 1872123..1f4a07f 100644 --- a/README-zh_cn.md +++ b/README-zh_cn.md @@ -10,7 +10,7 @@ ### 状态 -![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/TankNee/Neeto-Vue/Neeto-Vue%20Release%20Action/master?label=REALSE%20ACTION&style=for-the-badge) ![GitHub Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/latest/total?style=for-the-badge) ![GitHub All Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/total?style=for-the-badge) ![GitHub Release Date](https://img.shields.io/github/release-date/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub repo size](https://img.shields.io/github/repo-size/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/TankNee/Neeto-Vue?style=for-the-badge) +![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/TankNee/Neeto-Vue/Neeto-Vue%20Release%20Action/master?label=REALSE%20ACTION&style=for-the-badge) ![GitHub Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/latest/total?style=for-the-badge) ![GitHub All Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/total?style=for-the-badge) ![GitHub Release Date](https://img.shields.io/github/release-date/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub repo size](https://img.shields.io/github/repo-size/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/TankNee/Neeto-Vue?style=for-the-badge)[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_shield) ### 介绍 diff --git a/package.json b/package.json index f87cbdc..6735aca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neeto.vue.electron", - "version": "0.0.21", + "version": "0.0.22", "description": "An Awesome WizNote Desktop Application", "productName": "Neeto-Vue", "author": "tanknee ", From a8ec42c040f7576553ebd86be5a28c1bd76c0097 Mon Sep 17 00:00:00 2001 From: tanknee Date: Sat, 19 Dec 2020 11:56:14 +0800 Subject: [PATCH 82/93] 202001219 1. update readme --- README-zh_cn.md | 21 ++++++++++++++++++++- README.md | 20 ++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/README-zh_cn.md b/README-zh_cn.md index 1f4a07f..7fdae09 100644 --- a/README-zh_cn.md +++ b/README-zh_cn.md @@ -6,7 +6,23 @@ ### 目录 -[TOC] +[目录](#目录) + +[状态](#状态) + +[介绍](#介绍) + +[为知社区](#为知社区) + +[软件截图](#软件截图) + +[下载](#下载) + +[特色](#特色) + +[注意事项](#注意事项) + +[更新日志](#更新日志changelogmd) ### 状态 @@ -75,3 +91,6 @@ ### [更新日志](./CHANGELOG.md) +### License + +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) \ No newline at end of file diff --git a/README.md b/README.md index 94cd68e..914b119 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,23 @@ ### Content -[TOC] +[Content](#content) + +[Status](#status) + +[Introduction](#introduction) + +[Wiz Community](#wiz-community) + +[ScreenShot](#screenshot) + +[Download](#download) + +[Feature](#feature) + +[Attention](#attention) + +[Change Log](#change-logchangelogmd) ### Status @@ -78,5 +94,5 @@ You are also be able to check update in Neeto-Vue Settings Dialog -## License +### License [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) \ No newline at end of file From 03c17a5f53bf2b3455eb0fc22a06ec97709ab0f6 Mon Sep 17 00:00:00 2001 From: tanknee Date: Sun, 20 Dec 2020 10:20:30 +0800 Subject: [PATCH 83/93] 20201220 1. fix translation 2. update readme --- README-zh_cn.md | 73 +++++++++++++++++++++++++++-- README.md | 60 ++++++++++++++++++++++-- src/components/Header.vue | 2 +- src/i18n/en-us/components/Header.js | 4 +- src/i18n/zh-cn/components/Header.js | 4 +- 5 files changed, 132 insertions(+), 11 deletions(-) diff --git a/README-zh_cn.md b/README-zh_cn.md index 7fdae09..ce96ab6 100644 --- a/README-zh_cn.md +++ b/README-zh_cn.md @@ -22,7 +22,7 @@ [注意事项](#注意事项) -[更新日志](#更新日志changelogmd) +[更新日志](#更新记录) ### 状态 @@ -60,7 +60,7 @@ - 更加舒适的设计 -- 更加使用的功能 +- 更加实用的功能 - 相对更小的空间占用 @@ -76,6 +76,10 @@ - 快捷键: [vditor 快捷键](https://ld246.com/guide/markdown) +- 支持将笔记发送到Flomo浮墨 + +- 支持笔记锁定模式 + ### 注意事项 @@ -89,8 +93,69 @@ - `customHeader`: 自定义请求头 标准JSON(eg: `{"key":"value"}`) - `customBody`: 自定义Body 标准JSON(eg: `{"key":"value"}`) -### [更新日志](./CHANGELOG.md) +### 更新记录 + +
+版本变更记录 + +## 2020 12 19 Update 0.0.22 + +1. 添加中文 Readme 文件 +2. 完善 readme 描述 +3. 添加笔记锁定功能,实现更方便的笔记查阅。 + +## 2020 12 17 Update 0.0.21 + +1. 添加 Flomo Api 的支持。 设置 >> 服务 >> 浮墨. 然后在列表中使用右键菜单即可将笔记发送到 Flomo +2. 笔记编辑器升级到 v3.7.1 +3. 缓存 key 命名策略调整 + +## 2020 12 03 Update 0.0.20 + +1. 修复服务器返回乱序文件夹列表时无法显示文件夹的问题 + +## 2020 11 30 Update 0.0.19 + +1. 修复笔记名称中带有非法字符时导出失败 + +## 2020 11 27 Update 0.0.18 + +1. 单个文件导出为 Markdown +2. 导出整个文件夹到指定目录,格式为 Markdown + +## 2020 09 27 Update 0.0.6 + +1. 实现更好的登录体验 +2. 优化无内容时的界面 +3. 优化代码逻辑 + +## 2020 09 26 Update 0.0.5 + +1. 添加 github 自动构建 + +## 2020 09 25 Update 0.0.4 + +1. 优化 macos 下的 header 显示 +2. 添加 vditor 快捷键,[快捷键查阅地址](https://ld246.com/guide/markdown) +3. 优化图标 +4. 添加 vditor 右下角的保存按钮,右上角的 outline 按钮还没有实现 +5. 借鉴 wizlite 实现笔记中的链接外部打开 +6. 优化无效代码 + +## 2020 09 22 Update 0.0.3 + +1. 版本更新至 0.0.3 +2. 添加图片的拖拽上传 + 1. 将图片直接拖入到编辑器中 + 2. 记得要先点击图片要插入的位置,否则会直接插入到上一次点击的地方,我暂时没找到办法修复 +3. 修复编辑器区域大小的问题 +4. 添加笔记修改日期的显示 +5. 修复了翻译缺失的问题 + +
+ + ### License -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) \ No newline at end of file +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) diff --git a/README.md b/README.md index 914b119..48c28f3 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ [Attention](#attention) -[Change Log](#change-logchangelogmd) +[Change Log](#change-log) ### Status @@ -77,6 +77,9 @@ You are also be able to check update in Neeto-Vue Settings Dialog - Keymap: [vditor keymap](https://ld246.com/guide/markdown) +- Support to send note to flomo app + +- Support note lock ### Attention @@ -87,12 +90,61 @@ You are also be able to check update in Neeto-Vue Settings Dialog - `url`: Picture upload api url - `paramName`: POST parameter name(eg:`image`) - `jsonPath`: Jsonpath of the return value of the image URL`(eg:data.url)` - - `customHeader`: custom request http headers,using standard JSON schema(eg: `{"key":"value"}`) + - `customHeader`: custom request http headers,using standard JSON schema(eg: `{"key":"value"}`) - `customBody`: custom request body, using standard JSON schema(eg: `{"key":"value"}`) -### [Change Log](./CHANGELOG.md) +### Change Log + +
+Version change log + +## 2020 12 19 Update 0.0.22 +1. Add Chinese readme file +2. Improve the readme description +3. Add note locking function to make it easier to check notes. + +## 2020 12 17 Update 0.0.21 +1. Add flomo API support. Set > > Service > > inkjet. Then use the right-click menu in the list to send notes to flomo +2. Upgrade note editor to v3.7.1 +3. Cache key naming policy adjustment + +## 2020 12 03 Update 0.0.20 +1. Fixed the problem that the server could not display the folder when it returned the out of order folder list + +## 2020 11 30 Update 0.0.19 +1. Repair the export failure when there are illegal characters in the note name +## 2020 11 27 Update 0.0.18 +1. Export a single file to markdown +2. Export the entire folder to the specified directory in the format of markdown +## 2020 09 27 Update 0.0.6 +1. Better login experience +2. Optimize the interface without content +3. Optimize code logic + +## 2020 09 26 Update 0.0.5 +1. Add GitHub to build automatically + +## 2020 09 25 Update 0.0.4 +1. Optimize the header display in MacOS +2. Add vdtor shortcut key, [shortcut key to check address]( https://ld246.com/guide/markdown ) +3. Optimization Icon +4. Add the Save button in the lower right corner of vdtor, but the outline button in the upper right corner has not been implemented +5. Learn from wizlite to open the links in notes +6. Optimize invalid code + +## 2020 09 22 Update 0.0.3 +1. Version updated to 0.0.3 +2. Add drag and drop image upload +1. Drag the picture directly into the editor +2. Remember to click the location of the image to be inserted first, otherwise it will be inserted directly into the place where I last clicked. I have no way to fix it for the time being +3. Fix the size of editor area +4. Add notes to modify the date display +5. Fix the problem of missing translation + +
### License -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) \ No newline at end of file + +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) diff --git a/src/components/Header.vue b/src/components/Header.vue index 23593ba..e8aaff7 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -45,7 +45,7 @@ {{ enableVditor ? $t('lock') : $t('unLock') }} + >{{ enableVditor ? $t('lock') : $t('unlock') }}
Date: Mon, 21 Dec 2020 15:23:44 +0800 Subject: [PATCH 84/93] Update README-zh_cn.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为增加Arch Linux AUR 安装方法 --- README-zh_cn.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README-zh_cn.md b/README-zh_cn.md index 7fdae09..aab3d0d 100644 --- a/README-zh_cn.md +++ b/README-zh_cn.md @@ -56,6 +56,19 @@ ![image-20201011103144579](./screenshot/image-20201011103144579.png) +- Arch Linux + +可以通过 [AUR](https://aur.archlinux.org/packages/neeto-vue-bin/) 安装 + +``` +# AUR helper +# yay +yay -S neeto-vue-bin + +# pikaur +pikaur -S neeto-vue +``` + ### 特色 - 更加舒适的设计 @@ -93,4 +106,4 @@ ### License -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) \ No newline at end of file +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) From 1189304041749eb0da86f9535f461b3566bc91fb Mon Sep 17 00:00:00 2001 From: yjun <1917302220@qq.com> Date: Mon, 21 Dec 2020 15:29:26 +0800 Subject: [PATCH 85/93] Update README.md added installation method for Arch Linux --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 914b119..ecc3d8d 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,19 @@ You are also be able to check update in Neeto-Vue Settings Dialog ![image-20201011103144579](./screenshot/image-20201011103144579.png) +- Arch Linux + +install and upgrade from [AUR](https://aur.archlinux.org/packages/neeto-vue-bin/) + +``` +# AUR helper +# yay +yay -S neeto-vue-bin + +# pikaur +pikaur -S neeto-vue +``` + ### Feature - More Beautiful @@ -95,4 +108,4 @@ You are also be able to check update in Neeto-Vue Settings Dialog ### License -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) \ No newline at end of file +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) From 3267a06576e01d0a03a44f0e4d4a0a9b72583da5 Mon Sep 17 00:00:00 2001 From: yjun <1917302220@qq.com> Date: Mon, 21 Dec 2020 15:30:45 +0800 Subject: [PATCH 86/93] Update README.md fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ecc3d8d..a20d26a 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ install and upgrade from [AUR](https://aur.archlinux.org/packages/neeto-vue-bin yay -S neeto-vue-bin # pikaur -pikaur -S neeto-vue +pikaur -S neeto-vue-bin ``` ### Feature From 142fb02e8e6b2848c4d7045d58f612ba10ee729b Mon Sep 17 00:00:00 2001 From: yjun <1917302220@qq.com> Date: Mon, 21 Dec 2020 15:31:12 +0800 Subject: [PATCH 87/93] Update README-zh_cn.md fixed typo --- README-zh_cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-zh_cn.md b/README-zh_cn.md index aab3d0d..41c18d6 100644 --- a/README-zh_cn.md +++ b/README-zh_cn.md @@ -66,7 +66,7 @@ yay -S neeto-vue-bin # pikaur -pikaur -S neeto-vue +pikaur -S neeto-vue-bin ``` ### 特色 From c110370bfaeed29b70d4750ac61178302037021f Mon Sep 17 00:00:00 2001 From: tanknee Date: Tue, 22 Dec 2020 13:13:24 +0800 Subject: [PATCH 88/93] =?UTF-8?q?202001222=201.=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=9B=B4=E7=AE=80=E5=8D=95=E7=9A=84=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=B9=E5=BC=8F=EF=BC=9A=E5=9C=A8=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E4=B8=AD=E5=8F=B3=E9=94=AE=E9=80=89=E6=8B=A9=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E4=B8=8A=E4=BC=A0=E3=80=82=202.=20=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E5=BA=9F=E5=BC=83=E6=8B=96=E6=8B=BD=E4=B8=8A=E4=BC=A0=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 ++ README-zh_cn.md | 22 +++---- README.md | 24 ++++++-- package.json | 2 +- share/channels.js | 4 +- .../main-process/3rd-part/PicGoUtils.js | 10 ++++ src-electron/main-process/Api.js | 33 ++++++++-- src/ApiHandler.js | 20 ++++++- src/boot/request.js | 2 +- src/components/Vditor.vue | 12 +++- src/components/ui/menu/VditorContextMenu.vue | 60 ++++++++++++++----- src/constants/events.js | 1 + src/i18n/en-us/components/ui/NoteItem.js | 3 +- .../en-us/components/ui/VditorContextMenu.js | 5 +- src/i18n/zh-cn/components/ui/NoteItem.js | 3 +- .../zh-cn/components/ui/VditorContextMenu.js | 5 +- src/pages/Index.vue | 5 +- src/store/client/actions.js | 19 ++++-- src/utils/api.js | 2 +- 19 files changed, 188 insertions(+), 49 deletions(-) create mode 100644 src-electron/main-process/3rd-part/PicGoUtils.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 81403f5..c4e7f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGE LOG +## 2020 12 22 Update 0.0.23 + +1. 实现更简单的图片上传方式:在编辑器中右键选择图片上传。 +2. 暂时废弃拖拽上传的方式。 + ## 2020 12 19 Update 0.0.22 1. 添加中文Readme文件 diff --git a/README-zh_cn.md b/README-zh_cn.md index ce96ab6..a2c426b 100644 --- a/README-zh_cn.md +++ b/README-zh_cn.md @@ -76,28 +76,32 @@ - 快捷键: [vditor 快捷键](https://ld246.com/guide/markdown) -- 支持将笔记发送到Flomo浮墨 +- 支持将笔记发送到 Flomo 浮墨 - 支持笔记锁定模式 - ### 注意事项 - 移动笔记时还存在一些问题。暂时不可用。 - 图片上传还只支持拖拽上传和直接填写图片链接 - 使用为知官方图片服务时只会显示图片的临时地址 -- 图片上传服务暂时只可用第三方web上传服务。(设置 >> 编辑器 >> 图片上传服务)参数填写方式请参照:[picgo-plugin-web-uploader](https://github.com/yuki-xin/picgo-plugin-web-uploader) - - `url`: 图床上传API地址 - - `paramName`: POST参数名(eg:`image`) - - `jsonPath`: 图片URL所在返回值的`JsonPath(eg:data.url)` - - `customHeader`: 自定义请求头 标准JSON(eg: `{"key":"value"}`) - - `customBody`: 自定义Body 标准JSON(eg: `{"key":"value"}`) +- 图片上传服务暂时只可用第三方 web 上传服务。(设置 >> 编辑器 >> 图片上传服务)参数填写方式请参照:[picgo-plugin-web-uploader](https://github.com/yuki-xin/picgo-plugin-web-uploader) + - `url`: 图床上传 API 地址 + - `paramName`: POST 参数名(eg:`image`) + - `jsonPath`: 图片 URL 所在返回值的`JsonPath(eg:data.url)` + - `customHeader`: 自定义请求头 标准 JSON(eg: `{"key":"value"}`) + - `customBody`: 自定义 Body 标准 JSON(eg: `{"key":"value"}`) ### 更新记录
版本变更记录 +## 2020 12 22 Update 0.0.23 + +1. 实现更简单的图片上传方式:在编辑器中右键选择图片上传。 +2. 暂时废弃拖拽上传的方式。 + ## 2020 12 19 Update 0.0.22 1. 添加中文 Readme 文件 @@ -154,8 +158,6 @@
- - ### License [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) diff --git a/README.md b/README.md index 48c28f3..b4c4a3d 100644 --- a/README.md +++ b/README.md @@ -98,35 +98,48 @@ You are also be able to check update in Neeto-Vue Settings Dialog
Version change log +## 2020 12 22 Update 0.0.23 + +1. To achieve a simpler image upload method: right click in the editor and select the image to upload. +2. Temporarily abandon the drag upload mode. + ## 2020 12 19 Update 0.0.22 + 1. Add Chinese readme file 2. Improve the readme description 3. Add note locking function to make it easier to check notes. ## 2020 12 17 Update 0.0.21 + 1. Add flomo API support. Set > > Service > > inkjet. Then use the right-click menu in the list to send notes to flomo 2. Upgrade note editor to v3.7.1 3. Cache key naming policy adjustment ## 2020 12 03 Update 0.0.20 + 1. Fixed the problem that the server could not display the folder when it returned the out of order folder list ## 2020 11 30 Update 0.0.19 + 1. Repair the export failure when there are illegal characters in the note name ## 2020 11 27 Update 0.0.18 + 1. Export a single file to markdown 2. Export the entire folder to the specified directory in the format of markdown ## 2020 09 27 Update 0.0.6 + 1. Better login experience 2. Optimize the interface without content 3. Optimize code logic ## 2020 09 26 Update 0.0.5 + 1. Add GitHub to build automatically ## 2020 09 25 Update 0.0.4 + 1. Optimize the header display in MacOS 2. Add vdtor shortcut key, [shortcut key to check address]( https://ld246.com/guide/markdown ) 3. Optimization Icon @@ -135,13 +148,14 @@ You are also be able to check update in Neeto-Vue Settings Dialog 6. Optimize invalid code ## 2020 09 22 Update 0.0.3 + 1. Version updated to 0.0.3 2. Add drag and drop image upload -1. Drag the picture directly into the editor -2. Remember to click the location of the image to be inserted first, otherwise it will be inserted directly into the place where I last clicked. I have no way to fix it for the time being -3. Fix the size of editor area -4. Add notes to modify the date display -5. Fix the problem of missing translation +3. Drag the picture directly into the editor +4. Remember to click the location of the image to be inserted first, otherwise it will be inserted directly into the place where I last clicked. I have no way to fix it for the time being +5. Fix the size of editor area +6. Add notes to modify the date display +7. Fix the problem of missing translation
diff --git a/package.json b/package.json index 6735aca..4a90409 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neeto.vue.electron", - "version": "0.0.22", + "version": "0.0.23", "description": "An Awesome WizNote Desktop Application", "productName": "Neeto-Vue", "author": "tanknee ", diff --git a/share/channels.js b/share/channels.js index 8e84486..201cd8a 100644 --- a/share/channels.js +++ b/share/channels.js @@ -1,4 +1,6 @@ export default { exportMarkdownFile: 'export-markdown-file', - exportMarkdownFiles: 'export-markdown-files' + exportMarkdownFiles: 'export-markdown-files', + importImages: 'import-images', + uploadImages: 'upload-images' } diff --git a/src-electron/main-process/3rd-part/PicGoUtils.js b/src-electron/main-process/3rd-part/PicGoUtils.js new file mode 100644 index 0000000..1561f63 --- /dev/null +++ b/src-electron/main-process/3rd-part/PicGoUtils.js @@ -0,0 +1,10 @@ +const axios = require('axios') +/** + * upload images + * @param {string[]} imagePaths + * @returns Promise + */ +export async function uploadImages (imagePaths) { + const result = await axios.post('http://127.0.0.1:36677/upload', { list: imagePaths }, { timeout: 60 * 1000 }) + return result.data +} diff --git a/src-electron/main-process/Api.js b/src-electron/main-process/Api.js index 9759b60..f78d890 100644 --- a/src-electron/main-process/Api.js +++ b/src-electron/main-process/Api.js @@ -1,6 +1,8 @@ // import channels from 'app/share/channels' // import i18n from 'boot/i18n' +const { uploadImages } = require('./3rd-part/PicGoUtils') + const { ipcMain, app, dialog } = require('electron') const sanitize = require('sanitize-filename') @@ -35,7 +37,9 @@ async function handleApi (channel, api) { export default { registerApiHandler () { - console.log('Registering') + /** + * export single note + */ handleApi('export-markdown-file', (event, content) => { return dialog.showSaveDialog({ title: 'Export', @@ -50,8 +54,10 @@ export default { if (result.canceled) return fs.writeFile(result.filePath, content).catch(err => throw err) }).catch(err => throw err) - }) - + }).catch(err => throw err) + /** + * batch export notes + */ handleApi('export-markdown-files', (event, contents) => { return dialog.showOpenDialog({ title: 'Export', @@ -63,12 +69,31 @@ export default { buttonLabel: 'Confirm' }).then((result) => { if (result.canceled) return - const promises = contents.map(({ content, title }) => { + const promises = contents.map(({ + content, + title + }) => { title = sanitize(title) return fs.writeFile(`${result.filePaths[0]}/${title}.md`, content).catch(err => throw err) }) Promise.all(promises).catch(err => throw err) }).catch(err => throw err) + }).catch(err => throw err) + /** + * batch import images + */ + handleApi('import-images', async (event) => { + const result = await dialog.showOpenDialog({ + title: 'Import Images', + defaultPath: app.getPath('pictures'), + properties: ['multiSelections', 'openFile'] + }) + if (result.canceled) return + return result.filePaths + }) + handleApi('upload-images', async (event, imagePaths) => { + const uploadResult = await uploadImages(imagePaths) + return uploadResult }) } } diff --git a/src/ApiHandler.js b/src/ApiHandler.js index d297f68..619ff24 100644 --- a/src/ApiHandler.js +++ b/src/ApiHandler.js @@ -19,7 +19,25 @@ async function exportMarkdownFile (note) { async function exportMarkdownFiles (notes) { return await ipcRenderer.invoke(channels.exportMarkdownFiles, notes) } + +/** + * import images + * @returns {Promise} + */ +async function importImages () { + return await ipcRenderer.invoke(channels.importImages) +} + +/** + * @param {string[]} imagePaths + * @returns {Promise} + */ +async function uploadImages (imagePaths) { + return await ipcRenderer.invoke(channels.uploadImages, imagePaths) +} export { exportMarkdownFile, - exportMarkdownFiles + exportMarkdownFiles, + importImages, + uploadImages } diff --git a/src/boot/request.js b/src/boot/request.js index 7c65612..2e206d3 100644 --- a/src/boot/request.js +++ b/src/boot/request.js @@ -11,7 +11,7 @@ axios.defaults.baseURL = baseUrl /** * execute network request - * @param {string} method + * @param {'GET','POST','DELETE','PUT'} method * @param {string} url * @param {Object} body * @param token diff --git a/src/components/Vditor.vue b/src/components/Vditor.vue index ccdef49..cc359f9 100644 --- a/src/components/Vditor.vue +++ b/src/components/Vditor.vue @@ -82,7 +82,11 @@ export default { upload: { max: 5 * 1024 * 1024, async handler (files) { - await files.map(async file => await that.uploadImage(file)) + that.$q.notify({ + type: 'negative', + message: 'Drag images to upload has been marked as unavailable' + }) + // await files.map(async file => await that.uploadImage(file)) } }, debugger: process.env.DEV, @@ -120,6 +124,12 @@ export default { bus.$on(events.INSERT_IMAGE, url => { this.contentEditor.insertValue(`\n![](${url})`, true) }) + bus.$on(events.INSERT_IMAGES, urls => { + urls = urls || [] + urls.forEach(url => { + this.contentEditor.insertValue(`\n![](${url})`, true) + }) + }) bus.$on(events.SAVE_NOTE, () => { this.updateNote(this.contentEditor.getValue()) }) diff --git a/src/components/ui/menu/VditorContextMenu.vue b/src/components/ui/menu/VditorContextMenu.vue index 68cb0a5..f300d62 100644 --- a/src/components/ui/menu/VditorContextMenu.vue +++ b/src/components/ui/menu/VditorContextMenu.vue @@ -1,33 +1,65 @@ diff --git a/src/constants/events.js b/src/constants/events.js index c416944..874be74 100644 --- a/src/constants/events.js +++ b/src/constants/events.js @@ -4,6 +4,7 @@ export default { SETTINGS_UPDATE: 'settings.update' }, INSERT_IMAGE: 'insert.image', + INSERT_IMAGES: 'insert.images', SAVE_NOTE: 'save.note', SCROLL_TO_HEADER: 'scroll.to.header' } diff --git a/src/i18n/en-us/components/ui/NoteItem.js b/src/i18n/en-us/components/ui/NoteItem.js index 0e816fa..5574158 100644 --- a/src/i18n/en-us/components/ui/NoteItem.js +++ b/src/i18n/en-us/components/ui/NoteItem.js @@ -1,5 +1,6 @@ export default { modifiedAt: 'Modified At {date}', discardNote: 'Discard Note', - discardNoteHint: 'Do you want to discard note changes without saving it ?' + discardNoteHint: 'Do you want to discard note changes without saving it ?', + ok: 'OK' } diff --git a/src/i18n/en-us/components/ui/VditorContextMenu.js b/src/i18n/en-us/components/ui/VditorContextMenu.js index af90826..cb07c5c 100644 --- a/src/i18n/en-us/components/ui/VditorContextMenu.js +++ b/src/i18n/en-us/components/ui/VditorContextMenu.js @@ -1,3 +1,6 @@ export default { - insertImage: 'Insert Image' + insertImage: 'Insert Image', + uploadingImages: 'Uploading Images', + uploadSuccessfully: 'Upload images successfully', + failToUpload: 'Fail to upload images' } diff --git a/src/i18n/zh-cn/components/ui/NoteItem.js b/src/i18n/zh-cn/components/ui/NoteItem.js index e9c9838..86436ac 100644 --- a/src/i18n/zh-cn/components/ui/NoteItem.js +++ b/src/i18n/zh-cn/components/ui/NoteItem.js @@ -1,5 +1,6 @@ export default { modifiedAt: '修改于 {date}', discardNote: '丢弃当前笔记的修改', - discardNoteHint: '是否丢弃对当前笔记的修改并切换笔记?' + discardNoteHint: '是否丢弃对当前笔记的修改并切换笔记?', + ok: '是' } diff --git a/src/i18n/zh-cn/components/ui/VditorContextMenu.js b/src/i18n/zh-cn/components/ui/VditorContextMenu.js index 3c32574..dac3301 100644 --- a/src/i18n/zh-cn/components/ui/VditorContextMenu.js +++ b/src/i18n/zh-cn/components/ui/VditorContextMenu.js @@ -1,3 +1,6 @@ export default { - insertImage: '插入图片' + insertImage: '插入图片', + uploadingImages: '正在上传图片', + uploadSuccessfully: '图片上传成功', + failToUpload: '图片上传失败' } diff --git a/src/pages/Index.vue b/src/pages/Index.vue index 78012ca..5fbc3f8 100644 --- a/src/pages/Index.vue +++ b/src/pages/Index.vue @@ -25,6 +25,7 @@ class="exclude-header overflow-hidden" > + + @@ -78,6 +80,7 @@ import helper from 'src/utils/helper' import { createNamespacedHelpers } from 'vuex' import NoteOutlineDrawer from 'components/ui/NoteOutlineDrawer' import Loading from 'components/ui/Loading' +import VditorContextMenu from 'components/ui/menu/VditorContextMenu' const { mapGetters: mapServerGetters, mapState: mapServerState @@ -86,7 +89,7 @@ const { mapState: mapClientState } = createNamespacedHelpers('client') // import Sidebar from '../components/Sidebar' export default { name: 'PageIndex', - components: { Loading, NoteOutlineDrawer, Vditor, NoteList }, + components: { VditorContextMenu, Loading, NoteOutlineDrawer, Vditor, NoteList }, computed: { thumbStyle () { return { diff --git a/src/store/client/actions.js b/src/store/client/actions.js index c3ec929..5db21a3 100644 --- a/src/store/client/actions.js +++ b/src/store/client/actions.js @@ -5,6 +5,7 @@ import ClientFileStorage from 'src/utils/storage/ClientFileStorage' import helper from 'src/utils/helper' import { i18n } from 'boot/i18n' import _ from 'lodash' +import { importImages, uploadImages } from 'src/ApiHandler' export default { initClientStore ({ commit, state }) { @@ -45,14 +46,16 @@ export default { }) const isHtml = !_.endsWith(note.info.title, '.md') let content - const { - html, - resources - } = note + const { html, resources } = note if (isHtml) { content = helper.convertHtml2Markdown(html, kbGuid, docGuid, resources) } else { - content = helper.extractMarkdownFromMDNote(html, kbGuid, docGuid, resources) + content = helper.extractMarkdownFromMDNote( + html, + kbGuid, + docGuid, + resources + ) } await api.ThirdPartApi.sendToFlomo(content, flomoApiUrl) Notify.create({ @@ -60,5 +63,11 @@ export default { color: 'green-10', icon: 'check' }) + }, + async importImagesFromLocal () { + return importImages() + }, + async uploadImages ({ state }, imagePaths) { + return uploadImages(imagePaths) } } diff --git a/src/utils/api.js b/src/utils/api.js index 8998275..b3d1fe7 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -1,4 +1,4 @@ -import { execRequest } from '../boot/request' +import { execRequest } from 'boot/request' import FormData from 'form-data' import { UploadImageToCustomWebService } from 'src/service/imageCustomWebUploadService' let AccountServerBaseUrl = 'https://as.wiz.cn' From 7e913d5233c167591b109f54d9264b126891af17 Mon Sep 17 00:00:00 2001 From: tanknee Date: Thu, 24 Dec 2020 12:26:18 +0800 Subject: [PATCH 89/93] =?UTF-8?q?202001224=201.=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=A0=87=E7=AD=BE=E7=B3=BB=E7=BB=9F=E3=80=82?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=9F=A5=E7=9C=8B=E6=9F=90=E4=B8=80=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E4=B8=8B=E7=9A=84=E5=85=A8=E9=83=A8=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-zh_cn.md | 24 ++-- README.md | 31 +++--- src/boot/request.js | 3 +- src/components/Header.vue | 34 +++++- src/components/NoteList.vue | 17 ++- .../ui/{CategoryDrawer.vue => SideDrawer.vue} | 27 ++++- src/i18n/en-us/components/Header.js | 3 +- src/i18n/zh-cn/components/Header.js | 3 +- src/store/server/actions.js | 79 +++++++++++++- src/store/server/getters.js | 3 + src/store/server/mutations.js | 6 + src/store/server/state.js | 3 +- src/store/server/types.js | 3 +- src/utils/api.js | 103 +++++++++++++++--- src/utils/helper.js | 22 ++++ 15 files changed, 287 insertions(+), 74 deletions(-) rename src/components/ui/{CategoryDrawer.vue => SideDrawer.vue} (70%) diff --git a/README-zh_cn.md b/README-zh_cn.md index 0bfe086..c9339a4 100644 --- a/README-zh_cn.md +++ b/README-zh_cn.md @@ -6,23 +6,21 @@ ### 目录 -[目录](#目录) +- [状态](#状态) -[状态](#状态) +- [介绍](#介绍) -[介绍](#介绍) +- [为知社区](#为知社区) -[为知社区](#为知社区) +- [软件截图](#软件截图) -[软件截图](#软件截图) +- [下载](#下载) -[下载](#下载) +- [特色](#特色) -[特色](#特色) +- [注意事项](#注意事项) -[注意事项](#注意事项) - -[更新日志](#更新记录) +- [更新日志](#更新记录) ### 状态 @@ -56,11 +54,13 @@ ![image-20201011103144579](./screenshot/image-20201011103144579.png) -### Arch Linux +#### Arch Linux 可以通过 [AUR](https://aur.archlinux.org/packages/neeto-vue-bin/) 安装 -``` +感谢[yjun123](https://github.com/yjun123)。 + +```bash # AUR helper # yay yay -S neeto-vue-bin diff --git a/README.md b/README.md index 3ffb94e..85936cf 100644 --- a/README.md +++ b/README.md @@ -6,23 +6,21 @@ ### Content -[Content](#content) +- [Status](#status) -[Status](#status) +- [Installation](#installation) -[Introduction](#introduction) +- [Wiz Community](#wiz-community) -[Wiz Community](#wiz-community) +- [ScreenShot](#screenshot) -[ScreenShot](#screenshot) +- [Download](#download) -[Download](#download) +- [Feature](#feature) -[Feature](#feature) +- [Attention](#attention) -[Attention](#attention) - -[Change Log](#change-log) +- [Change Log](#change-log) ### Status @@ -49,7 +47,7 @@ If you intend to prompt the development of Wiz Community,join us pls! ![image-20200925170327136](./screenshot/image-20200925170327136.png) -### Download +### Installation [Releases](https://github.com/TankNee/Neeto-Vue/releases/latest) @@ -57,11 +55,13 @@ You are also be able to check update in Neeto-Vue Settings Dialog ![image-20201011103144579](./screenshot/image-20201011103144579.png) -### Arch Linux +#### Arch Linux -install and upgrade from [AUR](https://aur.archlinux.org/packages/neeto-vue-bin/) +Install and upgrade from [AUR](https://aur.archlinux.org/packages/neeto-vue-bin/) -``` +Thanks to [yjun123](https://github.com/yjun123)'s contribution. + +```bash # AUR helper # yay yay -S neeto-vue-bin @@ -124,7 +124,7 @@ pikaur -S neeto-vue-bin ## 2020 12 17 Update 0.0.21 -1. Add flomo API support. Set > > Service > > inkjet. Then use the right-click menu in the list to send notes to flomo +1. Add flomo API support. Set > > Service > > flomo. Then use the right-click menu in the list to send notes to flomo 2. Upgrade note editor to v3.7.1 3. Cache key naming policy adjustment @@ -173,4 +173,5 @@ pikaur -S neeto-vue-bin ### License + [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FTankNee%2FNeeto-Vue?ref=badge_large) diff --git a/src/boot/request.js b/src/boot/request.js index 2e206d3..4b2fda8 100644 --- a/src/boot/request.js +++ b/src/boot/request.js @@ -5,7 +5,6 @@ import NeetoError from 'app/share/error' import ServerFileStorage from 'src/utils/storage/ServerFileStorage' axios.defaults.timeout = 50000 // 响应时间 -// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8' // 配置请求头 const baseUrl = 'https://ac.wiz.cn' axios.defaults.baseURL = baseUrl @@ -20,7 +19,7 @@ axios.defaults.baseURL = baseUrl * @param {boolean} ignoreStatusCode * @returns {Promise<*>} */ -export async function execRequest (method, url, body, token, extraConfig, returnFullResult = false, ignoreStatusCode) { +export async function execRequest (method, url, body = {}, token = null, extraConfig = {}, returnFullResult = false, ignoreStatusCode = false) { const config = { url, method, diff --git a/src/components/Header.vue b/src/components/Header.vue index e8aaff7..824979b 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -19,7 +19,8 @@ @click.stop=" () => { if (isLogin) { - $refs.categoryDrawer.toggle() + drawerType = 'category' + $refs.sideDrawer.toggle() } } " @@ -31,6 +32,26 @@ >{{ $t('noteCategory') }}
+ + + {{ $t('tag') }} + + {{ enableVditor ? $t('lock') : $t('unlock') }} @@ -141,7 +162,7 @@ - + @@ -149,7 +170,7 @@ import LoginDialog from './ui/dialog/LoginDialog' import SettingsDialog from './ui/dialog/SettingsDialog' -import CategoryDrawer from './ui/CategoryDrawer' +import SideDrawer from './ui/SideDrawer' import { createNamespacedHelpers } from 'vuex' import helper from 'src/utils/helper' const { @@ -194,10 +215,11 @@ export default { return this.currentNote && !helper.isNullOrEmpty(this.currentNote.html) } }, - components: { CategoryDrawer, SettingsDialog, LoginDialog }, + components: { SideDrawer, SettingsDialog, LoginDialog }, data () { return { - searchText: '' + searchText: '', + drawerType: 'category' } }, methods: { diff --git a/src/components/NoteList.vue b/src/components/NoteList.vue index be7a560..9cab8f6 100644 --- a/src/components/NoteList.vue +++ b/src/components/NoteList.vue @@ -118,15 +118,20 @@ export default { }, category: function () { if (helper.isNullOrEmpty(this.currentCategory)) return '' - try { - const categoryList = this.currentCategory.split('/') - return categoryList[categoryList.length - 2] - } catch (e) { - return '' + const tagIndex = this.tags.findIndex(t => t.tagGuid === this.currentCategory) + if (tagIndex !== -1) { + return this.tags[tagIndex].name + } else { + try { + const categoryList = this.currentCategory.split('/') + return categoryList[categoryList.length - 2] + } catch (e) { + return '' + } } }, ...mapGetters(['activeNote', 'currentNotes']), - ...mapState(['isCurrentNotesLoading', 'currentCategory', 'isLogin']) + ...mapState(['isCurrentNotesLoading', 'currentCategory', 'isLogin', 'tags']) }, methods: { handleAddNote: function () { diff --git a/src/components/ui/CategoryDrawer.vue b/src/components/ui/SideDrawer.vue similarity index 70% rename from src/components/ui/CategoryDrawer.vue rename to src/components/ui/SideDrawer.vue index 46145f5..a581c68 100644 --- a/src/components/ui/CategoryDrawer.vue +++ b/src/components/ui/SideDrawer.vue @@ -1,7 +1,7 @@ @@ -177,6 +193,8 @@ import SettingsDialog from './ui/dialog/SettingsDialog' import SideDrawer from './ui/SideDrawer' import { createNamespacedHelpers } from 'vuex' import helper from 'src/utils/helper' +import defaultAvatarBase64 from 'src/assets/default-avatar' +import TagDialog from 'components/ui/dialog/TagDialog' const { mapState: mapServerState, mapGetters: mapServerGetters, @@ -200,6 +218,10 @@ export default { darkMode: function () { return this.$q.dark.isActive }, + defaultAvatar: function () { + return defaultAvatarBase64 + }, + title: function () { if (this.currentNote.info) { let { title } = this.currentNote.info @@ -229,7 +251,7 @@ export default { return this.tagsOfCurrentNote.map(t => t.name) } }, - components: { SideDrawer, SettingsDialog, LoginDialog }, + components: { TagDialog, SideDrawer, SettingsDialog, LoginDialog }, data () { return { searchText: '', diff --git a/src/components/NoteList.vue b/src/components/NoteList.vue index 9cab8f6..1b58755 100644 --- a/src/components/NoteList.vue +++ b/src/components/NoteList.vue @@ -29,7 +29,7 @@ v-ripple v-if="isLogin" > - {{category}} + {{ category }} {{ $t('deleteCategory') }} - + {{ $t('export') }}{{ $t('export') }} - + {{ $t('createNote') }} @@ -80,7 +97,11 @@ anchor="center right" self="center left" :offset="[20, 10]" - :content-class="`bg-${$q.dark.isActive ? 'warning' : 'primary'} text-white shadow-4 text-h7`" + :content-class=" + `bg-${ + $q.dark.isActive ? 'warning' : 'primary' + } text-white shadow-4 text-h7` + " >{{ $t('createCategory') }} @@ -118,7 +139,9 @@ export default { }, category: function () { if (helper.isNullOrEmpty(this.currentCategory)) return '' - const tagIndex = this.tags.findIndex(t => t.tagGuid === this.currentCategory) + const tagIndex = this.tags.findIndex( + t => t.tagGuid === this.currentCategory + ) if (tagIndex !== -1) { return this.tags[tagIndex].name } else { @@ -183,14 +206,20 @@ export default { this.exportMarkdownFiles(this.currentNotes) }, handleRefreshNoteList: async function (done) { - await this.getCategoryNotes({ category: this.currentCategory }) + const tagIndex = this.tags.findIndex( + t => t.tagGuid === this.currentCategory + ) + await this.updateCurrentCategory({ + type: tagIndex === -1 ? 'category' : 'tag', + data: this.currentCategory + }) done() }, ...mapActions([ 'createNote', 'createCategory', 'deleteCategory', - 'getCategoryNotes', + 'updateCurrentCategory', 'exportMarkdownFiles' ]) } @@ -201,10 +230,10 @@ export default { .note-list-bottom { max-height: 4.5vh; padding: 4px !important; - color: #9B9B9B; + color: #9b9b9b; user-select: none; font-size: 13px; font-weight: bold; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif, 黑体; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif, 黑体; } diff --git a/src/components/ui/SideDrawer.vue b/src/components/ui/SideDrawer.vue index a581c68..11a17f8 100644 --- a/src/components/ui/SideDrawer.vue +++ b/src/components/ui/SideDrawer.vue @@ -20,6 +20,10 @@ @update:selected=" v => { updateCurrentCategory({ data: v, type: type }) + toggleChanged({ + key: 'noteListVisible', + value: true + }) } " /> @@ -35,6 +39,8 @@ const { mapState: mapServerState } = createNamespacedHelpers('server') +const { mapActions: mapClientActions } = createNamespacedHelpers('client') + export default { name: 'CategoryDrawer', props: { @@ -68,12 +74,18 @@ export default { toggle: function () { this.$refs.drawer.toggle() }, + show: function () { + if (this.$refs.drawer) { + this.$refs.drawer.show() + } + }, hide: function () { if (this.$refs.drawer) { this.$refs.drawer.hide() } }, - ...mapServerActions(['updateCurrentCategory']) + ...mapServerActions(['updateCurrentCategory']), + ...mapClientActions(['toggleChanged']) }, mounted () { const that = this @@ -82,7 +94,9 @@ export default { e.path[1] && e.path[1].className && e.path[1].className.indexOf('q-tree__node') !== -1 - ) { return } + ) { + return + } that.hide() }) } diff --git a/src/components/ui/dialog/TagDialog.vue b/src/components/ui/dialog/TagDialog.vue new file mode 100644 index 0000000..2708796 --- /dev/null +++ b/src/components/ui/dialog/TagDialog.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/src/css/style.css b/src/css/style.css index 8b30a19..edbe41c 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -147,6 +147,7 @@ body.body--dark { .base-dialog { width: 500px !important; max-width: 50vw; + font-weight: bold; } .neeto-icon { color: #000000; diff --git a/src/store/server/actions.js b/src/store/server/actions.js index da043e6..4fc0ec4 100644 --- a/src/store/server/actions.js +++ b/src/store/server/actions.js @@ -195,6 +195,8 @@ export default { await this.dispatch('server/getCategoryNotes', { category: data }) } else if (type === 'tag') { await this.dispatch('server/getTagNotes', { tag: data }) + } else { + await this.dispatch('server/getCategoryNotes', { category: '' }) } commit(types.UPDATE_CURRENT_CATEGORY, data) commit(types.SAVE_TO_LOCAL_STORE_SYNC, ['currentCategory', data]) @@ -489,7 +491,7 @@ export default { commit(types.UPDATE_CURRENT_NOTES_LOADING_STATE, false) }, updateContentsList ({ commit }, editorRootElement) { - const list = helper.updateContentsList(editorRootElement) + const list = helper.updateContentsList(editorRootElement) || [] commit(types.UPDATE_CONTENTS_LIST, list) }, updateNoteState ({ commit }, noteState) { From fa59d818afb042b9226163678ed1ae1c048e3cb8 Mon Sep 17 00:00:00 2001 From: tanknee Date: Fri, 25 Dec 2020 17:26:49 +0800 Subject: [PATCH 92/93] =?UTF-8?q?202001225=201.=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=9A=84=E5=88=A0=E9=99=A4=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header.vue | 4 +- src/components/ui/dialog/TagDialog.vue | 191 +++++++++++++++------- src/css/style.css | 5 + src/i18n/en-us/components/ui/TagDialog.js | 5 + src/i18n/en-us/components/ui/index.js | 4 +- src/i18n/zh-cn/components/ui/TagDialog.js | 5 + src/i18n/zh-cn/components/ui/index.js | 4 +- src/pages/Index.vue | 2 +- src/store/server/actions.js | 59 ++++++- src/store/server/getters.js | 2 +- src/store/server/mutations.js | 4 + src/store/server/types.js | 3 +- src/utils/helper.js | 10 ++ 13 files changed, 232 insertions(+), 66 deletions(-) create mode 100644 src/i18n/en-us/components/ui/TagDialog.js create mode 100644 src/i18n/zh-cn/components/ui/TagDialog.js diff --git a/src/components/Header.vue b/src/components/Header.vue index b930397..691db27 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -14,7 +14,7 @@ {{ tag @@ -142,7 +142,7 @@ {{ tag diff --git a/src/components/ui/dialog/TagDialog.vue b/src/components/ui/dialog/TagDialog.vue index 2708796..6fc0283 100644 --- a/src/components/ui/dialog/TagDialog.vue +++ b/src/components/ui/dialog/TagDialog.vue @@ -5,11 +5,7 @@ style="max-height: 90vh;min-height: 70vh;min-width: 70vw" > - + {{ $t('tag') @@ -18,34 +14,55 @@ - - - - +
+
+ + {{ name }} + +
+
+
+ + + + +
@@ -53,15 +70,19 @@