Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52f3e6a265 | ||
|
|
b5099854af | ||
|
|
d42b31cea2 | ||
|
|
69e0c77444 | ||
|
|
ee4394873b | ||
|
|
f2845cdcbf | ||
|
|
bbee873b64 | ||
|
|
f5fee16130 | ||
|
|
f4b82204c1 | ||
|
|
f1a06a3f52 | ||
|
|
ae4e67f3b4 | ||
|
|
254231e4bd | ||
|
|
871e8dc3cf | ||
|
|
85aed7cfb9 | ||
|
|
3f7a6dbf6a | ||
|
|
13cca9025e | ||
|
|
a81af9ccec | ||
|
|
db86a75534 | ||
|
|
72e059d5cc | ||
|
|
b083f006b1 | ||
|
|
12ed023cd1 | ||
|
|
5c86bc039d | ||
|
|
91e358fcea | ||
|
|
733fa1d306 | ||
|
|
f256936bae | ||
|
|
7228398d0a | ||
|
|
6ed04a651b | ||
|
|
be5518e320 | ||
|
|
c7bb3646a4 | ||
|
|
428e23941a | ||
|
|
1012bf3d09 | ||
|
|
57bdc4d0c6 | ||
|
|
3c85fff17c |
@@ -34,7 +34,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [20.x]
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
- name: Git LFS Pull
|
- name: Git LFS Pull
|
||||||
run: git lfs pull
|
run: git lfs pull
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [20.x]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout codes
|
- name: Checkout codes
|
||||||
@@ -57,7 +57,7 @@ jobs:
|
|||||||
- name: Git LFS Pull
|
- name: Git LFS Pull
|
||||||
run: git lfs pull
|
run: git lfs pull
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ This is yet another unofficial sync plugin for Obsidian. If you like it or find
|
|||||||
- **You should protect your `data.json` file.** The file contains sensitive information.
|
- **You should protect your `data.json` file.** The file contains sensitive information.
|
||||||
- It's strongly advised **NOT** to share your `data.json` file to anyone.
|
- It's strongly advised **NOT** to share your `data.json` file to anyone.
|
||||||
- It's usually **NOT** a good idea to check the file into version control. By default, the plugin tries to create a `.gitignore` file inside the plugin directory if it doesn't exist, for ignoring `data.json` in the `git` version control. If you know exactly what it means and want to remove the setting, please modify the `.gitignore` file or set it to be empty.
|
- It's usually **NOT** a good idea to check the file into version control. By default, the plugin tries to create a `.gitignore` file inside the plugin directory if it doesn't exist, for ignoring `data.json` in the `git` version control. If you know exactly what it means and want to remove the setting, please modify the `.gitignore` file or set it to be empty.
|
||||||
|
- **Obsidian API on Mobile has performance issues syncing large files (>= 50 MB).**
|
||||||
|
- Setting the "Skip Large Files" option can help resolve issues related to syncing large files.
|
||||||
|
|
||||||
## Questions, Suggestions, Or Bugs
|
## Questions, Suggestions, Or Bugs
|
||||||
|
|
||||||
@@ -112,6 +114,7 @@ Additionally, the plugin author may occasionally visit Obsidian official forum a
|
|||||||
- [ownCloud](./docs/remote_services/webdav_owncloud/README.md)
|
- [ownCloud](./docs/remote_services/webdav_owncloud/README.md)
|
||||||
- [InfiniCloud](./docs/remote_services/webdav_infinicloud_teracloud/README.md)
|
- [InfiniCloud](./docs/remote_services/webdav_infinicloud_teracloud/README.md)
|
||||||
- [Synology webdav server](./docs/remote_services/webdav_synology_webdav_server/README.md) | [群晖 webdav server](./docs/remote_services/webdav_synology_webdav_server/README.zh-cn.md)
|
- [Synology webdav server](./docs/remote_services/webdav_synology_webdav_server/README.md) | [群晖 webdav server](./docs/remote_services/webdav_synology_webdav_server/README.zh-cn.md)
|
||||||
|
- [dufs](./docs/remote_services/webdav_dufs/README.md)
|
||||||
- [AList(中文)](./docs/remote_services/webdav_alist/README.zh-cn.md) | [AList (English)](./docs/remote_services/webdav_alist/README.md)
|
- [AList(中文)](./docs/remote_services/webdav_alist/README.zh-cn.md) | [AList (English)](./docs/remote_services/webdav_alist/README.md)
|
||||||
- [坚果云](./docs/remote_services/webdav_jianguoyun/README.zh-cn.md) | [JianGuoYun/NutStore](./docs/remote_services/webdav_jianguoyun/README.md)
|
- [坚果云](./docs/remote_services/webdav_jianguoyun/README.zh-cn.md) | [JianGuoYun/NutStore](./docs/remote_services/webdav_jianguoyun/README.md)
|
||||||
- [Open Media Vault](./docs/remote_services/webdav_openmediavault/README.md)
|
- [Open Media Vault](./docs/remote_services/webdav_openmediavault/README.md)
|
||||||
@@ -161,7 +164,7 @@ PRO (paid) feature "sync with Azure Blob Storage" allows users to to sync with A
|
|||||||
|
|
||||||
Basic (free) version can detect conflicts, but users have to choose to keep newer version or larger version of the files.
|
Basic (free) version can detect conflicts, but users have to choose to keep newer version or larger version of the files.
|
||||||
|
|
||||||
PRO (paid) feature "Smart Conflict" gives users one more option: merge small markdown files, or duplicate large markdown files or non-markdown files.
|
PRO (paid) feature "Smart Conflict" gives users one more option: merge small markdown files, or duplicate large markdown files or any-size non-markdown files.
|
||||||
|
|
||||||
See documents [here](./docs/pro/README.md)
|
See documents [here](./docs/pro/README.md)
|
||||||
|
|
||||||
@@ -176,11 +179,19 @@ See documents [here](./docs/pro/README.md)
|
|||||||
- You can configure sync on save in settings.
|
- You can configure sync on save in settings.
|
||||||
- In sync on save mode, if any error occurs, the plugin would **fail silently**.
|
- In sync on save mode, if any error occurs, the plugin would **fail silently**.
|
||||||
|
|
||||||
## How To Deal With Hidden Files Or Folders
|
## Config Folder / Files and Bookmarks
|
||||||
|
|
||||||
|
By default, the plugin doesn't sync config folder / files of obsidian (normally `.obsidian` folder) because it's one of the hidden files.
|
||||||
|
|
||||||
|
However, in the latest version, you can enable syncing config folder in settings. Please be aware that it's an experimental feature. Notably some config files' modified times are changed everytime when Obsidian is opened, and this destroys the assumptions of the plugin, so some information may not be synced properly.
|
||||||
|
|
||||||
|
Moreover, the bookmarks of Obsidian are actually stored in `.obsidian/bookmarks.json` file. You can also set syncing this file (instead of the whole config folder) in settings. The plugin will keep the latest modified one across devices.
|
||||||
|
|
||||||
|
## Hidden Files Or Folders
|
||||||
|
|
||||||
**By default, all files or folder starting with `.` (dot) or `_` (underscore) are treated as hidden files, and would NOT be synced.** It's useful if you have some files just staying locally. But this strategy also means that themes / other plugins / settings of this plugin would neither be synced.
|
**By default, all files or folder starting with `.` (dot) or `_` (underscore) are treated as hidden files, and would NOT be synced.** It's useful if you have some files just staying locally. But this strategy also means that themes / other plugins / settings of this plugin would neither be synced.
|
||||||
|
|
||||||
In the latest version, you can change the settings to allow syncing `_` files or folders, as well as `.obsidian` special config folder (but not any other `.` files or folders).
|
In the latest version, you can change the settings to allow syncing `_` files or folders, as well as `.obsidian` special config folder as described above (but not any other `.` files or folders).
|
||||||
|
|
||||||
## PRO Features
|
## PRO Features
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
|
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
||||||
"organizeImports": {
|
"organizeImports": {
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
"jsxQuoteStyle": "double",
|
"jsxQuoteStyle": "double",
|
||||||
"quoteProperties": "asNeeded",
|
"quoteProperties": "asNeeded",
|
||||||
"semicolons": "always",
|
"semicolons": "always",
|
||||||
"trailingComma": "es5"
|
"trailingCommas": "es5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
|
|||||||
@@ -42,5 +42,5 @@ filename_encoding = base64 # don't forget this!!!
|
|||||||
You can use the `mount` command to view and see the files in file explorer! On Windows, the command should like this (the remote vault is mounted to drive `X:`):
|
You can use the `mount` command to view and see the files in file explorer! On Windows, the command should like this (the remote vault is mounted to drive `X:`):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rclone mount webdav1crypt: X: --network-mode
|
rclone mount webdav1crypt: X: --network-mode --vfs-cache-mode writes
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -6,12 +6,18 @@ Ideally, users do not need to debug anything. But if something bad happened, we
|
|||||||
|
|
||||||
See [here](./export_sync_plans.md).
|
See [here](./export_sync_plans.md).
|
||||||
|
|
||||||
## Advanced: Check Console Output Directly
|
## Medium: Desktop: Check Console Output Directly
|
||||||
|
|
||||||
...of desktop and Android.
|
...of desktop and Android.
|
||||||
|
|
||||||
See [here](./check_console_output.md).
|
See [here](./check_console_output.md).
|
||||||
|
|
||||||
|
## Medium: Mobile: Use `Obsidian vConsole` to Check Console Ouput Directly
|
||||||
|
|
||||||
|
...of mobile (iOS and Android).
|
||||||
|
|
||||||
|
See [here](./check_vconsole_output.md).
|
||||||
|
|
||||||
## Advanced: Use `Logstravaganza` to export logs
|
## Advanced: Use `Logstravaganza` to export logs
|
||||||
|
|
||||||
This method works for desktop and mobile devices (iOS, Android), especially useful for iOS.
|
This method works for desktop and mobile devices (iOS, Android), especially useful for iOS.
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ Go to the plugin settings, scroll down to the section "Debug" -> "alter console
|
|||||||
|
|
||||||
- If you are using Android
|
- If you are using Android
|
||||||
|
|
||||||
You need to [enable USB debugging](https://developer.android.com/studio/debug/dev-options#enable) on your Android, then connect your Android to a computer using USB, then open the **desktop** Chrome browser and go to the special web page <chrome://inspect>. You shall be able to see the "inspect" link inside the special page, then click the link to open the console. After debugging, remember to turn off USB debugging.
|
If you want to check the console **with the help of desktop Chrome**, you need to [enable USB debugging](https://developer.android.com/studio/debug/dev-options#enable) on your Android, then connect your Android to a computer using USB, then open the **desktop** Chrome browser and go to the special web page <chrome://inspect>. You shall be able to see the "inspect" link inside the special page, then click the link to open the console. After debugging, remember to turn off USB debugging.
|
||||||
|
|
||||||
|
If you want to check the console **directly on the mobile device**, check out [this doc](./check_vconsole_output.md).
|
||||||
|
|
||||||
Trigger the sync manually (by clicking the icon on the ribbon sidebar). Something (hopefully) helpful should show up in the console. You could understand what happened and what goes wrong more explictly by checking the output.
|
Trigger the sync manually (by clicking the icon on the ribbon sidebar). Something (hopefully) helpful should show up in the console. You could understand what happened and what goes wrong more explictly by checking the output.
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Check "Obsidian vConsole" Output
|
||||||
|
|
||||||
|
It's quite hard to debug on mobile. But fortunately you can use another plugin to rescue!
|
||||||
|
|
||||||
|
This applies to both iOS (iPhone / iPad) and Android.
|
||||||
|
|
||||||
|
## Disable Auto Sync Firstly
|
||||||
|
|
||||||
|
You should disable auto sync to avoid any unexpected running.
|
||||||
|
|
||||||
|
## Set The Output Level To Debug
|
||||||
|
|
||||||
|
Go to the plugin settings, scroll down to the section "Debug" -> "alter console log level", and change it from "info" to "debug".
|
||||||
|
|
||||||
|
## Use "Obsidian vConsole"
|
||||||
|
|
||||||
|
1. Install the third-party plugin ["Obsidian vConsole"](https://github.com/zhouhua/obsidian-vconsole).
|
||||||
|
2. Enable "Obsidian vConsole". You shall see a green button in the right buttom corner of the interface of your mobile Obsidian. You can drag this green button to where you like.
|
||||||
|
3. Sync! And quickly click the vConsole green button, you will see the console logs in its panel! Moreover, you can check browser network and Storage (LocalStorage) in the panel!
|
||||||
|
4. You can copy (by clicking the small "disk" icon beside each line of the log) or take a screenshot of the logs, and report bugs in Remotely Save GitHub. You can click "Hide" in the panel to hide the panel.
|
||||||
|
5. If you don't need to debug any more, you can disable Obsidian vConsole plugin, then the green button should disappear.
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# dufs webdav
|
||||||
|
|
||||||
|
## Link
|
||||||
|
|
||||||
|
<https://github.com/sigoden/dufs>
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
1. Download the latest version: <https://github.com/sigoden/dufs/releases> and save it to a folder
|
||||||
|
2. Add the path environment variable.
|
||||||
|
3. Start the server in terminal, you can change the address (`127.0.0.1`) and username (`user1`) and password (`pass1`) accordingly:
|
||||||
|
```bash
|
||||||
|
dufs -A --enable-cors --bind 127.0.0.1 --port 8080 --auth user1:pass1@/:rw
|
||||||
|
```
|
||||||
|
4. In remotely-save setting page, select webdav type, then input the address/account/**webdav password**(not your account password).
|
||||||
|
5. In remotely-save setting page, click "Check Connectivity".
|
||||||
|
6. Sync!
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "remotely-save",
|
"id": "remotely-save",
|
||||||
"name": "Remotely Save",
|
"name": "Remotely Save",
|
||||||
"version": "0.5.12",
|
"version": "0.5.17",
|
||||||
"minAppVersion": "0.13.21",
|
"minAppVersion": "0.13.21",
|
||||||
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
||||||
"author": "fyears",
|
"author": "fyears",
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "remotely-save",
|
"id": "remotely-save",
|
||||||
"name": "Remotely Save",
|
"name": "Remotely Save",
|
||||||
"version": "0.5.12",
|
"version": "0.5.17",
|
||||||
"minAppVersion": "0.13.21",
|
"minAppVersion": "0.13.21",
|
||||||
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
|
||||||
"author": "fyears",
|
"author": "fyears",
|
||||||
|
|||||||
+34
-34
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "remotely-save",
|
"name": "remotely-save",
|
||||||
"version": "0.5.12",
|
"version": "0.5.17",
|
||||||
"description": "This is yet another sync plugin for Obsidian app.",
|
"description": "This is yet another sync plugin for Obsidian app.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev2": "node esbuild.config.mjs --watch",
|
"dev2": "node esbuild.config.mjs --watch",
|
||||||
"build2": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
"build2": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
||||||
"build": "webpack --mode production",
|
"build": "webpack --mode production",
|
||||||
"dev": "webpack --mode development --watch",
|
"dev": "webpack --mode development --watch",
|
||||||
"format": "npx @biomejs/biome check --apply .",
|
"format": "npx @biomejs/biome check --write .",
|
||||||
"clean": "npx rimraf main.js",
|
"clean": "npx rimraf main.js",
|
||||||
"test": "cross-env TS_NODE_COMPILER_OPTIONS={\\\"module\\\":\\\"commonjs\\\"} mocha -r ts-node/register 'tests/**/*.ts' 'pro/tests/**/*.ts'"
|
"test": "mocha --import=tsx 'tests/**/*.ts' 'pro/tests/**/*.ts'"
|
||||||
},
|
},
|
||||||
"browser": {
|
"browser": {
|
||||||
"path": "path-browserify",
|
"path": "path-browserify",
|
||||||
@@ -25,55 +25,55 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "SEE LICENSE IN LICENSE",
|
"license": "SEE LICENSE IN LICENSE",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.7.3",
|
"@biomejs/biome": "1.8.3",
|
||||||
"@microsoft/microsoft-graph-types": "^2.40.0",
|
"@microsoft/microsoft-graph-types": "^2.40.0",
|
||||||
"@types/chai": "^4.3.14",
|
"@types/chai": "^4.3.16",
|
||||||
"@types/chai-as-promised": "^7.1.8",
|
"@types/chai-as-promised": "^7.1.8",
|
||||||
"@types/jsdom": "^21.1.6",
|
"@types/jsdom": "^21.1.7",
|
||||||
"@types/lodash": "^4.17.0",
|
"@types/lodash": "^4.17.7",
|
||||||
"@types/mime-types": "^2.1.4",
|
"@types/mime-types": "^2.1.4",
|
||||||
"@types/mocha": "^10.0.6",
|
"@types/mocha": "^10.0.7",
|
||||||
"@types/mustache": "^4.2.5",
|
"@types/mustache": "^4.2.5",
|
||||||
"@types/node": "^20.12.7",
|
"@types/node": "^20.14.12",
|
||||||
"@types/qrcode": "^1.5.5",
|
"@types/qrcode": "^1.5.5",
|
||||||
"builtin-modules": "^3.3.0",
|
"builtin-modules": "^4.0.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.5",
|
||||||
"esbuild": "^0.20.2",
|
"esbuild": "^0.23.0",
|
||||||
"esbuild-plugin-inline-worker": "^0.1.1",
|
"esbuild-plugin-inline-worker": "^0.1.1",
|
||||||
"jsdom": "^24.0.0",
|
"jsdom": "^24.1.1",
|
||||||
"mocha": "^10.4.0",
|
"mocha": "^10.7.0",
|
||||||
"npm-check-updates": "^16.14.20",
|
"npm-check-updates": "^16.14.20",
|
||||||
"obsidian": "^1.5.7",
|
"obsidian": "^1.5.7",
|
||||||
"openapi-typescript": "^7.0.0-rc.0",
|
"openapi-typescript": "^7.1.0",
|
||||||
"ts-loader": "^9.5.1",
|
"ts-loader": "^9.5.1",
|
||||||
"ts-node": "^10.9.2",
|
"tslib": "^2.6.3",
|
||||||
"tslib": "^2.6.2",
|
"tsx": "^4.16.2",
|
||||||
"typescript": "^5.4.5",
|
"typescript": "^5.5.4",
|
||||||
"webdav-server": "^2.6.2",
|
"webdav-server": "^2.6.2",
|
||||||
"webpack": "^5.91.0",
|
"webpack": "^5.93.0",
|
||||||
"webpack-cli": "^5.1.4",
|
"webpack-cli": "^5.1.4",
|
||||||
"worker-loader": "^3.0.8"
|
"worker-loader": "^3.0.8"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.563.0",
|
"@aws-sdk/client-s3": "^3.620.0",
|
||||||
"@aws-sdk/lib-storage": "^3.563.0",
|
"@aws-sdk/lib-storage": "^3.620.0",
|
||||||
"@aws-sdk/signature-v4-crt": "^3.556.0",
|
"@aws-sdk/signature-v4-crt": "^3.620.0",
|
||||||
"@aws-sdk/types": "^3.535.0",
|
"@aws-sdk/types": "^3.609.0",
|
||||||
"@azure/msal-node": "^2.7.0",
|
"@azure/msal-node": "^2.12.0",
|
||||||
"@azure/storage-blob": "^12.23.0",
|
"@azure/storage-blob": "^12.24.0",
|
||||||
"@fyears/rclone-crypt": "^0.0.7",
|
"@fyears/rclone-crypt": "^0.0.7",
|
||||||
"@fyears/tsqueue": "^1.0.1",
|
"@fyears/tsqueue": "^1.0.1",
|
||||||
"@microsoft/microsoft-graph-client": "^3.0.7",
|
"@microsoft/microsoft-graph-client": "^3.0.7",
|
||||||
"@sanity/diff-match-patch": "^3.1.1",
|
"@sanity/diff-match-patch": "^3.1.1",
|
||||||
"@smithy/fetch-http-handler": "^2.5.0",
|
"@smithy/fetch-http-handler": "^3.2.4",
|
||||||
"@smithy/protocol-http": "^3.3.0",
|
"@smithy/protocol-http": "^4.1.0",
|
||||||
"@smithy/querystring-builder": "^2.2.0",
|
"@smithy/querystring-builder": "^3.0.3",
|
||||||
"acorn": "^8.11.3",
|
"acorn": "^8.12.1",
|
||||||
"aggregate-error": "^5.0.0",
|
"aggregate-error": "^5.0.0",
|
||||||
"assert": "^2.1.0",
|
"assert": "^2.1.0",
|
||||||
"aws-crt": "^1.21.2",
|
"aws-crt": "^1.21.3",
|
||||||
"box-typescript-sdk-gen": "^1.0.0",
|
"box-typescript-sdk-gen": "^1.3.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"crypto-browserify": "^3.12.0",
|
"crypto-browserify": "^3.12.0",
|
||||||
"dropbox": "^10.34.0",
|
"dropbox": "^10.34.0",
|
||||||
@@ -83,21 +83,21 @@
|
|||||||
"localforage-getitems": "^1.4.2",
|
"localforage-getitems": "^1.4.2",
|
||||||
"localforage-removeitems": "^1.4.0",
|
"localforage-removeitems": "^1.4.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"lucide": "^0.376.1",
|
"lucide": "^0.416.0",
|
||||||
"mime-types": "^2.1.35",
|
"mime-types": "^2.1.35",
|
||||||
"mustache": "^4.2.0",
|
"mustache": "^4.2.0",
|
||||||
"nanoid": "^5.0.7",
|
"nanoid": "^5.0.7",
|
||||||
"node-diff3": "^3.1.2",
|
"node-diff3": "^3.1.2",
|
||||||
"openapi-fetch": "^0.9.7",
|
"openapi-fetch": "^0.10.2",
|
||||||
"p-queue": "^8.0.1",
|
"p-queue": "^8.0.1",
|
||||||
"path-browserify": "^1.0.1",
|
"path-browserify": "^1.0.1",
|
||||||
"pcloud-sdk-js": "^2.0.0",
|
"pcloud-sdk-js": "^2.0.0",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"rfc4648": "^1.5.3",
|
"rfc4648": "^1.5.3",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^6.0.1",
|
||||||
"stream-browserify": "^3.0.0",
|
"stream-browserify": "^3.0.0",
|
||||||
"url": "^0.11.3",
|
"url": "^0.11.4",
|
||||||
"util": "^0.12.5",
|
"util": "^0.12.5",
|
||||||
"webdav": "^5.6.0",
|
"webdav": "^5.6.0",
|
||||||
"xregexp": "^5.1.1"
|
"xregexp": "^5.1.1"
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import type { FakeFsLocal } from "../../src/fsLocal";
|
||||||
|
import { getFileRenameForDup } from "./conflictLogic";
|
||||||
|
|
||||||
|
export const getDupFiles = async (fsLocal: FakeFsLocal) => {
|
||||||
|
const allFilesAndFolders = await fsLocal.walk();
|
||||||
|
|
||||||
|
allFilesAndFolders.sort((a, b) => -(a.keyRaw.length - b.keyRaw.length)); // descending
|
||||||
|
|
||||||
|
const filenameSet: Set<string> = new Set();
|
||||||
|
const filesToBeRemoved: Set<string> = new Set();
|
||||||
|
|
||||||
|
for (const { keyRaw } of allFilesAndFolders) {
|
||||||
|
if (keyRaw.endsWith("/")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (keyRaw.includes("dup")) {
|
||||||
|
filenameSet.add(keyRaw);
|
||||||
|
}
|
||||||
|
|
||||||
|
const dup = getFileRenameForDup(keyRaw);
|
||||||
|
if (filenameSet.has(dup)) {
|
||||||
|
filesToBeRemoved.add(dup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [...filesToBeRemoved];
|
||||||
|
};
|
||||||
|
|
||||||
|
export const clearDupFiles = async (
|
||||||
|
filesToBeRemoved: string[],
|
||||||
|
fsLocal: FakeFsLocal
|
||||||
|
) => {
|
||||||
|
await Promise.all(filesToBeRemoved.map(async (f) => await fsLocal.rm(f)));
|
||||||
|
};
|
||||||
+28
-11
@@ -20,14 +20,14 @@ import type { FakeFs } from "../../src/fsAll";
|
|||||||
import { MERGABLE_SIZE } from "./baseTypesPro";
|
import { MERGABLE_SIZE } from "./baseTypesPro";
|
||||||
|
|
||||||
export function isMergable(a: Entity, b?: Entity) {
|
export function isMergable(a: Entity, b?: Entity) {
|
||||||
if (b !== undefined && a.keyRaw !== b.keyRaw) {
|
if (b !== undefined && a.key !== b.key) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
!a.keyRaw.endsWith("/") &&
|
!a.key!.endsWith("/") &&
|
||||||
a.sizeRaw <= MERGABLE_SIZE &&
|
a.sizeRaw <= MERGABLE_SIZE &&
|
||||||
(a.keyRaw.endsWith(".md") || a.keyRaw.endsWith(".markdown"))
|
(a.key!.endsWith(".md") || a.key!.endsWith(".markdown"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,9 +38,11 @@ export function isMergable(a: Entity, b?: Entity) {
|
|||||||
* @param b
|
* @param b
|
||||||
*/
|
*/
|
||||||
function mergeDigInModified(a: string, o: string, b: string) {
|
function mergeDigInModified(a: string, o: string, b: string) {
|
||||||
const { conflict, result } = mergeDigIn(a, o, b);
|
const { conflict, result } = mergeDigIn(a, o, b, {
|
||||||
|
stringSeparator: /\n/,
|
||||||
|
});
|
||||||
for (let index = 0; index < result.length; ++index) {
|
for (let index = 0; index < result.length; ++index) {
|
||||||
if (["<<<<<<<", "=======", ">>>>>>>"].contains(result[index])) {
|
if (["<<<<<<<", "=======", ">>>>>>>"].includes(result[index])) {
|
||||||
result[index] = "`" + result[index] + "`";
|
result[index] = "`" + result[index] + "`";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,11 +74,26 @@ function getLCSText(a: string, b: string) {
|
|||||||
* @param b
|
* @param b
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function twoWayMerge(a: string, b: string): string {
|
export function twoWayMerge(a: string, b: string): string {
|
||||||
|
const aa = a.trim();
|
||||||
|
const bb = b.trim();
|
||||||
|
if (aa === "" && bb === "") {
|
||||||
|
return aa.length >= bb.length ? a : b;
|
||||||
|
}
|
||||||
|
if (bb === "") {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
if (aa === "") {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
// const c = getLCSText(a, b);
|
// const c = getLCSText(a, b);
|
||||||
// const patches = makePatches(c, a);
|
// const patches = makePatches(c, a);
|
||||||
// const [d] = applyPatches(patches, b);
|
// const [d] = applyPatches(patches, b);
|
||||||
const c = getLCSText(a, b);
|
const c = getLCSText(a, b); //.trim();
|
||||||
|
// console.debug(`(start) LCS Text:`);
|
||||||
|
// console.debug(c);
|
||||||
|
// console.debug(`(end) LCS Text.`);
|
||||||
const d = mergeDigInModified(a, c, b).result.join("\n");
|
const d = mergeDigInModified(a, c, b).result.join("\n");
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -88,7 +105,7 @@ function twoWayMerge(a: string, b: string): string {
|
|||||||
* @param orig
|
* @param orig
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function threeWayMerge(a: string, b: string, orig: string) {
|
export function threeWayMerge(a: string, b: string, orig: string) {
|
||||||
return mergeDigInModified(a, orig, b).result.join("\n");
|
return mergeDigInModified(a, orig, b).result.join("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +176,7 @@ export async function mergeFile(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFileRename(key: string) {
|
export function getFileRenameForDup(key: string) {
|
||||||
if (
|
if (
|
||||||
key === "" ||
|
key === "" ||
|
||||||
key === "." ||
|
key === "." ||
|
||||||
@@ -330,7 +347,7 @@ export async function tryDuplicateFile(
|
|||||||
uploadCallback: (entity: Entity | undefined) => Promise<any>,
|
uploadCallback: (entity: Entity | undefined) => Promise<any>,
|
||||||
downloadCallback: (entity: Entity | undefined) => Promise<any>
|
downloadCallback: (entity: Entity | undefined) => Promise<any>
|
||||||
) {
|
) {
|
||||||
let key2 = getFileRename(key);
|
let key2 = getFileRenameForDup(key);
|
||||||
let usable = false;
|
let usable = false;
|
||||||
do {
|
do {
|
||||||
try {
|
try {
|
||||||
@@ -339,7 +356,7 @@ export async function tryDuplicateFile(
|
|||||||
throw Error(`not exist $${key2}`);
|
throw Error(`not exist $${key2}`);
|
||||||
}
|
}
|
||||||
console.debug(`key2=${key2} exists, cannot use for new file`);
|
console.debug(`key2=${key2} exists, cannot use for new file`);
|
||||||
key2 = getFileRename(key2);
|
key2 = getFileRenameForDup(key2);
|
||||||
console.debug(`key2=${key2} is prepared for next try`);
|
console.debug(`key2=${key2} is prepared for next try`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// not exists, exactly what we want
|
// not exists, exactly what we want
|
||||||
|
|||||||
@@ -320,12 +320,12 @@ export class FakeFsAzureBlobStorage extends FakeFs {
|
|||||||
// if we can walk, we can connect
|
// if we can walk, we can connect
|
||||||
try {
|
try {
|
||||||
await this.walkPartial();
|
await this.walkPartial();
|
||||||
return true;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
|
|||||||
+1
-1
@@ -892,12 +892,12 @@ export class FakeFsBox extends FakeFs {
|
|||||||
// if we can init, we can connect
|
// if we can init, we can connect
|
||||||
try {
|
try {
|
||||||
await this._init();
|
await this._init();
|
||||||
return true;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
throw new Error("Method not implemented.");
|
throw new Error("Method not implemented.");
|
||||||
|
|||||||
@@ -728,12 +728,12 @@ export class FakeFsGoogleDrive extends FakeFs {
|
|||||||
// if we can init, we can connect
|
// if we can init, we can connect
|
||||||
try {
|
try {
|
||||||
await this._init();
|
await this._init();
|
||||||
return true;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
|
|||||||
+4
-4
@@ -263,7 +263,7 @@ const getAuthMiddleware = (
|
|||||||
saveUpdatedConfigFunc: any
|
saveUpdatedConfigFunc: any
|
||||||
) => {
|
) => {
|
||||||
const authMiddleware: Middleware = {
|
const authMiddleware: Middleware = {
|
||||||
async onRequest(req) {
|
async onRequest({ request }) {
|
||||||
const getAccessToken = async () => {
|
const getAccessToken = async () => {
|
||||||
if (koofrConfig.refreshToken === "") {
|
if (koofrConfig.refreshToken === "") {
|
||||||
throw Error("The user has not manually auth yet.");
|
throw Error("The user has not manually auth yet.");
|
||||||
@@ -291,8 +291,8 @@ const getAuthMiddleware = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
const access = await getAccessToken();
|
const access = await getAccessToken();
|
||||||
req.headers.set("Authorization", `Bearer ${access}`);
|
request.headers.set("Authorization", `Bearer ${access}`);
|
||||||
return req;
|
return request;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return authMiddleware;
|
return authMiddleware;
|
||||||
@@ -555,12 +555,12 @@ export class FakeFsKoofr extends FakeFs {
|
|||||||
// if we can init, we can connect
|
// if we can init, we can connect
|
||||||
try {
|
try {
|
||||||
await this._init();
|
await this._init();
|
||||||
return true;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
|
|||||||
@@ -290,8 +290,12 @@ const fromDriveItemToEntity = (x: DriveItem, remoteBaseDir: string): Entity => {
|
|||||||
key = `${key}/`;
|
key = `${key}/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mtimeSvr = Date.parse(x?.fileSystemInfo!.lastModifiedDateTime!);
|
const mtimeTry = x?.fileSystemInfo?.lastModifiedDateTime;
|
||||||
const mtimeCli = Date.parse(x?.fileSystemInfo!.lastModifiedDateTime!);
|
if (mtimeTry === undefined || mtimeTry === null) {
|
||||||
|
throw Error(`onedrive cannot parse mtime: ${JSON.stringify(x, null, 2)}`);
|
||||||
|
}
|
||||||
|
const mtimeSvr = Date.parse(mtimeTry);
|
||||||
|
const mtimeCli = Date.parse(mtimeTry);
|
||||||
return {
|
return {
|
||||||
key: key,
|
key: key,
|
||||||
keyRaw: key,
|
keyRaw: key,
|
||||||
@@ -912,12 +916,15 @@ export class FakeFsOnedriveFull extends FakeFs {
|
|||||||
async checkConnect(callbackFunc?: any): Promise<boolean> {
|
async checkConnect(callbackFunc?: any): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
const k = await this.getUserDisplayName();
|
const k = await this.getUserDisplayName();
|
||||||
return k !== "<unknown display name>";
|
if (k === "<unknown display name>") {
|
||||||
|
throw Error(`unknown display name!`);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName() {
|
async getUserDisplayName() {
|
||||||
|
|||||||
+1
-1
@@ -604,12 +604,12 @@ export class FakeFsPCloud extends FakeFs {
|
|||||||
// if we can init, we can connect
|
// if we can init, we can connect
|
||||||
try {
|
try {
|
||||||
await this._init();
|
await this._init();
|
||||||
return true;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
|
|||||||
@@ -480,12 +480,12 @@ export class FakeFsYandexDisk extends FakeFs {
|
|||||||
// if we can init, we can connect
|
// if we can init, we can connect
|
||||||
try {
|
try {
|
||||||
await this._init();
|
await this._init();
|
||||||
return true;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
|
|||||||
@@ -129,6 +129,10 @@
|
|||||||
"modal_proauth_maualinput_notice": "Trying to connect, wait...",
|
"modal_proauth_maualinput_notice": "Trying to connect, wait...",
|
||||||
"modal_proauth_maualinput_conn_fail": "Failed to connect",
|
"modal_proauth_maualinput_conn_fail": "Failed to connect",
|
||||||
|
|
||||||
|
"modal_cleardupfiles_warning": "Warning: The plugin just stupidly finds all the file names that looks like duplicated files (.dup in file names). Also, this only deletes local files, so you need to trigger a sync to delete remote files.",
|
||||||
|
"modal_cleardupfiles_warning_confirm": "Confirm to delete",
|
||||||
|
"modal_cleardupfiles_warning_finished": "All the detected duplicated files are removed!",
|
||||||
|
|
||||||
"settings_onedrivefull": "Remote For Onedrive (for personal) (Full)",
|
"settings_onedrivefull": "Remote For Onedrive (for personal) (Full)",
|
||||||
"settings_chooseservice_onedrivefull": "OneDrive for personal (Full) (PRO)",
|
"settings_chooseservice_onedrivefull": "OneDrive for personal (Full) (PRO)",
|
||||||
"settings_onedrivefull_disclaimer1": "Disclaimer: This app is NOT an official Microsoft / OneDrive product.",
|
"settings_onedrivefull_disclaimer1": "Disclaimer: This app is NOT an official Microsoft / OneDrive product.",
|
||||||
@@ -278,6 +282,10 @@
|
|||||||
"settings_export_koofr_button": "Export Koofr Part",
|
"settings_export_koofr_button": "Export Koofr Part",
|
||||||
"settings_export_azureblobstorage_button": "Export Azure Blob Storage Part",
|
"settings_export_azureblobstorage_button": "Export Azure Blob Storage Part",
|
||||||
|
|
||||||
|
"settings_cleardupfiles": "Clear Duplicated Files By Smart Conflict",
|
||||||
|
"settings_cleardupfiles_desc": "If you have ever used Smart Conflict (PRO) feature, the plugin may generate duplicated files. <strong>IF YOU ARE SURE THE DUPLICATED FILES ARE NO LONGER NEEDED</strong>, you can clear <strong>ALL</strong> of them locally here.",
|
||||||
|
"settings_cleardupfiles_button": "Start Scanning",
|
||||||
|
|
||||||
"settings_pro": "Account (for PRO features)",
|
"settings_pro": "Account (for PRO features)",
|
||||||
"settings_pro_tutorial": "<p>Using <stong>basic</strong> features of Remotely Save is <strong>FREE</strong> and do <strong>NOT</strong> need an account.</p><p>However, you will <strong>need</strong> an online account and <strong>PAY</strong> for the <strong>PRO</strong> features such as smart conflict.</p><p>Firstly please click the button to sign up and sign in to the website: <a href=\"https://remotelysave.com\">https://remotelysave.com</a>. Notice: It's different from, and NOT affiliated with Obsidian account.</p><p>Secondly please \"connect\" your local device to your online account.",
|
"settings_pro_tutorial": "<p>Using <stong>basic</strong> features of Remotely Save is <strong>FREE</strong> and do <strong>NOT</strong> need an account.</p><p>However, you will <strong>need</strong> an online account and <strong>PAY</strong> for the <strong>PRO</strong> features such as smart conflict.</p><p>Firstly please click the button to sign up and sign in to the website: <a href=\"https://remotelysave.com\">https://remotelysave.com</a>. Notice: It's different from, and NOT affiliated with Obsidian account.</p><p>Secondly please \"connect\" your local device to your online account.",
|
||||||
"settings_pro_features": "Features",
|
"settings_pro_features": "Features",
|
||||||
|
|||||||
@@ -140,6 +140,10 @@
|
|||||||
"modal_proauth_maualinput_notice": "正在连接,请稍候......",
|
"modal_proauth_maualinput_notice": "正在连接,请稍候......",
|
||||||
"modal_proauth_maualinput_conn_fail": "连接失败",
|
"modal_proauth_maualinput_conn_fail": "连接失败",
|
||||||
|
|
||||||
|
"modal_cleardupfiles_warning": "警告:插件只是简单地扫描所有文件名含有 .dup 的作为重复文件。另外,本操作只删除本地文件,因此您需要触发同步来删除远端文件。",
|
||||||
|
"modal_cleardupfiles_warning_confirm": "确认删除",
|
||||||
|
"modal_cleardupfiles_warning_finished": "所有检测到的重复文件已被删除!",
|
||||||
|
|
||||||
"settings_onedrivefull": "Onedrive(个人版)(Full)设置",
|
"settings_onedrivefull": "Onedrive(个人版)(Full)设置",
|
||||||
"settings_chooseservice_onedrivefull": "OneDrive(个人版)(Full)(PRO)",
|
"settings_chooseservice_onedrivefull": "OneDrive(个人版)(Full)(PRO)",
|
||||||
"settings_onedrivefull_disclaimer1": "声明:此插件不是微软或 OneDrive 的官方产品。",
|
"settings_onedrivefull_disclaimer1": "声明:此插件不是微软或 OneDrive 的官方产品。",
|
||||||
@@ -285,6 +289,10 @@
|
|||||||
"settings_export_koofr_button": "导出 Koofr 部分",
|
"settings_export_koofr_button": "导出 Koofr 部分",
|
||||||
"settings_export_azureblobstorage_button": "导出 Azure Blob Storage 部分",
|
"settings_export_azureblobstorage_button": "导出 Azure Blob Storage 部分",
|
||||||
|
|
||||||
|
"settings_cleardupfiles": "删除智能处理冲突生成的重复文件",
|
||||||
|
"settings_cleardupfiles_desc": "如果用过智能处理冲突 (PRO) 功能,插件可能会生成重复文件。<strong>如果您真的确认了所有重复文件都不需要了,</strong>那么可以删除本地的<strong>所有</strong>这些文件。",
|
||||||
|
"settings_cleardupfiles_button": "开始扫描",
|
||||||
|
|
||||||
"settings_pro": "账号(PRO 付费功能)",
|
"settings_pro": "账号(PRO 付费功能)",
|
||||||
"settings_pro_tutorial": "<p>使用 Remotely Save 的<stong>基本</strong>功能是<strong>免费的</strong>,而且<strong>不</strong>需要注册对应账号。</p><p>但是,您<strong>需要</strong>注册账号和对<strong>PRO</strong>功能<strong>付费</strong>使用,如智能处理冲突功能。</p><p>第一步:点击按钮从而注册和登录网站:<a href=\"https://remotelysave.com\">https://remotelysave.com</a>。注意:这和 Obsidian 官方账号无关,是不同的账号。</p><p>第二部:点击“连接”按钮,从而连接本设备和在线账号。",
|
"settings_pro_tutorial": "<p>使用 Remotely Save 的<stong>基本</strong>功能是<strong>免费的</strong>,而且<strong>不</strong>需要注册对应账号。</p><p>但是,您<strong>需要</strong>注册账号和对<strong>PRO</strong>功能<strong>付费</strong>使用,如智能处理冲突功能。</p><p>第一步:点击按钮从而注册和登录网站:<a href=\"https://remotelysave.com\">https://remotelysave.com</a>。注意:这和 Obsidian 官方账号无关,是不同的账号。</p><p>第二部:点击“连接”按钮,从而连接本设备和在线账号。",
|
||||||
"settings_pro_features": "功能",
|
"settings_pro_features": "功能",
|
||||||
|
|||||||
@@ -140,6 +140,10 @@
|
|||||||
"modal_proauth_maualinput_notice": "正在連線,請稍候......",
|
"modal_proauth_maualinput_notice": "正在連線,請稍候......",
|
||||||
"modal_proauth_maualinput_conn_fail": "連線失敗",
|
"modal_proauth_maualinput_conn_fail": "連線失敗",
|
||||||
|
|
||||||
|
"modal_cleardupfiles_warning": "警告:外掛只是簡單地掃描所有檔名含有 .dup 的作為重複檔案。另外,本操作只刪除本地檔案,因此您需要觸發同步來刪除遠端檔案。",
|
||||||
|
"modal_cleardupfiles_warning_confirm": "確認刪除",
|
||||||
|
"modal_cleardupfiles_warning_finished": "所有檢測到的重複檔案已被刪除!",
|
||||||
|
|
||||||
"settings_onedrivefull": "Onedrive(個人版)(Full)設定",
|
"settings_onedrivefull": "Onedrive(個人版)(Full)設定",
|
||||||
"settings_chooseservice_onedrivefull": "OneDrive(個人版)(Full)(PRO)",
|
"settings_chooseservice_onedrivefull": "OneDrive(個人版)(Full)(PRO)",
|
||||||
"settings_onedrivefull_disclaimer1": "宣告:此外掛不是微軟或 OneDrive 的官方產品。",
|
"settings_onedrivefull_disclaimer1": "宣告:此外掛不是微軟或 OneDrive 的官方產品。",
|
||||||
@@ -285,6 +289,10 @@
|
|||||||
"settings_export_koofr_button": "匯出 Koofr 部分",
|
"settings_export_koofr_button": "匯出 Koofr 部分",
|
||||||
"settings_export_azureblobstorage_button": "匯出 Azure Blob Storage 部分",
|
"settings_export_azureblobstorage_button": "匯出 Azure Blob Storage 部分",
|
||||||
|
|
||||||
|
"settings_cleardupfiles": "刪除智慧處理衝突生成的重複檔案",
|
||||||
|
"settings_cleardupfiles_desc": "如果用過智慧處理衝突 (PRO) 功能,外掛可能會生成重複檔案。<strong>如果您真的確認了所有重複檔案都不需要了,</strong>那麼可以刪除本地的<strong>所有</strong>這些檔案。",
|
||||||
|
"settings_cleardupfiles_button": "開始掃描",
|
||||||
|
|
||||||
"settings_pro": "賬號(PRO 付費功能)",
|
"settings_pro": "賬號(PRO 付費功能)",
|
||||||
"settings_pro_tutorial": "<p>使用 Remotely Save 的<stong>基本</strong>功能是<strong>免費的</strong>,而且<strong>不</strong>需要註冊對應賬號。</p><p>但是,您<strong>需要</strong>註冊賬號和對<strong>PRO</strong>功能<strong>付費</strong>使用,如智慧處理衝突功能。</p><p>第一步:點選按鈕從而註冊和登入網站:<a href=\"https://remotelysave.com\">https://remotelysave.com</a>。注意:這和 Obsidian 官方賬號無關,是不同的賬號。</p><p>第二部:點選“連線”按鈕,從而連線本裝置和線上賬號。",
|
"settings_pro_tutorial": "<p>使用 Remotely Save 的<stong>基本</strong>功能是<strong>免費的</strong>,而且<strong>不</strong>需要註冊對應賬號。</p><p>但是,您<strong>需要</strong>註冊賬號和對<strong>PRO</strong>功能<strong>付費</strong>使用,如智慧處理衝突功能。</p><p>第一步:點選按鈕從而註冊和登入網站:<a href=\"https://remotelysave.com\">https://remotelysave.com</a>。注意:這和 Obsidian 官方賬號無關,是不同的賬號。</p><p>第二部:點選“連線”按鈕,從而連線本裝置和線上賬號。",
|
||||||
"settings_pro_features": "功能",
|
"settings_pro_features": "功能",
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
import { type App, Modal, Notice, Setting } from "obsidian";
|
||||||
|
import { FakeFsLocal } from "../../src/fsLocal";
|
||||||
|
import type { TransItemType } from "../../src/i18n";
|
||||||
|
import type RemotelySavePlugin from "../../src/main";
|
||||||
|
import { stringToFragment } from "../../src/misc";
|
||||||
|
import { clearDupFiles, getDupFiles } from "./clearDupFiles";
|
||||||
|
|
||||||
|
class ClearDupFilesModal extends Modal {
|
||||||
|
readonly plugin: RemotelySavePlugin;
|
||||||
|
readonly t: (x: TransItemType, vars?: any) => string;
|
||||||
|
readonly files: string[];
|
||||||
|
readonly fsLocal: FakeFsLocal;
|
||||||
|
constructor(
|
||||||
|
app: App,
|
||||||
|
plugin: RemotelySavePlugin,
|
||||||
|
t: (x: TransItemType, vars?: any) => string,
|
||||||
|
files: string[],
|
||||||
|
fsLocal: FakeFsLocal
|
||||||
|
) {
|
||||||
|
super(app);
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.t = t;
|
||||||
|
this.files = files;
|
||||||
|
this.fsLocal = fsLocal;
|
||||||
|
}
|
||||||
|
|
||||||
|
async onOpen() {
|
||||||
|
const t = this.t;
|
||||||
|
const { contentEl } = this;
|
||||||
|
|
||||||
|
contentEl.createEl("p", {
|
||||||
|
text: t("modal_cleardupfiles_warning"),
|
||||||
|
});
|
||||||
|
|
||||||
|
contentEl.createEl("pre").createEl("code", {
|
||||||
|
text: this.files.join("\n"),
|
||||||
|
});
|
||||||
|
|
||||||
|
new Setting(contentEl)
|
||||||
|
.addButton((button) => {
|
||||||
|
button.setButtonText(t("modal_cleardupfiles_warning_confirm"));
|
||||||
|
button.onClick(async () => {
|
||||||
|
await clearDupFiles(this.files, this.fsLocal);
|
||||||
|
new Notice(t("modal_cleardupfiles_warning_finished"));
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.addButton((button) => {
|
||||||
|
button.setButtonText(t("goback"));
|
||||||
|
button.onClick(() => {
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onClose() {
|
||||||
|
const { contentEl } = this;
|
||||||
|
contentEl.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const generateClearDupFilesSettingsPart = (
|
||||||
|
containerEl: HTMLElement,
|
||||||
|
t: (x: TransItemType, vars?: any) => string,
|
||||||
|
app: App,
|
||||||
|
plugin: RemotelySavePlugin
|
||||||
|
) => {
|
||||||
|
new Setting(containerEl)
|
||||||
|
.setName(t("settings_cleardupfiles"))
|
||||||
|
.setDesc(stringToFragment(t("settings_cleardupfiles_desc")))
|
||||||
|
.addButton(async (button) => {
|
||||||
|
button.setButtonText(t("settings_cleardupfiles_button"));
|
||||||
|
button.onClick(async () => {
|
||||||
|
const fsLocal = new FakeFsLocal(
|
||||||
|
app.vault,
|
||||||
|
plugin.settings.syncConfigDir ?? false,
|
||||||
|
plugin.settings.syncBookmarks ?? false,
|
||||||
|
app.vault.configDir,
|
||||||
|
plugin.manifest.id,
|
||||||
|
undefined,
|
||||||
|
plugin.settings.deleteToWhere ?? "system"
|
||||||
|
);
|
||||||
|
|
||||||
|
const files = await getDupFiles(fsLocal);
|
||||||
|
|
||||||
|
const modal = new ClearDupFilesModal(app, plugin, t, files, fsLocal);
|
||||||
|
modal.open();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -310,7 +310,7 @@ export const generateProSettingsPart = (
|
|||||||
|
|
||||||
const allowOnedriveFull =
|
const allowOnedriveFull =
|
||||||
plugin.settings.pro?.enabledProFeatures.filter(
|
plugin.settings.pro?.enabledProFeatures.filter(
|
||||||
(x) => x.featureName === "feature-box"
|
(x) => x.featureName === "feature-onedrive_full"
|
||||||
).length === 1;
|
).length === 1;
|
||||||
console.debug(
|
console.debug(
|
||||||
`allow to show up OnedriveFull settings? ${allowOnedriveFull}`
|
`allow to show up OnedriveFull settings? ${allowOnedriveFull}`
|
||||||
|
|||||||
+24
-1
@@ -116,9 +116,21 @@ const isInsideObsFolder = (x: string, configDir: string) => {
|
|||||||
return x === configDir || x.startsWith(`${configDir}/`);
|
return x === configDir || x.startsWith(`${configDir}/`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isBookmarksFile = (x: string, configDir: string) => {
|
||||||
|
if (!configDir.startsWith(".")) {
|
||||||
|
throw Error(`configDir should starts with . but we get ${configDir}`);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
x === configDir ||
|
||||||
|
x === `${configDir}/` ||
|
||||||
|
x === `${configDir}/bookmarks.json`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const isSkipItemByName = (
|
const isSkipItemByName = (
|
||||||
key: string,
|
key: string,
|
||||||
syncConfigDir: boolean,
|
syncConfigDir: boolean,
|
||||||
|
syncBookmarks: boolean,
|
||||||
syncUnderscoreItems: boolean,
|
syncUnderscoreItems: boolean,
|
||||||
configDir: string,
|
configDir: string,
|
||||||
ignorePaths: string[]
|
ignorePaths: string[]
|
||||||
@@ -136,6 +148,11 @@ const isSkipItemByName = (
|
|||||||
if (syncConfigDir && isInsideObsFolder(key, configDir)) {
|
if (syncConfigDir && isInsideObsFolder(key, configDir)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (syncBookmarks && isBookmarksFile(key, configDir)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (isSpecialFolderNameToSkip(key, [])) {
|
if (isSpecialFolderNameToSkip(key, [])) {
|
||||||
// some special dirs and files are always skipped
|
// some special dirs and files are always skipped
|
||||||
return true;
|
return true;
|
||||||
@@ -157,6 +174,7 @@ const ensembleMixedEnties = async (
|
|||||||
remoteEntityList: Entity[],
|
remoteEntityList: Entity[],
|
||||||
|
|
||||||
syncConfigDir: boolean,
|
syncConfigDir: boolean,
|
||||||
|
syncBookmarks: boolean,
|
||||||
configDir: string,
|
configDir: string,
|
||||||
syncUnderscoreItems: boolean,
|
syncUnderscoreItems: boolean,
|
||||||
ignorePaths: string[],
|
ignorePaths: string[],
|
||||||
@@ -184,6 +202,7 @@ const ensembleMixedEnties = async (
|
|||||||
isSkipItemByName(
|
isSkipItemByName(
|
||||||
key,
|
key,
|
||||||
syncConfigDir,
|
syncConfigDir,
|
||||||
|
syncBookmarks,
|
||||||
syncUnderscoreItems,
|
syncUnderscoreItems,
|
||||||
configDir,
|
configDir,
|
||||||
ignorePaths
|
ignorePaths
|
||||||
@@ -216,6 +235,7 @@ const ensembleMixedEnties = async (
|
|||||||
isSkipItemByName(
|
isSkipItemByName(
|
||||||
key,
|
key,
|
||||||
syncConfigDir,
|
syncConfigDir,
|
||||||
|
syncBookmarks,
|
||||||
syncUnderscoreItems,
|
syncUnderscoreItems,
|
||||||
configDir,
|
configDir,
|
||||||
ignorePaths
|
ignorePaths
|
||||||
@@ -251,6 +271,7 @@ const ensembleMixedEnties = async (
|
|||||||
isSkipItemByName(
|
isSkipItemByName(
|
||||||
key,
|
key,
|
||||||
syncConfigDir,
|
syncConfigDir,
|
||||||
|
syncBookmarks,
|
||||||
syncUnderscoreItems,
|
syncUnderscoreItems,
|
||||||
configDir,
|
configDir,
|
||||||
ignorePaths
|
ignorePaths
|
||||||
@@ -911,13 +932,14 @@ const getSyncPlanInplace = async (
|
|||||||
mixedEntityMappings["/$@meta"] = {
|
mixedEntityMappings["/$@meta"] = {
|
||||||
key: "/$@meta", // don't mess up with the types
|
key: "/$@meta", // don't mess up with the types
|
||||||
sideNotes: {
|
sideNotes: {
|
||||||
version: "20240616 fs version",
|
version: "20240714 fs version",
|
||||||
generateTime: currTime,
|
generateTime: currTime,
|
||||||
generateTimeFmt: currTimeFmt,
|
generateTimeFmt: currTimeFmt,
|
||||||
service: settings.serviceType,
|
service: settings.serviceType,
|
||||||
concurrency: settings.concurrency,
|
concurrency: settings.concurrency,
|
||||||
hasPassword: settings.password !== "",
|
hasPassword: settings.password !== "",
|
||||||
syncConfigDir: settings.syncConfigDir,
|
syncConfigDir: settings.syncConfigDir,
|
||||||
|
syncBookmarks: settings.syncBookmarks,
|
||||||
syncUnderscoreItems: settings.syncUnderscoreItems,
|
syncUnderscoreItems: settings.syncUnderscoreItems,
|
||||||
skipSizeLargerThan: settings.skipSizeLargerThan,
|
skipSizeLargerThan: settings.skipSizeLargerThan,
|
||||||
protectModifyPercentage: settings.protectModifyPercentage,
|
protectModifyPercentage: settings.protectModifyPercentage,
|
||||||
@@ -1709,6 +1731,7 @@ export async function syncer(
|
|||||||
prevSyncEntityList,
|
prevSyncEntityList,
|
||||||
remoteEntityList,
|
remoteEntityList,
|
||||||
settings.syncConfigDir ?? false,
|
settings.syncConfigDir ?? false,
|
||||||
|
settings.syncBookmarks ?? false,
|
||||||
configDir,
|
configDir,
|
||||||
settings.syncUnderscoreItems ?? false,
|
settings.syncUnderscoreItems ?? false,
|
||||||
settings.ignorePaths ?? [],
|
settings.ignorePaths ?? [],
|
||||||
|
|||||||
+244
-16
@@ -1,68 +1,296 @@
|
|||||||
import { deepStrictEqual, rejects, throws } from "assert";
|
import { deepStrictEqual, rejects, throws } from "assert";
|
||||||
import { getFileRename } from "../src/conflictLogic";
|
import {
|
||||||
|
getFileRenameForDup,
|
||||||
|
threeWayMerge,
|
||||||
|
twoWayMerge,
|
||||||
|
} from "../src/conflictLogic";
|
||||||
|
|
||||||
describe("New name is generated", () => {
|
describe("New name is generated", () => {
|
||||||
it("should throw for empty file", async () => {
|
it("should throw for empty file", async () => {
|
||||||
for (const key of ["", "/", ".", ".."]) {
|
for (const key of ["", "/", ".", ".."]) {
|
||||||
throws(() => getFileRename(key));
|
throws(() => getFileRenameForDup(key));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should throw for folder", async () => {
|
it("should throw for folder", async () => {
|
||||||
for (const key of ["sss/", "ssss/yyy/"]) {
|
for (const key of ["sss/", "ssss/yyy/"]) {
|
||||||
throws(() => getFileRename(key));
|
throws(() => getFileRenameForDup(key));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should correctly get no ext files renamed", async () => {
|
it("should correctly get no ext files renamed", async () => {
|
||||||
deepStrictEqual(getFileRename("abc"), "abc.dup");
|
deepStrictEqual(getFileRenameForDup("abc"), "abc.dup");
|
||||||
|
|
||||||
deepStrictEqual(getFileRename("xxxx/yyyy/abc"), "xxxx/yyyy/abc.dup");
|
deepStrictEqual(getFileRenameForDup("xxxx/yyyy/abc"), "xxxx/yyyy/abc.dup");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should correctly get dot files renamed", async () => {
|
it("should correctly get dot files renamed", async () => {
|
||||||
deepStrictEqual(getFileRename(".abc"), ".abc.dup");
|
deepStrictEqual(getFileRenameForDup(".abc"), ".abc.dup");
|
||||||
|
|
||||||
deepStrictEqual(getFileRename("xxxx/yyyy/.efg"), "xxxx/yyyy/.efg.dup");
|
deepStrictEqual(
|
||||||
|
getFileRenameForDup("xxxx/yyyy/.efg"),
|
||||||
|
"xxxx/yyyy/.efg.dup"
|
||||||
|
);
|
||||||
|
|
||||||
deepStrictEqual(getFileRename("xxxx/yyyy/hij."), "xxxx/yyyy/hij.dup");
|
deepStrictEqual(getFileRenameForDup("xxxx/yyyy/hij."), "xxxx/yyyy/hij.dup");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should correctly get normal files renamed", async () => {
|
it("should correctly get normal files renamed", async () => {
|
||||||
deepStrictEqual(getFileRename("abc.efg"), "abc.dup.efg");
|
deepStrictEqual(getFileRenameForDup("abc.efg"), "abc.dup.efg");
|
||||||
|
|
||||||
deepStrictEqual(
|
deepStrictEqual(
|
||||||
getFileRename("xxxx/yyyy/abc.efg"),
|
getFileRenameForDup("xxxx/yyyy/abc.efg"),
|
||||||
"xxxx/yyyy/abc.dup.efg"
|
"xxxx/yyyy/abc.dup.efg"
|
||||||
);
|
);
|
||||||
|
|
||||||
deepStrictEqual(
|
deepStrictEqual(
|
||||||
getFileRename("xxxx/yyyy/abc.tar.gz"),
|
getFileRenameForDup("xxxx/yyyy/abc.tar.gz"),
|
||||||
"xxxx/yyyy/abc.tar.dup.gz"
|
"xxxx/yyyy/abc.tar.dup.gz"
|
||||||
);
|
);
|
||||||
|
|
||||||
deepStrictEqual(
|
deepStrictEqual(
|
||||||
getFileRename("xxxx/yyyy/.abc.efg"),
|
getFileRenameForDup("xxxx/yyyy/.abc.efg"),
|
||||||
"xxxx/yyyy/.abc.dup.efg"
|
"xxxx/yyyy/.abc.dup.efg"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should correctly get duplicated files renamed again", async () => {
|
it("should correctly get duplicated files renamed again", async () => {
|
||||||
deepStrictEqual(getFileRename("abc.dup"), "abc.dup.dup");
|
deepStrictEqual(getFileRenameForDup("abc.dup"), "abc.dup.dup");
|
||||||
|
|
||||||
deepStrictEqual(
|
deepStrictEqual(
|
||||||
getFileRename("xxxx/yyyy/.abc.dup"),
|
getFileRenameForDup("xxxx/yyyy/.abc.dup"),
|
||||||
"xxxx/yyyy/.abc.dup.dup"
|
"xxxx/yyyy/.abc.dup.dup"
|
||||||
);
|
);
|
||||||
|
|
||||||
deepStrictEqual(
|
deepStrictEqual(
|
||||||
getFileRename("xxxx/yyyy/abc.dup.md"),
|
getFileRenameForDup("xxxx/yyyy/abc.dup.md"),
|
||||||
"xxxx/yyyy/abc.dup.dup.md"
|
"xxxx/yyyy/abc.dup.dup.md"
|
||||||
);
|
);
|
||||||
|
|
||||||
deepStrictEqual(
|
deepStrictEqual(
|
||||||
getFileRename("xxxx/yyyy/.abc.dup.md"),
|
getFileRenameForDup("xxxx/yyyy/.abc.dup.md"),
|
||||||
"xxxx/yyyy/.abc.dup.dup.md"
|
"xxxx/yyyy/.abc.dup.dup.md"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("Two way merge", () => {
|
||||||
|
it("should correctly merge from zero files", async () => {
|
||||||
|
const a = "aaa";
|
||||||
|
const b = "bbb";
|
||||||
|
const res = twoWayMerge(a, b);
|
||||||
|
const expected = `\`<<<<<<<\`
|
||||||
|
aaa
|
||||||
|
\`=======\`
|
||||||
|
bbb
|
||||||
|
\`>>>>>>>\``;
|
||||||
|
deepStrictEqual(expected, res);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should correctly merge from common lines", async () => {
|
||||||
|
const a = `
|
||||||
|
Something is cool. 中文1
|
||||||
|
Other thing is cooler. 哈哈!
|
||||||
|
`;
|
||||||
|
const b = `
|
||||||
|
Anything is cool. 中文2
|
||||||
|
Other thing is cooler. 哈哈!
|
||||||
|
`;
|
||||||
|
const res = twoWayMerge(a, b);
|
||||||
|
// console.log(res);
|
||||||
|
const expected = `
|
||||||
|
\`<<<<<<<\`
|
||||||
|
Something is cool. 中文1
|
||||||
|
\`=======\`
|
||||||
|
Anything is cool. 中文2
|
||||||
|
\`>>>>>>>\`
|
||||||
|
Other thing is cooler. 哈哈!
|
||||||
|
`;
|
||||||
|
deepStrictEqual(expected, res);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should merge by lines", async () => {
|
||||||
|
const a = `
|
||||||
|
Something is cool. 中文1
|
||||||
|
`;
|
||||||
|
const b = `
|
||||||
|
Something is cooler. 中文2
|
||||||
|
`;
|
||||||
|
const res = twoWayMerge(a, b);
|
||||||
|
// console.log(res);
|
||||||
|
const expected = `
|
||||||
|
\`<<<<<<<\`
|
||||||
|
Something is cool. 中文1
|
||||||
|
\`=======\`
|
||||||
|
Something is cooler. 中文2
|
||||||
|
\`>>>>>>>\`
|
||||||
|
`;
|
||||||
|
deepStrictEqual(expected, res);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Three way merge", () => {
|
||||||
|
it("should correctly merge from zero files", async () => {
|
||||||
|
const orig = "";
|
||||||
|
const a = "aaa";
|
||||||
|
const b = "bbb";
|
||||||
|
const res = threeWayMerge(a, b, orig);
|
||||||
|
const expected = `\`<<<<<<<\`
|
||||||
|
aaa
|
||||||
|
\`=======\`
|
||||||
|
bbb
|
||||||
|
\`>>>>>>>\``;
|
||||||
|
deepStrictEqual(expected, res);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should correctly merge after adding lines on both sides", async () => {
|
||||||
|
const orig = `
|
||||||
|
* [ ] A1
|
||||||
|
* [ ] A2
|
||||||
|
* [ ] A3
|
||||||
|
`;
|
||||||
|
const a = `
|
||||||
|
* [ ] A1
|
||||||
|
* [ ] new line after A1
|
||||||
|
* [ ] A2
|
||||||
|
* [ ] A3
|
||||||
|
`;
|
||||||
|
const b = `
|
||||||
|
* [ ] A1
|
||||||
|
* [ ] A2
|
||||||
|
* [ ] New line after A2
|
||||||
|
* [ ] A3
|
||||||
|
`;
|
||||||
|
const res = threeWayMerge(a, b, orig);
|
||||||
|
// console.log(res);
|
||||||
|
const expected = `
|
||||||
|
* [ ] A1
|
||||||
|
* [ ] new line after A1
|
||||||
|
* [ ] A2
|
||||||
|
* [ ] New line after A2
|
||||||
|
* [ ] A3
|
||||||
|
`;
|
||||||
|
deepStrictEqual(expected, res);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should correctly merge after adding lines on both sides (again)", async () => {
|
||||||
|
const orig = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
* [ ] A3
|
||||||
|
`;
|
||||||
|
const a = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] new line after 中文
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
* [ ] A3
|
||||||
|
`;
|
||||||
|
const b = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
* [ ] New line after にほんご/にっぽんご
|
||||||
|
* [ ] A3
|
||||||
|
`;
|
||||||
|
const res = threeWayMerge(a, b, orig);
|
||||||
|
// console.log(res);
|
||||||
|
const expected = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] new line after 中文
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
* [ ] New line after にほんご/にっぽんご
|
||||||
|
* [ ] A3
|
||||||
|
`;
|
||||||
|
deepStrictEqual(expected, res);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should correctly merge after deleting lines on both sides", async () => {
|
||||||
|
const orig = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
const a = `
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
const b = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
const res = threeWayMerge(a, b, orig);
|
||||||
|
// console.log(res);
|
||||||
|
const expected = `
|
||||||
|
\`<<<<<<<\`
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
\`=======\`
|
||||||
|
* [ ] 中文
|
||||||
|
\`>>>>>>>\`
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
deepStrictEqual(expected, res);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should correctly merge after adding on one side and deleting on other side", async () => {
|
||||||
|
const orig = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
const a = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
const b = `
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
const res = threeWayMerge(a, b, orig);
|
||||||
|
// console.log(res);
|
||||||
|
const expected = `
|
||||||
|
\`<<<<<<<\`
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
\`=======\`
|
||||||
|
\`>>>>>>>\`
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
deepStrictEqual(expected, res);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should correctly merge after adding on one side and deleting on other side (again)", async () => {
|
||||||
|
const orig = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
const a = `
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
const b = `
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
const res = threeWayMerge(a, b, orig);
|
||||||
|
// console.log(res);
|
||||||
|
const expected = `
|
||||||
|
\`<<<<<<<\`
|
||||||
|
\`=======\`
|
||||||
|
* [ ] 中文
|
||||||
|
* [ ] にほんご/にっぽんご
|
||||||
|
\`>>>>>>>\`
|
||||||
|
* [ ] A3
|
||||||
|
* [ ] A4
|
||||||
|
`;
|
||||||
|
deepStrictEqual(expected, res);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ export interface WebdavConfig {
|
|||||||
depth?: WebdavDepthType;
|
depth?: WebdavDepthType;
|
||||||
remoteBaseDir?: string;
|
remoteBaseDir?: string;
|
||||||
|
|
||||||
|
customHeaders?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@@ -165,6 +167,7 @@ export interface RemotelySavePluginSettings {
|
|||||||
|
|
||||||
concurrency?: number;
|
concurrency?: number;
|
||||||
syncConfigDir?: boolean;
|
syncConfigDir?: boolean;
|
||||||
|
syncBookmarks?: boolean;
|
||||||
syncUnderscoreItems?: boolean;
|
syncUnderscoreItems?: boolean;
|
||||||
lang?: LangTypeAndAuto;
|
lang?: LangTypeAndAuto;
|
||||||
agreeToUseSyncV3?: boolean;
|
agreeToUseSyncV3?: boolean;
|
||||||
|
|||||||
@@ -200,7 +200,10 @@ export class CipherRclone {
|
|||||||
action: "encryptContent",
|
action: "encryptContent",
|
||||||
inputContent: input,
|
inputContent: input,
|
||||||
},
|
},
|
||||||
[channel.port1, input]
|
[
|
||||||
|
channel.port1,
|
||||||
|
// input // the array buffer might be re-used later, so we CANNOT transform here
|
||||||
|
]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -244,6 +247,7 @@ export class CipherRclone {
|
|||||||
action: "decryptContent",
|
action: "decryptContent",
|
||||||
inputContent: input,
|
inputContent: input,
|
||||||
},
|
},
|
||||||
|
// the decrypted result is not used later in worker, so it's save to transfer
|
||||||
[channel.port1, input]
|
[channel.port1, input]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import isEqual from "lodash/isEqual";
|
||||||
|
import { nanoid } from "nanoid";
|
||||||
import type { Entity } from "./baseTypes";
|
import type { Entity } from "./baseTypes";
|
||||||
|
|
||||||
export abstract class FakeFs {
|
export abstract class FakeFs {
|
||||||
@@ -16,6 +18,49 @@ export abstract class FakeFs {
|
|||||||
abstract rename(key1: string, key2: string): Promise<void>;
|
abstract rename(key1: string, key2: string): Promise<void>;
|
||||||
abstract rm(key: string): Promise<void>;
|
abstract rm(key: string): Promise<void>;
|
||||||
abstract checkConnect(callbackFunc?: any): Promise<boolean>;
|
abstract checkConnect(callbackFunc?: any): Promise<boolean>;
|
||||||
|
async checkConnectCommonOps(callbackFunc?: any) {
|
||||||
|
try {
|
||||||
|
console.info(`check connect: create folder`);
|
||||||
|
const folderName = `rs-test-folder-${nanoid()}/`;
|
||||||
|
await this.mkdir(folderName);
|
||||||
|
// await delay(3000);
|
||||||
|
|
||||||
|
console.info(`check connect: upload file`);
|
||||||
|
const filename = `${folderName}/rs-test-file-${nanoid()}`;
|
||||||
|
const ctime = Date.now();
|
||||||
|
const mtime1 = Date.now();
|
||||||
|
const content1 = new ArrayBuffer(100);
|
||||||
|
await this.writeFile(filename, content1, mtime1, ctime);
|
||||||
|
// await delay(3000);
|
||||||
|
|
||||||
|
console.info(`check connect: overwrite file`);
|
||||||
|
const mtime2 = Date.now();
|
||||||
|
const content2 = new ArrayBuffer(200);
|
||||||
|
await this.writeFile(filename, content2, mtime2, ctime);
|
||||||
|
// await delay(3000);
|
||||||
|
|
||||||
|
console.info(`check connect: download file`);
|
||||||
|
const content3 = await this.readFile(filename);
|
||||||
|
if (!isEqual(content2, content3)) {
|
||||||
|
throw Error(`downloaded file is not equal with uploaded file!`);
|
||||||
|
}
|
||||||
|
// await delay(3000);
|
||||||
|
|
||||||
|
console.info(`check connect: delete file`);
|
||||||
|
await this.rm(filename);
|
||||||
|
// await delay(3000);
|
||||||
|
|
||||||
|
console.info(`check connect: delete folder`);
|
||||||
|
await this.rm(folderName);
|
||||||
|
// await delay(3000);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
callbackFunc?.(err);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
abstract getUserDisplayName(): Promise<string>;
|
abstract getUserDisplayName(): Promise<string>;
|
||||||
abstract revokeAuth(): Promise<any>;
|
abstract revokeAuth(): Promise<any>;
|
||||||
abstract allowEmptyFile(): boolean;
|
abstract allowEmptyFile(): boolean;
|
||||||
|
|||||||
+3
-2
@@ -741,14 +741,15 @@ export class FakeFsDropbox extends FakeFs {
|
|||||||
await this._init();
|
await this._init();
|
||||||
const results = await this._statFromRoot(`/${this.remoteBaseDir}`);
|
const results = await this._statFromRoot(`/${this.remoteBaseDir}`);
|
||||||
if (results === undefined) {
|
if (results === undefined) {
|
||||||
return false;
|
throw Error(`cannot check root vault folder!`);
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName() {
|
async getUserDisplayName() {
|
||||||
|
|||||||
+9
-3
@@ -9,6 +9,7 @@ import type { Profiler } from "./profiler";
|
|||||||
export class FakeFsLocal extends FakeFs {
|
export class FakeFsLocal extends FakeFs {
|
||||||
vault: Vault;
|
vault: Vault;
|
||||||
syncConfigDir: boolean;
|
syncConfigDir: boolean;
|
||||||
|
syncBookmarks: boolean;
|
||||||
configDir: string;
|
configDir: string;
|
||||||
pluginID: string;
|
pluginID: string;
|
||||||
profiler: Profiler | undefined;
|
profiler: Profiler | undefined;
|
||||||
@@ -17,6 +18,7 @@ export class FakeFsLocal extends FakeFs {
|
|||||||
constructor(
|
constructor(
|
||||||
vault: Vault,
|
vault: Vault,
|
||||||
syncConfigDir: boolean,
|
syncConfigDir: boolean,
|
||||||
|
syncBookmarks: boolean,
|
||||||
configDir: string,
|
configDir: string,
|
||||||
pluginID: string,
|
pluginID: string,
|
||||||
profiler: Profiler | undefined,
|
profiler: Profiler | undefined,
|
||||||
@@ -26,6 +28,7 @@ export class FakeFsLocal extends FakeFs {
|
|||||||
|
|
||||||
this.vault = vault;
|
this.vault = vault;
|
||||||
this.syncConfigDir = syncConfigDir;
|
this.syncConfigDir = syncConfigDir;
|
||||||
|
this.syncBookmarks = syncBookmarks;
|
||||||
this.configDir = configDir;
|
this.configDir = configDir;
|
||||||
this.pluginID = pluginID;
|
this.pluginID = pluginID;
|
||||||
this.profiler = profiler;
|
this.profiler = profiler;
|
||||||
@@ -96,13 +99,16 @@ export class FakeFsLocal extends FakeFs {
|
|||||||
|
|
||||||
this.profiler?.insert("finish transforming walk for local");
|
this.profiler?.insert("finish transforming walk for local");
|
||||||
|
|
||||||
if (this.syncConfigDir) {
|
if (this.syncConfigDir || this.syncBookmarks) {
|
||||||
this.profiler?.insert("into syncConfigDir");
|
this.profiler?.insert("into syncConfigDir or syncBookmarks");
|
||||||
|
const bookmarksOnly = !this.syncConfigDir;
|
||||||
const syncFiles = await listFilesInObsFolder(
|
const syncFiles = await listFilesInObsFolder(
|
||||||
this.configDir,
|
this.configDir,
|
||||||
this.vault,
|
this.vault,
|
||||||
this.pluginID
|
this.pluginID,
|
||||||
|
bookmarksOnly
|
||||||
);
|
);
|
||||||
|
// console.debug(`syncFiles in obs: ${JSON.stringify(syncFiles, null, 2)}`);
|
||||||
for (const f of syncFiles) {
|
for (const f of syncFiles) {
|
||||||
local.push(f);
|
local.push(f);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ export class FakeFsMock extends FakeFs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkConnect(callbackFunc?: any): Promise<boolean> {
|
async checkConnect(callbackFunc?: any): Promise<boolean> {
|
||||||
return true;
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
|
|||||||
+11
-3
@@ -399,8 +399,12 @@ ${constructFromDriveItemToEntityError(x)}`
|
|||||||
key = `${key}/`;
|
key = `${key}/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mtimeSvr = Date.parse(x?.fileSystemInfo!.lastModifiedDateTime!);
|
const mtimeTry = x?.fileSystemInfo?.lastModifiedDateTime;
|
||||||
const mtimeCli = Date.parse(x?.fileSystemInfo!.lastModifiedDateTime!);
|
if (mtimeTry === undefined || mtimeTry === null) {
|
||||||
|
throw Error(`onedrive cannot parse mtime: ${JSON.stringify(x, null, 2)}`);
|
||||||
|
}
|
||||||
|
const mtimeSvr = Date.parse(mtimeTry);
|
||||||
|
const mtimeCli = Date.parse(mtimeTry);
|
||||||
return {
|
return {
|
||||||
key: key,
|
key: key,
|
||||||
keyRaw: key,
|
keyRaw: key,
|
||||||
@@ -1032,12 +1036,16 @@ export class FakeFsOnedrive extends FakeFs {
|
|||||||
async checkConnect(callbackFunc?: any): Promise<boolean> {
|
async checkConnect(callbackFunc?: any): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
const k = await this.getUserDisplayName();
|
const k = await this.getUserDisplayName();
|
||||||
return k !== "<unknown display name>";
|
if (k === "<unknown display name>") {
|
||||||
|
throw Error(`unknown display name!`);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName() {
|
async getUserDisplayName() {
|
||||||
|
|||||||
+6
-8
@@ -831,14 +831,11 @@ export class FakeFsS3 extends FakeFs {
|
|||||||
results.$metadata === undefined ||
|
results.$metadata === undefined ||
|
||||||
results.$metadata.httpStatusCode === undefined
|
results.$metadata.httpStatusCode === undefined
|
||||||
) {
|
) {
|
||||||
const err = "results or $metadata or httStatusCode is undefined";
|
throw Error("results or $metadata or httStatusCode is undefined");
|
||||||
console.debug(err);
|
}
|
||||||
if (callbackFunc !== undefined) {
|
if (results.$metadata.httpStatusCode !== 200) {
|
||||||
callbackFunc(err);
|
throw Error(`not 200 httpStatusCode`);
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return results.$metadata.httpStatusCode === 200;
|
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.debug(err);
|
console.debug(err);
|
||||||
if (callbackFunc !== undefined) {
|
if (callbackFunc !== undefined) {
|
||||||
@@ -854,9 +851,10 @@ export class FakeFsS3 extends FakeFs {
|
|||||||
callbackFunc(err);
|
callbackFunc(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
|
|||||||
+125
-27
@@ -4,8 +4,6 @@ import { getReasonPhrase } from "http-status-codes/build/cjs/utils-functions";
|
|||||||
import chunk from "lodash/chunk";
|
import chunk from "lodash/chunk";
|
||||||
import cloneDeep from "lodash/cloneDeep";
|
import cloneDeep from "lodash/cloneDeep";
|
||||||
import flatten from "lodash/flatten";
|
import flatten from "lodash/flatten";
|
||||||
import isString from "lodash/isString";
|
|
||||||
import { nanoid } from "nanoid";
|
|
||||||
import { Platform, type RequestUrlParam, requestUrl } from "obsidian";
|
import { Platform, type RequestUrlParam, requestUrl } from "obsidian";
|
||||||
import type {
|
import type {
|
||||||
FileStat,
|
FileStat,
|
||||||
@@ -140,6 +138,7 @@ if (VALID_REQURL) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import isEqual from "lodash/isEqual";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
// biome-ignore lint: we want to ts-ignore the next line
|
// biome-ignore lint: we want to ts-ignore the next line
|
||||||
import { AuthType, BufferLike, createClient } from "webdav/dist/web/index.js";
|
import { AuthType, BufferLike, createClient } from "webdav/dist/web/index.js";
|
||||||
@@ -209,6 +208,36 @@ const tryEncodeURI = (x: string) => {
|
|||||||
return encodeURI(x);
|
return encodeURI(x);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const tryEncodeUsernamePassword = (x: string) => {
|
||||||
|
if (onlyAscii(x)) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
return unescape(encodeURIComponent(x));
|
||||||
|
};
|
||||||
|
|
||||||
|
const parseCustomHeaders = (x: string): Record<string, string> => {
|
||||||
|
const y = x.trim();
|
||||||
|
if (y === "") {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
const z = y.split("\n");
|
||||||
|
|
||||||
|
const res: Record<string, string> = {};
|
||||||
|
|
||||||
|
for (const kv of z) {
|
||||||
|
if (!kv.includes(":")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [keyRaw, ...valueArr] = kv.split(":");
|
||||||
|
const key = keyRaw.trim();
|
||||||
|
const value = valueArr.join(":").trim();
|
||||||
|
res[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
|
||||||
export class FakeFsWebdav extends FakeFs {
|
export class FakeFsWebdav extends FakeFs {
|
||||||
kind: "webdav";
|
kind: "webdav";
|
||||||
|
|
||||||
@@ -218,7 +247,8 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
vaultFolderExists: boolean;
|
vaultFolderExists: boolean;
|
||||||
saveUpdatedConfigFunc: () => Promise<any>;
|
saveUpdatedConfigFunc: () => Promise<any>;
|
||||||
|
|
||||||
supportNativePartial: boolean;
|
supportApachePartial: boolean;
|
||||||
|
supportSabrePartial: boolean;
|
||||||
isNextcloud: boolean;
|
isNextcloud: boolean;
|
||||||
nextcloudUploadServerAddress: string;
|
nextcloudUploadServerAddress: string;
|
||||||
|
|
||||||
@@ -235,7 +265,8 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
this.vaultFolderExists = false;
|
this.vaultFolderExists = false;
|
||||||
this.saveUpdatedConfigFunc = saveUpdatedConfigFunc;
|
this.saveUpdatedConfigFunc = saveUpdatedConfigFunc;
|
||||||
|
|
||||||
this.supportNativePartial = false;
|
this.supportApachePartial = false;
|
||||||
|
this.supportSabrePartial = false;
|
||||||
this.isNextcloud = false;
|
this.isNextcloud = false;
|
||||||
this.nextcloudUploadServerAddress = "";
|
this.nextcloudUploadServerAddress = "";
|
||||||
}
|
}
|
||||||
@@ -246,16 +277,21 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const headers = {
|
const cacheHeader = {
|
||||||
"Cache-Control": "no-cache",
|
"Cache-Control": "no-cache",
|
||||||
};
|
};
|
||||||
|
const customHeaders = parseCustomHeaders(
|
||||||
|
this.webdavConfig.customHeaders ?? ""
|
||||||
|
);
|
||||||
|
const headers = { ...cacheHeader, ...customHeaders };
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.webdavConfig.username !== "" &&
|
this.webdavConfig.username !== "" &&
|
||||||
this.webdavConfig.password !== ""
|
this.webdavConfig.password !== ""
|
||||||
) {
|
) {
|
||||||
this.client = createClient(this.webdavConfig.address, {
|
this.client = createClient(this.webdavConfig.address, {
|
||||||
username: this.webdavConfig.username,
|
username: tryEncodeUsernamePassword(this.webdavConfig.username),
|
||||||
password: this.webdavConfig.password,
|
password: tryEncodeUsernamePassword(this.webdavConfig.password),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
authType:
|
authType:
|
||||||
this.webdavConfig.authType === "digest"
|
this.webdavConfig.authType === "digest"
|
||||||
@@ -364,14 +400,21 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
// taken from https://github.com/perry-mitchell/webdav-client/blob/master/source/operations/partialUpdateFileContents.ts
|
// taken from https://github.com/perry-mitchell/webdav-client/blob/master/source/operations/partialUpdateFileContents.ts
|
||||||
// which is under MIT license
|
// which is under MIT license
|
||||||
if (
|
if (
|
||||||
(compliance.server.includes("Apache") &&
|
compliance.server.includes("Apache") &&
|
||||||
compliance.compliance.includes(
|
compliance.compliance.includes("<http://apache.org/dav/propset/fs/1>")
|
||||||
"<http://apache.org/dav/propset/fs/1>"
|
|
||||||
)) ||
|
|
||||||
compliance.compliance.includes("sabredav-partialupdate")
|
|
||||||
) {
|
) {
|
||||||
this.supportNativePartial = true;
|
this.supportApachePartial = true;
|
||||||
console.debug(`supportNativePartial=true`);
|
console.debug(
|
||||||
|
`supportApachePartial=true, compliance=${JSON.stringify(compliance)}`
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (compliance.compliance.includes("sabredav-partialupdate")) {
|
||||||
|
this.supportSabrePartial = true;
|
||||||
|
console.debug(
|
||||||
|
`supportSabrePartial=true, compliance=${JSON.stringify(compliance)}`
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +430,9 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
this.webdavConfig.depth === "auto_unknown" ||
|
this.webdavConfig.depth === "auto_unknown" ||
|
||||||
this.webdavConfig.depth === "auto_1" ||
|
this.webdavConfig.depth === "auto_1" ||
|
||||||
this.webdavConfig.depth === "auto_infinity" /* don't trust auto now */ ||
|
this.webdavConfig.depth === "auto_infinity" /* don't trust auto now */ ||
|
||||||
this.webdavConfig.depth === "manual_1"
|
this.webdavConfig.depth === "manual_1" ||
|
||||||
|
this.webdavConfig.address.includes("jianguoyun.com") ||
|
||||||
|
this.webdavConfig.address.includes("teracloud.jp")
|
||||||
) {
|
) {
|
||||||
// the remote doesn't support infinity propfind,
|
// the remote doesn't support infinity propfind,
|
||||||
// we need to do a bfs here
|
// we need to do a bfs here
|
||||||
@@ -540,7 +585,11 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// larger than 10 MB
|
// larger than 10 MB
|
||||||
if (!this.isNextcloud && !this.supportNativePartial) {
|
if (
|
||||||
|
!this.isNextcloud &&
|
||||||
|
!this.supportApachePartial &&
|
||||||
|
!this.supportSabrePartial
|
||||||
|
) {
|
||||||
// give up and upload by whole, and directly return
|
// give up and upload by whole, and directly return
|
||||||
return await this._writeFileFromRootFull(
|
return await this._writeFileFromRootFull(
|
||||||
key,
|
key,
|
||||||
@@ -561,8 +610,16 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
ctime,
|
ctime,
|
||||||
origKey
|
origKey
|
||||||
);
|
);
|
||||||
} else if (this.supportNativePartial) {
|
} else if (this.supportApachePartial) {
|
||||||
return await this._writeFileFromRootNativePartial(
|
return await this._writeFileFromRootApachePartial(
|
||||||
|
key,
|
||||||
|
content,
|
||||||
|
mtime,
|
||||||
|
ctime,
|
||||||
|
origKey
|
||||||
|
);
|
||||||
|
} else if (this.supportSabrePartial) {
|
||||||
|
return await this._writeFileFromRootSabrePartial(
|
||||||
key,
|
key,
|
||||||
content,
|
content,
|
||||||
mtime,
|
mtime,
|
||||||
@@ -578,7 +635,7 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
throw e;
|
throw e;
|
||||||
// this.isNextcloud = false;
|
// this.isNextcloud = false;
|
||||||
// this.supportNativePartial = false;
|
// this.supportApachePartial = false;
|
||||||
// return await this._writeFileFromRootFull(
|
// return await this._writeFileFromRootFull(
|
||||||
// key,
|
// key,
|
||||||
// content,
|
// content,
|
||||||
@@ -646,8 +703,8 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
console.debug(`tmpFolderName=${tmpFolderName}`);
|
console.debug(`tmpFolderName=${tmpFolderName}`);
|
||||||
|
|
||||||
const clientForUpload = createClient(uploadServerAddress, {
|
const clientForUpload = createClient(uploadServerAddress, {
|
||||||
username: this.webdavConfig.username,
|
username: tryEncodeUsernamePassword(this.webdavConfig.username),
|
||||||
password: this.webdavConfig.password,
|
password: tryEncodeUsernamePassword(this.webdavConfig.password),
|
||||||
headers: {
|
headers: {
|
||||||
"Cache-Control": "no-cache",
|
"Cache-Control": "no-cache",
|
||||||
},
|
},
|
||||||
@@ -723,7 +780,7 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
async _writeFileFromRootNativePartial(
|
async _writeFileFromRootApachePartial(
|
||||||
key: string,
|
key: string,
|
||||||
content: ArrayBuffer,
|
content: ArrayBuffer,
|
||||||
mtime: number,
|
mtime: number,
|
||||||
@@ -745,6 +802,8 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
content.byteLength,
|
content.byteLength,
|
||||||
sizePerChunk
|
sizePerChunk
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TODO: parallel
|
||||||
for (let i = 0; i < chunkRanges.length; ++i) {
|
for (let i = 0; i < chunkRanges.length; ++i) {
|
||||||
const { start, end } = chunkRanges[i];
|
const { start, end } = chunkRanges[i];
|
||||||
await this.client.partialUpdateFileContents(
|
await this.client.partialUpdateFileContents(
|
||||||
@@ -759,6 +818,47 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
return await this.stat(origKey);
|
return await this.stat(origKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _writeFileFromRootSabrePartial(
|
||||||
|
key: string,
|
||||||
|
content: ArrayBuffer,
|
||||||
|
mtime: number,
|
||||||
|
ctime: number,
|
||||||
|
origKey: string
|
||||||
|
): Promise<Entity> {
|
||||||
|
// firstly upload a 0-byte data
|
||||||
|
await this._writeFileFromRootFull(
|
||||||
|
key,
|
||||||
|
new ArrayBuffer(0),
|
||||||
|
mtime,
|
||||||
|
ctime,
|
||||||
|
origKey
|
||||||
|
);
|
||||||
|
|
||||||
|
// then "update" by chunks
|
||||||
|
const sizePerChunk = 5 * 1024 * 1024; // 5 mb
|
||||||
|
const chunkRanges = splitFileSizeToChunkRanges(
|
||||||
|
content.byteLength,
|
||||||
|
sizePerChunk
|
||||||
|
);
|
||||||
|
|
||||||
|
// diff from apachePartial: we use "append" header here for dufs...
|
||||||
|
// we cannot parallel here
|
||||||
|
for (let i = 0; i < chunkRanges.length; ++i) {
|
||||||
|
const { start, end } = chunkRanges[i];
|
||||||
|
await this.client.customRequest(key, {
|
||||||
|
method: "PATCH",
|
||||||
|
headers: {
|
||||||
|
"X-Update-Range": "append",
|
||||||
|
"Content-Type": "application/x-sabredav-partialupdate",
|
||||||
|
},
|
||||||
|
data: content.slice(start, end + 1),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// lastly return
|
||||||
|
return await this.stat(origKey);
|
||||||
|
}
|
||||||
|
|
||||||
async readFile(key: string): Promise<ArrayBuffer> {
|
async readFile(key: string): Promise<ArrayBuffer> {
|
||||||
if (key.endsWith("/")) {
|
if (key.endsWith("/")) {
|
||||||
throw Error(`you should not call readFile on ${key}`);
|
throw Error(`you should not call readFile on ${key}`);
|
||||||
@@ -823,17 +923,15 @@ export class FakeFsWebdav extends FakeFs {
|
|||||||
await this._init();
|
await this._init();
|
||||||
const results = await this._statFromRoot(`/${this.remoteBaseDir}/`);
|
const results = await this._statFromRoot(`/${this.remoteBaseDir}/`);
|
||||||
if (results === undefined) {
|
if (results === undefined) {
|
||||||
const err = "results is undefined";
|
throw Error("cannot stat root vault folder!");
|
||||||
console.error(err);
|
|
||||||
callbackFunc?.(err);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
|
|||||||
+7
-3
@@ -117,7 +117,7 @@ export class FakeFsWebdis extends FakeFs {
|
|||||||
let cursor = "0";
|
let cursor = "0";
|
||||||
const res: Entity[] = [];
|
const res: Entity[] = [];
|
||||||
do {
|
do {
|
||||||
const command = `SCAN/${cursor}/MATCH/rs:fs:v1:*:meta/COUNT/1000`;
|
const command = `SCAN/${cursor}/MATCH/rs:fs:v1:${encodeURIComponent(this.remoteBaseDir + "/")}*:meta/COUNT/1000`;
|
||||||
const rsp = (await (await this._fetchCommand("GET", command)).json())[
|
const rsp = (await (await this._fetchCommand("GET", command)).json())[
|
||||||
"SCAN"
|
"SCAN"
|
||||||
];
|
];
|
||||||
@@ -136,7 +136,7 @@ export class FakeFsWebdis extends FakeFs {
|
|||||||
async walkPartial(): Promise<Entity[]> {
|
async walkPartial(): Promise<Entity[]> {
|
||||||
let cursor = "0";
|
let cursor = "0";
|
||||||
const res: Entity[] = [];
|
const res: Entity[] = [];
|
||||||
const command = `SCAN/${cursor}/MATCH/rs:fs:v1:*:meta/COUNT/10`; // fewer keys
|
const command = `SCAN/${cursor}/MATCH/rs:fs:v1:${encodeURIComponent(this.remoteBaseDir + "/")}*:meta/COUNT/10`; // fewer keys
|
||||||
const rsp = (await (await this._fetchCommand("GET", command)).json())[
|
const rsp = (await (await this._fetchCommand("GET", command)).json())[
|
||||||
"SCAN"
|
"SCAN"
|
||||||
];
|
];
|
||||||
@@ -252,12 +252,16 @@ export class FakeFsWebdis extends FakeFs {
|
|||||||
const k = await (
|
const k = await (
|
||||||
await this._fetchCommand("GET", "PING/helloworld")
|
await this._fetchCommand("GET", "PING/helloworld")
|
||||||
).json();
|
).json();
|
||||||
return isEqual(k, { PING: "helloworld" });
|
if (!isEqual(k, { PING: "helloworld" })) {
|
||||||
|
throw Error(`no correct ping response`);
|
||||||
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
callbackFunc?.(err);
|
callbackFunc?.(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return await this.checkConnectCommonOps(callbackFunc);
|
||||||
|
// return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserDisplayName(): Promise<string> {
|
async getUserDisplayName(): Promise<string> {
|
||||||
|
|||||||
@@ -232,6 +232,7 @@
|
|||||||
"settings_onedrive_emptyfile_desc": "OneDrive doesn't allow uploading empty file (even in its official website). Do you want to show up errors or silently skip the empty files?",
|
"settings_onedrive_emptyfile_desc": "OneDrive doesn't allow uploading empty file (even in its official website). Do you want to show up errors or silently skip the empty files?",
|
||||||
"settings_onedrive_emptyfile_skip": "Skip",
|
"settings_onedrive_emptyfile_skip": "Skip",
|
||||||
"settings_onedrive_emptyfile_error": "Error and abort",
|
"settings_onedrive_emptyfile_error": "Error and abort",
|
||||||
|
|
||||||
"settings_webdav": "Remote For Webdav",
|
"settings_webdav": "Remote For Webdav",
|
||||||
"settings_webdav_disclaimer1": "Disclaimer: The information is stored locally. Other malicious/harmful/faulty plugins may read the info. If you see any unintentional access to your webdav server, please immediately change the username and password.",
|
"settings_webdav_disclaimer1": "Disclaimer: The information is stored locally. Other malicious/harmful/faulty plugins may read the info. If you see any unintentional access to your webdav server, please immediately change the username and password.",
|
||||||
"settings_webdav_cors_os": "Obsidian desktop>=0.13.25 or iOS>=1.1.1 or Android>=1.2.1 supports bypassing CORS locally. But you are using an old version, and you're suggested to upgrade Obsidian.",
|
"settings_webdav_cors_os": "Obsidian desktop>=0.13.25 or iOS>=1.1.1 or Android>=1.2.1 supports bypassing CORS locally. But you are using an old version, and you're suggested to upgrade Obsidian.",
|
||||||
@@ -249,9 +250,12 @@
|
|||||||
"settings_webdav_depth_desc": "Webdav servers should be configured to allow requests with header Depth being '1' or 'Infinity'. If you are not sure what's this, choose \"depth='1'\". If you are sure your server supports depth='infinity', please choose that to get way better performance.",
|
"settings_webdav_depth_desc": "Webdav servers should be configured to allow requests with header Depth being '1' or 'Infinity'. If you are not sure what's this, choose \"depth='1'\". If you are sure your server supports depth='infinity', please choose that to get way better performance.",
|
||||||
"settings_webdav_depth_1": "only supports depth='1'",
|
"settings_webdav_depth_1": "only supports depth='1'",
|
||||||
"settings_webdav_depth_inf": "supports depth='infinity'",
|
"settings_webdav_depth_inf": "supports depth='infinity'",
|
||||||
|
"settings_webdav_customheaders": "Custom Headers Sent To Servers",
|
||||||
|
"settings_webdav_customheaders_desc": "Some users may want to set custom headers. If you don't know what it is, just leave it empty. Input them like: <code>X-Header1:value1</code> in each line. All spaces around header keys and values will be removed.",
|
||||||
"settings_webdav_connect_succ": "Great! The webdav server can be accessed.",
|
"settings_webdav_connect_succ": "Great! The webdav server can be accessed.",
|
||||||
"settings_webdav_connect_fail": "The webdav server cannot be reached (possible to be any of address/username/password/authtype errors).",
|
"settings_webdav_connect_fail": "The webdav server cannot be reached (possible to be any of address/username/password/authtype errors).",
|
||||||
"settings_webdav_connect_fail_withcors": "The webdav server cannot be reached (possible to be any of address/username/password/authtype/CORS errors).",
|
"settings_webdav_connect_fail_withcors": "The webdav server cannot be reached (possible to be any of address/username/password/authtype/CORS errors).",
|
||||||
|
|
||||||
"settings_webdis": "Remote For Webdis",
|
"settings_webdis": "Remote For Webdis",
|
||||||
"settings_webdis_disclaimer1": "Disclaimer: This app is NOT an official Redis® Ltd / Redis® OSS / Webdis product. Redis is a registered trademark of Redis Ltd.",
|
"settings_webdis_disclaimer1": "Disclaimer: This app is NOT an official Redis® Ltd / Redis® OSS / Webdis product. Redis is a registered trademark of Redis Ltd.",
|
||||||
"settings_webdis_disclaimer2": "Disclaimer: The information is stored locally. Other malicious/harmful/faulty plugins may read the info. If you see any unintentional access to your Webdis server, please immediately change the username and password.",
|
"settings_webdis_disclaimer2": "Disclaimer: The information is stored locally. Other malicious/harmful/faulty plugins may read the info. If you see any unintentional access to your Webdis server, please immediately change the username and password.",
|
||||||
@@ -278,6 +282,8 @@
|
|||||||
"settings_syncunderscore_desc": "Sync files or folders starting with _ (\"underscore\") or not",
|
"settings_syncunderscore_desc": "Sync files or folders starting with _ (\"underscore\") or not",
|
||||||
"settings_configdir": "Sync Config Dir (experimental)",
|
"settings_configdir": "Sync Config Dir (experimental)",
|
||||||
"settings_configdir_desc": "Sync config dir {{configDir}} or not (inner folder .git and node_modules would be ignored). Please be aware that this may impact all your plugins' or Obsidian's settings, and may require you restart Obsidian after sync. Enable this at your own risk.",
|
"settings_configdir_desc": "Sync config dir {{configDir}} or not (inner folder .git and node_modules would be ignored). Please be aware that this may impact all your plugins' or Obsidian's settings, and may require you restart Obsidian after sync. Enable this at your own risk.",
|
||||||
|
"settings_bookmarks": "Sync Bookmarks (experimental)",
|
||||||
|
"settings_bookmarks_desc": "Sync {{configDir}}/bookmarks.json or not. If you sync config dir, this option will be ignore and treated as \"enabled\".",
|
||||||
"settings_deletetowhere": "Deletion Destination",
|
"settings_deletetowhere": "Deletion Destination",
|
||||||
"settings_deletetowhere_desc": "Which trash should the plugin put the files into while deleting?",
|
"settings_deletetowhere_desc": "Which trash should the plugin put the files into while deleting?",
|
||||||
"settings_deletetowhere_system_trash": "system trash (default)",
|
"settings_deletetowhere_system_trash": "system trash (default)",
|
||||||
@@ -336,6 +342,7 @@
|
|||||||
"settings_syncplans": "Export Sync Plans",
|
"settings_syncplans": "Export Sync Plans",
|
||||||
"settings_syncplans_desc": "Sync plans are created every time after you trigger sync and before the actual sync. Useful to know what would actually happen in those sync. Click the button to export sync plans.",
|
"settings_syncplans_desc": "Sync plans are created every time after you trigger sync and before the actual sync. Useful to know what would actually happen in those sync. Click the button to export sync plans.",
|
||||||
"settings_syncplans_button_1_only_change": "Export latest 1 (change part)",
|
"settings_syncplans_button_1_only_change": "Export latest 1 (change part)",
|
||||||
|
"settings_syncplans_button_5_only_change": "Export latest 5 (change part)",
|
||||||
"settings_syncplans_button_1": "Export latest 1",
|
"settings_syncplans_button_1": "Export latest 1",
|
||||||
"settings_syncplans_button_5": "Export latest 5",
|
"settings_syncplans_button_5": "Export latest 5",
|
||||||
"settings_syncplans_button_all": "Export All",
|
"settings_syncplans_button_all": "Export All",
|
||||||
|
|||||||
@@ -231,6 +231,7 @@
|
|||||||
"settings_onedrive_emptyfile_desc": "OneDrive 不允许上传空文件(即使官网也是不允许的)。那么你想跳过空文件还是返回错误?",
|
"settings_onedrive_emptyfile_desc": "OneDrive 不允许上传空文件(即使官网也是不允许的)。那么你想跳过空文件还是返回错误?",
|
||||||
"settings_onedrive_emptyfile_skip": "跳过",
|
"settings_onedrive_emptyfile_skip": "跳过",
|
||||||
"settings_onedrive_emptyfile_error": "返回错误和中断",
|
"settings_onedrive_emptyfile_error": "返回错误和中断",
|
||||||
|
|
||||||
"settings_webdav": "Webdav 设置",
|
"settings_webdav": "Webdav 设置",
|
||||||
"settings_webdav_disclaimer1": "声明:您所输入的信息存储于本地。其它有害的或者出错的插件,是有可能读取到这些信息的。如果您发现了 Webdav 服务器有不符合预期的访问,请立刻修改用户名和密码。",
|
"settings_webdav_disclaimer1": "声明:您所输入的信息存储于本地。其它有害的或者出错的插件,是有可能读取到这些信息的。如果您发现了 Webdav 服务器有不符合预期的访问,请立刻修改用户名和密码。",
|
||||||
"settings_webdav_cors_os": "Obsidian 桌面版>=0.13.25 或 iOS>=1.1.1 或 Android>=1.2.1 支持跳过 CORS 设置。但您正在使用旧版,建议升级。",
|
"settings_webdav_cors_os": "Obsidian 桌面版>=0.13.25 或 iOS>=1.1.1 或 Android>=1.2.1 支持跳过 CORS 设置。但您正在使用旧版,建议升级。",
|
||||||
@@ -248,9 +249,12 @@
|
|||||||
"settings_webdav_depth_desc": "Webdav 服务器会被设为接收 Depth header 为“1”或“Infinity”请求。如果您不清楚如何设置,可以选择 depth='1'。如果那你确认服务器支持 depth='infinity',请选择它,会获得更加好的性能。",
|
"settings_webdav_depth_desc": "Webdav 服务器会被设为接收 Depth header 为“1”或“Infinity”请求。如果您不清楚如何设置,可以选择 depth='1'。如果那你确认服务器支持 depth='infinity',请选择它,会获得更加好的性能。",
|
||||||
"settings_webdav_depth_1": "只支持 depth='1'",
|
"settings_webdav_depth_1": "只支持 depth='1'",
|
||||||
"settings_webdav_depth_inf": "支持 depth='infinity'",
|
"settings_webdav_depth_inf": "支持 depth='infinity'",
|
||||||
|
"settings_webdav_customheaders": "发送到服务器的自定义 Header",
|
||||||
|
"settings_webdav_customheaders_desc": "有些用户需要设置自定义 header。如果您不知道是什么,可以直接留空不填。输入格式:每行形如 <code>X-Header1:value1</code>。header 的 key 和 value 之间的空格会被删除。",
|
||||||
"settings_webdav_connect_succ": "很好!可以连接上 Webdav 服务器。",
|
"settings_webdav_connect_succ": "很好!可以连接上 Webdav 服务器。",
|
||||||
"settings_webdav_connect_fail": "无法连接上 Webdav 服务器。(可能是地址/账号/密码/鉴权类型等错误。)",
|
"settings_webdav_connect_fail": "无法连接上 Webdav 服务器。(可能是地址/账号/密码/鉴权类型等错误。)",
|
||||||
"settings_webdav_connect_fail_withcors": "无法连接上 Webdav 服务器。(可能是地址/账号/密码/鉴权类型/CORS 等错误。)",
|
"settings_webdav_connect_fail_withcors": "无法连接上 Webdav 服务器。(可能是地址/账号/密码/鉴权类型/CORS 等错误。)",
|
||||||
|
|
||||||
"settings_webdis": "Webdis 设置",
|
"settings_webdis": "Webdis 设置",
|
||||||
"settings_webdis_disclaimer1": "声明:此插件不是 Redis® Ltd 或 Redis® 软件或 Wedis 的官方产品。Redis 是 Redis Ltd 的注册商标。",
|
"settings_webdis_disclaimer1": "声明:此插件不是 Redis® Ltd 或 Redis® 软件或 Wedis 的官方产品。Redis 是 Redis Ltd 的注册商标。",
|
||||||
"settings_webdis_disclaimer2": "声明:您所输入的信息存储于本地。其它有害的或者出错的插件,是有可能读取到这些信息的。如果您发现了 Webdis 服务器有不符合预期的访问,请立刻修改用户名和密码。",
|
"settings_webdis_disclaimer2": "声明:您所输入的信息存储于本地。其它有害的或者出错的插件,是有可能读取到这些信息的。如果您发现了 Webdis 服务器有不符合预期的访问,请立刻修改用户名和密码。",
|
||||||
@@ -277,6 +281,8 @@
|
|||||||
"settings_syncunderscore_desc": "是否同步“_”(下划线)开始的文件或文件夹。",
|
"settings_syncunderscore_desc": "是否同步“_”(下划线)开始的文件或文件夹。",
|
||||||
"settings_configdir": "同步配置文件夹(实验性质)",
|
"settings_configdir": "同步配置文件夹(实验性质)",
|
||||||
"settings_configdir_desc": "是否同步 Obsidian 的配置文件夹 {{configDir}}(其中的 .git 和 node_modules 依然会被忽略)。请注意,此设置可能会影响到您 Obsidian 或者所有的插件设置,也可能需要您同步完毕后重启 Obsidian。如果您同意自行承受其风险,则可以开启本设置。",
|
"settings_configdir_desc": "是否同步 Obsidian 的配置文件夹 {{configDir}}(其中的 .git 和 node_modules 依然会被忽略)。请注意,此设置可能会影响到您 Obsidian 或者所有的插件设置,也可能需要您同步完毕后重启 Obsidian。如果您同意自行承受其风险,则可以开启本设置。",
|
||||||
|
"settings_bookmarks": "同步书签(实验性质)",
|
||||||
|
"settings_bookmarks_desc": "是否同步书签 {{configDir}}/bookmarks.json 。如果您设置了同步配置文件夹,此选项会被忽略并设为“开启”。",
|
||||||
"settings_deletetowhere": "删除文件到哪里",
|
"settings_deletetowhere": "删除文件到哪里",
|
||||||
"settings_deletetowhere_desc": "插件触发删除操作时候,删除到哪里?",
|
"settings_deletetowhere_desc": "插件触发删除操作时候,删除到哪里?",
|
||||||
"settings_deletetowhere_system_trash": "系统回收站(默认)",
|
"settings_deletetowhere_system_trash": "系统回收站(默认)",
|
||||||
@@ -335,6 +341,7 @@
|
|||||||
"settings_syncplans": "导出同步计划",
|
"settings_syncplans": "导出同步计划",
|
||||||
"settings_syncplans_desc": "每次您启动同步,并在实际上传下载前,插件会生成同步计划。它可以使您知道每次同步发生了什么。点击按钮可以导出同步计划。",
|
"settings_syncplans_desc": "每次您启动同步,并在实际上传下载前,插件会生成同步计划。它可以使您知道每次同步发生了什么。点击按钮可以导出同步计划。",
|
||||||
"settings_syncplans_button_1_only_change": "导出最近 1 次(仅修改部分)",
|
"settings_syncplans_button_1_only_change": "导出最近 1 次(仅修改部分)",
|
||||||
|
"settings_syncplans_button_5_only_change": "导出最近 5 次(仅修改部分)",
|
||||||
"settings_syncplans_button_1": "导出最近 1 次",
|
"settings_syncplans_button_1": "导出最近 1 次",
|
||||||
"settings_syncplans_button_5": "导出最近 5 次",
|
"settings_syncplans_button_5": "导出最近 5 次",
|
||||||
"settings_syncplans_button_all": "导出所有",
|
"settings_syncplans_button_all": "导出所有",
|
||||||
|
|||||||
@@ -230,6 +230,7 @@
|
|||||||
"settings_onedrive_emptyfile_desc": "OneDrive 不允許上傳空檔案(即使官網也是不允許的)。那麼你想跳過空檔案還是返回錯誤?",
|
"settings_onedrive_emptyfile_desc": "OneDrive 不允許上傳空檔案(即使官網也是不允許的)。那麼你想跳過空檔案還是返回錯誤?",
|
||||||
"settings_onedrive_emptyfile_skip": "跳過",
|
"settings_onedrive_emptyfile_skip": "跳過",
|
||||||
"settings_onedrive_emptyfile_error": "返回錯誤和中斷",
|
"settings_onedrive_emptyfile_error": "返回錯誤和中斷",
|
||||||
|
|
||||||
"settings_webdav": "Webdav 設定",
|
"settings_webdav": "Webdav 設定",
|
||||||
"settings_webdav_disclaimer1": "宣告:您所輸入的資訊儲存於本地。其它有害的或者出錯的外掛,是有可能讀取到這些資訊的。如果您發現了 Webdav 伺服器有不符合預期的訪問,請立刻修改使用者名稱和密碼。",
|
"settings_webdav_disclaimer1": "宣告:您所輸入的資訊儲存於本地。其它有害的或者出錯的外掛,是有可能讀取到這些資訊的。如果您發現了 Webdav 伺服器有不符合預期的訪問,請立刻修改使用者名稱和密碼。",
|
||||||
"settings_webdav_cors_os": "Obsidian 桌面版>=0.13.25 或 iOS>=1.1.1 或 Android>=1.1.1 支援跳過 CORS 設定。但您正在使用舊版,建議升級。",
|
"settings_webdav_cors_os": "Obsidian 桌面版>=0.13.25 或 iOS>=1.1.1 或 Android>=1.1.1 支援跳過 CORS 設定。但您正在使用舊版,建議升級。",
|
||||||
@@ -247,9 +248,12 @@
|
|||||||
"settings_webdav_depth_desc": "Webdav 伺服器會被設為接收 Depth header 為“1”或“Infinity”請求。如果您不清楚如何設定,可以選擇 depth='1'。如果那你確認伺服器支援 depth='infinity',請選擇它,會獲得更加好的效能。",
|
"settings_webdav_depth_desc": "Webdav 伺服器會被設為接收 Depth header 為“1”或“Infinity”請求。如果您不清楚如何設定,可以選擇 depth='1'。如果那你確認伺服器支援 depth='infinity',請選擇它,會獲得更加好的效能。",
|
||||||
"settings_webdav_depth_1": "只支援 depth='1'",
|
"settings_webdav_depth_1": "只支援 depth='1'",
|
||||||
"settings_webdav_depth_inf": "支援 depth='infinity'",
|
"settings_webdav_depth_inf": "支援 depth='infinity'",
|
||||||
|
"settings_webdav_customheaders": "傳送到伺服器的自定義 Header",
|
||||||
|
"settings_webdav_customheaders_desc": "有些使用者需要設定自定義 header。如果您不知道是什麼,可以直接留空不填。輸入格式:每行形如 <code>X-Header1:value1</code>。header 的 key 和 value 之間的空格會被刪除。",
|
||||||
"settings_webdav_connect_succ": "很好!可以連線上 Webdav 伺服器。",
|
"settings_webdav_connect_succ": "很好!可以連線上 Webdav 伺服器。",
|
||||||
"settings_webdav_connect_fail": "無法連線上 Webdav 伺服器。(可能是地址/賬號/密碼/鑑權型別等錯誤。)",
|
"settings_webdav_connect_fail": "無法連線上 Webdav 伺服器。(可能是地址/賬號/密碼/鑑權型別等錯誤。)",
|
||||||
"settings_webdav_connect_fail_withcors": "無法連線上 Webdav 伺服器。(可能是地址/賬號/密碼/鑑權型別/CORS 等錯誤。)",
|
"settings_webdav_connect_fail_withcors": "無法連線上 Webdav 伺服器。(可能是地址/賬號/密碼/鑑權型別/CORS 等錯誤。)",
|
||||||
|
|
||||||
"settings_webdis": "Webdis 設置",
|
"settings_webdis": "Webdis 設置",
|
||||||
"settings_webdis_disclaimer1": "聲明:此插件不是 Redis® Ltd 或 Redis® 軟件或 Wedis 的官方產品。Redis 是 Redis Ltd 的註冊商標。",
|
"settings_webdis_disclaimer1": "聲明:此插件不是 Redis® Ltd 或 Redis® 軟件或 Wedis 的官方產品。Redis 是 Redis Ltd 的註冊商標。",
|
||||||
"settings_webdis_disclaimer2": "聲明:您所輸入的信息存儲於本地。其它有害的或者出錯的插件,是有可能讀取到這些信息的。如果您發現了 Webdis 服務器有不符合預期的訪問,請立刻修改用戶名和密碼。",
|
"settings_webdis_disclaimer2": "聲明:您所輸入的信息存儲於本地。其它有害的或者出錯的插件,是有可能讀取到這些信息的。如果您發現了 Webdis 服務器有不符合預期的訪問,請立刻修改用戶名和密碼。",
|
||||||
@@ -276,6 +280,8 @@
|
|||||||
"settings_syncunderscore_desc": "是否同步“_”(下劃線)開始的檔案或資料夾。",
|
"settings_syncunderscore_desc": "是否同步“_”(下劃線)開始的檔案或資料夾。",
|
||||||
"settings_configdir": "同步配置資料夾(實驗性質)",
|
"settings_configdir": "同步配置資料夾(實驗性質)",
|
||||||
"settings_configdir_desc": "是否同步 Obsidian 的配置資料夾 {{configDir}}(其中的 .git 和 node_modules 依然會被忽略)。請注意,此設定可能會影響到您 Obsidian 或者所有的外掛設定,也可能需要您同步完畢後重啟 Obsidian。如果您同意自行承受其風險,則可以開啟本設定。",
|
"settings_configdir_desc": "是否同步 Obsidian 的配置資料夾 {{configDir}}(其中的 .git 和 node_modules 依然會被忽略)。請注意,此設定可能會影響到您 Obsidian 或者所有的外掛設定,也可能需要您同步完畢後重啟 Obsidian。如果您同意自行承受其風險,則可以開啟本設定。",
|
||||||
|
"settings_bookmarks": "同步書籤(實驗性質)",
|
||||||
|
"settings_bookmarks_desc": "是否同步書籤 {{configDir}}/bookmarks.json 。如果您設定了同步配置資料夾,此選項會被忽略並設為“開啟”。",
|
||||||
"settings_deletetowhere": "刪除檔案到哪裡",
|
"settings_deletetowhere": "刪除檔案到哪裡",
|
||||||
"settings_deletetowhere_desc": "外掛觸發刪除操作時候,刪除到哪裡?",
|
"settings_deletetowhere_desc": "外掛觸發刪除操作時候,刪除到哪裡?",
|
||||||
"settings_deletetowhere_system_trash": "系統回收站(預設)",
|
"settings_deletetowhere_system_trash": "系統回收站(預設)",
|
||||||
@@ -334,6 +340,7 @@
|
|||||||
"settings_syncplans": "匯出同步計劃",
|
"settings_syncplans": "匯出同步計劃",
|
||||||
"settings_syncplans_desc": "每次您啟動同步,並在實際上傳下載前,外掛會生成同步計劃。它可以使您知道每次同步發生了什麼。點選按鈕可以匯出同步計劃。",
|
"settings_syncplans_desc": "每次您啟動同步,並在實際上傳下載前,外掛會生成同步計劃。它可以使您知道每次同步發生了什麼。點選按鈕可以匯出同步計劃。",
|
||||||
"settings_syncplans_button_1_only_change": "匯出最近 1 次(僅修改部分)",
|
"settings_syncplans_button_1_only_change": "匯出最近 1 次(僅修改部分)",
|
||||||
|
"settings_syncplans_button_5_only_change": "匯出最近 5 次(僅修改部分)",
|
||||||
"settings_syncplans_button_1": "匯出最近 1 次",
|
"settings_syncplans_button_1": "匯出最近 1 次",
|
||||||
"settings_syncplans_button_5": "匯出最近 5 次",
|
"settings_syncplans_button_5": "匯出最近 5 次",
|
||||||
"settings_syncplans_button_all": "匯出所有",
|
"settings_syncplans_button_all": "匯出所有",
|
||||||
|
|||||||
+10
@@ -135,6 +135,7 @@ const DEFAULT_SETTINGS: RemotelySavePluginSettings = {
|
|||||||
agreeToUploadExtraMetadata: true, // as of 20240106, it's safe to assume every new user agrees with this
|
agreeToUploadExtraMetadata: true, // as of 20240106, it's safe to assume every new user agrees with this
|
||||||
concurrency: 5,
|
concurrency: 5,
|
||||||
syncConfigDir: false,
|
syncConfigDir: false,
|
||||||
|
syncBookmarks: false,
|
||||||
syncUnderscoreItems: false,
|
syncUnderscoreItems: false,
|
||||||
lang: "auto",
|
lang: "auto",
|
||||||
logToDB: false,
|
logToDB: false,
|
||||||
@@ -239,6 +240,7 @@ export default class RemotelySavePlugin extends Plugin {
|
|||||||
const fsLocal = new FakeFsLocal(
|
const fsLocal = new FakeFsLocal(
|
||||||
this.app.vault,
|
this.app.vault,
|
||||||
this.settings.syncConfigDir ?? false,
|
this.settings.syncConfigDir ?? false,
|
||||||
|
this.settings.syncBookmarks ?? false,
|
||||||
this.app.vault.configDir,
|
this.app.vault.configDir,
|
||||||
this.manifest.id,
|
this.manifest.id,
|
||||||
profiler,
|
profiler,
|
||||||
@@ -1337,6 +1339,10 @@ export default class RemotelySavePlugin extends Plugin {
|
|||||||
messyConfigToNormal(await this.loadData())
|
messyConfigToNormal(await this.loadData())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (this.settings.syncBookmarks === undefined) {
|
||||||
|
this.settings.syncBookmarks = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.settings.dropbox.clientID === "") {
|
if (this.settings.dropbox.clientID === "") {
|
||||||
this.settings.dropbox.clientID = DEFAULT_SETTINGS.dropbox.clientID;
|
this.settings.dropbox.clientID = DEFAULT_SETTINGS.dropbox.clientID;
|
||||||
}
|
}
|
||||||
@@ -1381,6 +1387,9 @@ export default class RemotelySavePlugin extends Plugin {
|
|||||||
if (this.settings.webdav.remoteBaseDir === undefined) {
|
if (this.settings.webdav.remoteBaseDir === undefined) {
|
||||||
this.settings.webdav.remoteBaseDir = "";
|
this.settings.webdav.remoteBaseDir = "";
|
||||||
}
|
}
|
||||||
|
if (this.settings.webdav.customHeaders === undefined) {
|
||||||
|
this.settings.webdav.customHeaders = "";
|
||||||
|
}
|
||||||
if (this.settings.s3.partsConcurrency === undefined) {
|
if (this.settings.s3.partsConcurrency === undefined) {
|
||||||
this.settings.s3.partsConcurrency = 20;
|
this.settings.s3.partsConcurrency = 20;
|
||||||
}
|
}
|
||||||
@@ -1876,6 +1885,7 @@ export default class RemotelySavePlugin extends Plugin {
|
|||||||
const fsLocal = new FakeFsLocal(
|
const fsLocal = new FakeFsLocal(
|
||||||
this.app.vault,
|
this.app.vault,
|
||||||
this.settings.syncConfigDir ?? false,
|
this.settings.syncConfigDir ?? false,
|
||||||
|
this.settings.syncBookmarks ?? false,
|
||||||
this.app.vault.configDir,
|
this.app.vault.configDir,
|
||||||
this.manifest.id,
|
this.manifest.id,
|
||||||
undefined,
|
undefined,
|
||||||
|
|||||||
+15
@@ -467,6 +467,21 @@ export const isSpecialFolderNameToSkip = (
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// microsoft tmp files...
|
||||||
|
const p = x.split("/");
|
||||||
|
if (p.length > 0) {
|
||||||
|
const f = p[p.length - 1]; // file name
|
||||||
|
if (f.startsWith("~$")) {
|
||||||
|
const suffixList = ["doc", "docx", "ppt", "pptx", "xls", "xlsx"];
|
||||||
|
for (const suffix of suffixList) {
|
||||||
|
if (f.endsWith(`.${suffix}`)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+23
-2
@@ -34,11 +34,15 @@ const isLikelyPluginSubFiles = (x: string) => {
|
|||||||
export const listFilesInObsFolder = async (
|
export const listFilesInObsFolder = async (
|
||||||
configDir: string,
|
configDir: string,
|
||||||
vault: Vault,
|
vault: Vault,
|
||||||
pluginId: string
|
pluginId: string,
|
||||||
|
bookmarksOnly: boolean
|
||||||
): Promise<Entity[]> => {
|
): Promise<Entity[]> => {
|
||||||
const q = new Queue([configDir]);
|
const q = new Queue([configDir]);
|
||||||
const CHUNK_SIZE = 10;
|
const CHUNK_SIZE = 10;
|
||||||
const contents: Entity[] = [];
|
let contents: Entity[] = [];
|
||||||
|
|
||||||
|
let iterRound = 0;
|
||||||
|
|
||||||
while (q.length > 0) {
|
while (q.length > 0) {
|
||||||
const itemsToFetch: string[] = [];
|
const itemsToFetch: string[] = [];
|
||||||
while (q.length > 0) {
|
while (q.length > 0) {
|
||||||
@@ -115,6 +119,23 @@ export const listFilesInObsFolder = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bookmarksOnly && iterRound > 1) {
|
||||||
|
// list until bookmarks.json is found or next level is arrived.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
iterRound += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// console.debug(`contents in obs config: ${JSON.stringify(contents)}`);
|
||||||
|
|
||||||
|
if (bookmarksOnly) {
|
||||||
|
contents = contents.filter(
|
||||||
|
(e) =>
|
||||||
|
e.key === `${configDir}/` || e.key === `${configDir}/bookmarks.json`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return contents;
|
return contents;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import type {
|
|||||||
import cloneDeep from "lodash/cloneDeep";
|
import cloneDeep from "lodash/cloneDeep";
|
||||||
import { generateAzureBlobStorageSettingsPart } from "../pro/src/settingsAzureBlobStorage";
|
import { generateAzureBlobStorageSettingsPart } from "../pro/src/settingsAzureBlobStorage";
|
||||||
import { generateBoxSettingsPart } from "../pro/src/settingsBox";
|
import { generateBoxSettingsPart } from "../pro/src/settingsBox";
|
||||||
|
import { generateClearDupFilesSettingsPart } from "../pro/src/settingsClearDupFiles";
|
||||||
import { generateGoogleDriveSettingsPart } from "../pro/src/settingsGoogleDrive";
|
import { generateGoogleDriveSettingsPart } from "../pro/src/settingsGoogleDrive";
|
||||||
import { generateKoofrSettingsPart } from "../pro/src/settingsKoofr";
|
import { generateKoofrSettingsPart } from "../pro/src/settingsKoofr";
|
||||||
import { generateOnedriveFullSettingsPart } from "../pro/src/settingsOnedriveFull";
|
import { generateOnedriveFullSettingsPart } from "../pro/src/settingsOnedriveFull";
|
||||||
@@ -1637,6 +1638,27 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
new Setting(webdavDiv)
|
||||||
|
.setName(t("settings_webdav_customheaders"))
|
||||||
|
.setDesc(stringToFragment(t("settings_webdav_customheaders_desc")))
|
||||||
|
.addTextArea((textArea) => {
|
||||||
|
textArea
|
||||||
|
.setPlaceholder(`X-Header1: Value1\nX-Header2: Value2`)
|
||||||
|
.setValue(`${this.plugin.settings.webdav.customHeaders ?? ""}`)
|
||||||
|
.onChange(async (value) => {
|
||||||
|
this.plugin.settings.webdav.customHeaders = value
|
||||||
|
.trim()
|
||||||
|
.split("\n")
|
||||||
|
.filter((x) => x.trim() !== "")
|
||||||
|
.join("\n");
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
});
|
||||||
|
textArea.inputEl.rows = 10;
|
||||||
|
textArea.inputEl.cols = 30;
|
||||||
|
|
||||||
|
textArea.inputEl.addClass("webdav-customheaders-textarea");
|
||||||
|
});
|
||||||
|
|
||||||
let newWebdavRemoteBaseDir =
|
let newWebdavRemoteBaseDir =
|
||||||
this.plugin.settings.webdav.remoteBaseDir || "";
|
this.plugin.settings.webdav.remoteBaseDir || "";
|
||||||
new Setting(webdavDiv)
|
new Setting(webdavDiv)
|
||||||
@@ -2303,6 +2325,27 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
new Setting(advDiv)
|
||||||
|
.setName(t("settings_bookmarks"))
|
||||||
|
.setDesc(
|
||||||
|
t("settings_bookmarks_desc", {
|
||||||
|
configDir: this.app.vault.configDir,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.addDropdown((dropdown) => {
|
||||||
|
dropdown.addOption("disable", t("disable"));
|
||||||
|
dropdown.addOption("enable", t("enable"));
|
||||||
|
|
||||||
|
dropdown
|
||||||
|
.setValue(
|
||||||
|
`${this.plugin.settings.syncBookmarks ? "enable" : "disable"}`
|
||||||
|
)
|
||||||
|
.onChange(async (val) => {
|
||||||
|
this.plugin.settings.syncBookmarks = val === "enable";
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
new Setting(advDiv)
|
new Setting(advDiv)
|
||||||
.setName(t("settings_deletetowhere"))
|
.setName(t("settings_deletetowhere"))
|
||||||
.setDesc(t("settings_deletetowhere_desc"))
|
.setDesc(t("settings_deletetowhere_desc"))
|
||||||
@@ -2359,6 +2402,8 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
generateClearDupFilesSettingsPart(advDiv, t, this.app, this.plugin);
|
||||||
|
|
||||||
const percentage1 = new Setting(advDiv)
|
const percentage1 = new Setting(advDiv)
|
||||||
.setName(t("settings_protectmodifypercentage"))
|
.setName(t("settings_protectmodifypercentage"))
|
||||||
.setDesc(t("settings_protectmodifypercentage_desc"));
|
.setDesc(t("settings_protectmodifypercentage_desc"));
|
||||||
@@ -2781,6 +2826,19 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
|
|||||||
new Notice(t("settings_syncplans_notice"));
|
new Notice(t("settings_syncplans_notice"));
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
.addButton(async (button) => {
|
||||||
|
button.setButtonText(t("settings_syncplans_button_5_only_change"));
|
||||||
|
button.onClick(async () => {
|
||||||
|
await exportVaultSyncPlansToFiles(
|
||||||
|
this.plugin.db,
|
||||||
|
this.app.vault,
|
||||||
|
this.plugin.vaultRandomID,
|
||||||
|
5,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
new Notice(t("settings_syncplans_notice"));
|
||||||
|
});
|
||||||
|
})
|
||||||
.addButton(async (button) => {
|
.addButton(async (button) => {
|
||||||
button.setButtonText(t("settings_syncplans_button_1"));
|
button.setButtonText(t("settings_syncplans_button_1"));
|
||||||
button.onClick(async () => {
|
button.onClick(async () => {
|
||||||
|
|||||||
@@ -88,6 +88,10 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.webdav-customheaders-textarea {
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
.webdis-disclaimer {
|
.webdis-disclaimer {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user