Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2645ff34e6 | ||
|
|
f25a2c2992 | ||
|
|
3d1269a9f2 | ||
|
|
ed52a8542f | ||
|
|
757eb5c801 | ||
|
|
048e7b6251 | ||
|
|
b762052da3 | ||
|
|
c61efd1367 | ||
|
|
605bffa471 | ||
|
|
895e3db4c6 | ||
|
|
ce1990a35f |
@@ -0,0 +1,43 @@
|
|||||||
|
name: "CLA Assistant"
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened,closed,synchronize]
|
||||||
|
|
||||||
|
# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings
|
||||||
|
permissions:
|
||||||
|
actions: write
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
statuses: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
CLAAssistant:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: "CLA Assistant"
|
||||||
|
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||||
|
uses: contributor-assistant/github-action@v2.3.0
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# the below token should have repo scope and must be manually added by you in the repository's secret
|
||||||
|
# This token is required only if you have configured to store the signatures in a remote repository/organization
|
||||||
|
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||||
|
with:
|
||||||
|
path-to-signatures: 'signatures/version1/cla.json'
|
||||||
|
path-to-document: 'https://github.com/remotely-save/remotely-save/blob/master/CLA.md' # e.g. a CLA or a DCO document
|
||||||
|
# branch should not be protected
|
||||||
|
branch: 'main'
|
||||||
|
allowlist: bot*
|
||||||
|
|
||||||
|
# the followings are the optional inputs - If the optional inputs are not given, then default values will be taken
|
||||||
|
remote-organization-name: remotely-save
|
||||||
|
remote-repository-name: cla-signed
|
||||||
|
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
|
||||||
|
#signed-commit-message: 'For example: $contributorName has signed the CLA in $owner/$repo#$pullRequestNo'
|
||||||
|
custom-notsigned-prcomment: '<br/>Thank you for your submission, we really appreciate it. However, we ask that $you sign our [Contributor License Agreement](https://github.com/remotely-save/remotely-save/blob/master/CLA.md) before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.<br/>'
|
||||||
|
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
|
||||||
|
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
|
||||||
|
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
|
||||||
|
#use-dco-flag: true - If you are using DCO instead of CLA
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
In order to clarify the intellectual property license granted with Contributions from any person or entity, Remotely Save dev team ("Remotely Save") must have on file a signed Contributor License Agreement ("CLA") from each Contributor, indicating agreement with the license terms below. This agreement is for your protection as a Contributor as well as the protection of Remotely Save and its users. It does not change your rights to use your own Contributions for any other purpose.
|
||||||
|
|
||||||
|
You accept and agree to the following terms and conditions for Your Contributions (present and future) that you submit to Remotely Save. Except for the license granted herein to Remotely Save and recipients of software distributed by Remotely Save, You reserve all right, title, and interest in and to Your Contributions.
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Remotely Save. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Remotely Save for inclusion in, or documentation of, any of the products owned or managed by Remotely Save (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Remotely Save or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Remotely Save for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to Remotely Save and to recipients of software distributed by Remotely Save a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to Remotely Save and to recipients of software distributed by Remotely Save a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to Remotely Save, or that your employer has executed a separate Corporate CLA with Remotely Save.
|
||||||
|
|
||||||
|
5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.
|
||||||
|
|
||||||
|
6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
7. Should You wish to submit work that is not Your original creation, You may submit it to Remotely Save separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
|
||||||
|
|
||||||
|
8. You agree to notify Remotely Save of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
## What
|
||||||
|
|
||||||
|
Starting from April 29, 2024, all individual contributors' contributions are only possibly accepted after they sign the CLA.
|
||||||
|
|
||||||
|
We do not accept corporate contributions at this moment.
|
||||||
|
|
||||||
|
You can check out [CLA](./CLA.md).
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
1. Make some changes to the code. Open a pull request.
|
||||||
|
2. A rebot will check the status.
|
||||||
|

|
||||||
|
3. Read the [CLA](./CLA.md) carefully and make a decision.
|
||||||
|
4. If you decide to sign the CLA, please make a comment "I have read the CLA Document and I hereby sign the CLA".
|
||||||
|
5. If you decide to not sign the CLA, please close the PR.
|
||||||
|
6. The robot should recheck and pass the check automatically.
|
||||||
|

|
||||||
|
7. Your pr will be reviewed.
|
||||||
|
8. If you sign the CLA and submit some more PRs, the robot should pass the test automatically.
|
||||||
@@ -21,6 +21,7 @@ This is yet another unofficial sync plugin for Obsidian. If you like it or find
|
|||||||
- Dropbox
|
- Dropbox
|
||||||
- OneDrive for personal
|
- OneDrive for personal
|
||||||
- Webdav
|
- Webdav
|
||||||
|
- Webdis
|
||||||
- [Here](./docs/services_connectable_or_not.md) shows more connectable (or not-connectable) services in details.
|
- [Here](./docs/services_connectable_or_not.md) shows more connectable (or not-connectable) services in details.
|
||||||
- **Obsidian Mobile supported.** Vaults can be synced across mobile and desktop devices with the cloud service as the "broker".
|
- **Obsidian Mobile supported.** Vaults can be synced across mobile and desktop devices with the cloud service as the "broker".
|
||||||
- **[End-to-end encryption](./docs/encryption/README.md) supported.** Files would be encrypted using openssl format before being sent to the cloud **if** user specify a password.
|
- **[End-to-end encryption](./docs/encryption/README.md) supported.** Files would be encrypted using openssl format before being sent to the cloud **if** user specify a password.
|
||||||
@@ -67,11 +68,12 @@ Additionally, the plugin author may occasionally visit Obsidian official forum a
|
|||||||
- [腾讯云 COS](./docs/remote_services/s3_tencent_cloud_cos/README.zh-cn.md) | [Tencent Cloud COS](./docs/remote_services/s3_tencent_cloud_cos/README.md)
|
- [腾讯云 COS](./docs/remote_services/s3_tencent_cloud_cos/README.zh-cn.md) | [Tencent Cloud COS](./docs/remote_services/s3_tencent_cloud_cos/README.md)
|
||||||
- [MinIO](./docs/remote_services/s3_minio/README.md)
|
- [MinIO](./docs/remote_services/s3_minio/README.md)
|
||||||
- [又拍云](./docs/remote_services/s3_upyun/README.zh-cn.md)
|
- [又拍云](./docs/remote_services/s3_upyun/README.zh-cn.md)
|
||||||
- Prepare your S3 (-compatible) service information: [endpoint, region](https://docs.aws.amazon.com/general/latest/gr/s3.html), [access key id, secret access key](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/getting-your-credentials.html), bucket name. The bucket should be empty and solely for syncing a vault.
|
- Prepare your S3 (-compatible) service information: [endpoint, region](https://docs.aws.amazon.com/general/latest/gr/s3.html), [access key id, secret access key](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/getting-your-credentials.html), bucket name.
|
||||||
- If you are using AWS S3, create [policy and user](./docs/remote_services/s3_general/s3_user_policy.md).
|
- If you are using AWS S3, create [policy and user](./docs/remote_services/s3_general/s3_user_policy.md).
|
||||||
- Very old version of Obsidian needs [configuring CORS](./docs/remote_services/s3_general/s3_cors_configure.md).
|
- Very old version of Obsidian needs [configuring CORS](./docs/remote_services/s3_general/s3_cors_configure.md).
|
||||||
- Download and enable this plugin.
|
- Download and enable this plugin.
|
||||||
- Enter your information to the settings of this plugin.
|
- Enter your information to the settings of this plugin.
|
||||||
|
- If you do not set the prefix in the settings, the bucket should be empty and solely for syncing a vault. You can set the prefix in the settings so that the same bucket can store multiple vaults.
|
||||||
- If you want to enable end-to-end encryption, also set a password in settings. If you do not specify a password, the files and folders are synced in plain, original content to the cloud.
|
- If you want to enable end-to-end encryption, also set a password in settings. If you do not specify a password, the files and folders are synced in plain, original content to the cloud.
|
||||||
- Click the new "circle arrow" icon on the ribbon (the left sidebar), **every time** you want to sync your vault between local and remote. (Or, you could configure auto sync in the settings panel (See next chapter).) While syncing, the icon becomes "two half-circle arrows". Besides clicking the icon on the sidebar ribbon, you can also activate the corresponding command in the command palette.
|
- Click the new "circle arrow" icon on the ribbon (the left sidebar), **every time** you want to sync your vault between local and remote. (Or, you could configure auto sync in the settings panel (See next chapter).) While syncing, the icon becomes "two half-circle arrows". Besides clicking the icon on the sidebar ribbon, you can also activate the corresponding command in the command palette.
|
||||||
- **Be patient while syncing.** Especially in the first-time sync.
|
- **Be patient while syncing.** Especially in the first-time sync.
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:07fd075d0f73c708d77fd97bb31d6f185f094031e8275e8fd582e3a0145f6be8
|
||||||
|
size 415757
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:4c5754df8b5d6878a7fa58992fc7e37ddcce1ecf578a0fc2ec751b6f7bab6f13
|
||||||
|
size 284700
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "remotely-save",
|
"id": "remotely-save",
|
||||||
"name": "Remotely Save",
|
"name": "Remotely Save",
|
||||||
"version": "0.4.19",
|
"version": "0.4.20",
|
||||||
"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.4.19",
|
"version": "0.4.20",
|
||||||
"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,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "remotely-save",
|
"name": "remotely-save",
|
||||||
"version": "0.4.19",
|
"version": "0.4.20",
|
||||||
"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",
|
||||||
|
|||||||
+13
-11
@@ -4,14 +4,14 @@ import { FakeFs } from "./fsAll";
|
|||||||
import { TFile, TFolder, type Vault } from "obsidian";
|
import { TFile, TFolder, type Vault } from "obsidian";
|
||||||
import { listFilesInObsFolder } from "./obsFolderLister";
|
import { listFilesInObsFolder } from "./obsFolderLister";
|
||||||
import { Profiler } from "./profiler";
|
import { Profiler } from "./profiler";
|
||||||
import { getFolderLevels, mkdirpInVault, statFix } from "./misc";
|
import { getFolderLevels, mkdirpInVault, statFix, unixTimeToStr } from "./misc";
|
||||||
|
|
||||||
export class FakeFsLocal extends FakeFs {
|
export class FakeFsLocal extends FakeFs {
|
||||||
vault: Vault;
|
vault: Vault;
|
||||||
syncConfigDir: boolean;
|
syncConfigDir: boolean;
|
||||||
configDir: string;
|
configDir: string;
|
||||||
pluginID: string;
|
pluginID: string;
|
||||||
profiler: Profiler;
|
profiler: Profiler | undefined;
|
||||||
deleteToWhere: "obsidian" | "system";
|
deleteToWhere: "obsidian" | "system";
|
||||||
kind: "local";
|
kind: "local";
|
||||||
constructor(
|
constructor(
|
||||||
@@ -19,7 +19,7 @@ export class FakeFsLocal extends FakeFs {
|
|||||||
syncConfigDir: boolean,
|
syncConfigDir: boolean,
|
||||||
configDir: string,
|
configDir: string,
|
||||||
pluginID: string,
|
pluginID: string,
|
||||||
profiler: Profiler,
|
profiler: Profiler | undefined,
|
||||||
deleteToWhere: "obsidian" | "system"
|
deleteToWhere: "obsidian" | "system"
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
@@ -34,12 +34,12 @@ export class FakeFsLocal extends FakeFs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async walk(): Promise<Entity[]> {
|
async walk(): Promise<Entity[]> {
|
||||||
this.profiler.addIndent();
|
this.profiler?.addIndent();
|
||||||
this.profiler.insert("enter walk for local");
|
this.profiler?.insert("enter walk for local");
|
||||||
const local: Entity[] = [];
|
const local: Entity[] = [];
|
||||||
|
|
||||||
const localTAbstractFiles = this.vault.getAllLoadedFiles();
|
const localTAbstractFiles = this.vault.getAllLoadedFiles();
|
||||||
this.profiler.insert("finish getting walk for local");
|
this.profiler?.insert("finish getting walk for local");
|
||||||
for (const entry of localTAbstractFiles) {
|
for (const entry of localTAbstractFiles) {
|
||||||
let r: Entity | undefined = undefined;
|
let r: Entity | undefined = undefined;
|
||||||
let key = entry.path;
|
let key = entry.path;
|
||||||
@@ -89,10 +89,10 @@ 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.profiler.insert("into syncConfigDir");
|
this.profiler?.insert("into syncConfigDir");
|
||||||
const syncFiles = await listFilesInObsFolder(
|
const syncFiles = await listFilesInObsFolder(
|
||||||
this.configDir,
|
this.configDir,
|
||||||
this.vault,
|
this.vault,
|
||||||
@@ -101,11 +101,11 @@ export class FakeFsLocal extends FakeFs {
|
|||||||
for (const f of syncFiles) {
|
for (const f of syncFiles) {
|
||||||
local.push(f);
|
local.push(f);
|
||||||
}
|
}
|
||||||
this.profiler.insert("finish syncConfigDir");
|
this.profiler?.insert("finish syncConfigDir");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.profiler.insert("finish walk for local");
|
this.profiler?.insert("finish walk for local");
|
||||||
this.profiler.removeIndent();
|
this.profiler?.removeIndent();
|
||||||
return local;
|
return local;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,6 +120,8 @@ export class FakeFsLocal extends FakeFs {
|
|||||||
keyRaw: isFolder ? `${key}/` : key,
|
keyRaw: isFolder ? `${key}/` : key,
|
||||||
mtimeCli: statRes.mtime,
|
mtimeCli: statRes.mtime,
|
||||||
mtimeSvr: statRes.mtime,
|
mtimeSvr: statRes.mtime,
|
||||||
|
mtimeCliFmt: unixTimeToStr(statRes.mtime),
|
||||||
|
mtimeSvrFmt: unixTimeToStr(statRes.mtime),
|
||||||
size: statRes.size, // local always unencrypted
|
size: statRes.size, // local always unencrypted
|
||||||
sizeRaw: statRes.size,
|
sizeRaw: statRes.size,
|
||||||
};
|
};
|
||||||
|
|||||||
+9
-3
@@ -340,13 +340,14 @@ const fromS3ObjectToEntity = (
|
|||||||
const fromS3HeadObjectToEntity = (
|
const fromS3HeadObjectToEntity = (
|
||||||
fileOrFolderPathWithRemotePrefix: string,
|
fileOrFolderPathWithRemotePrefix: string,
|
||||||
x: HeadObjectCommandOutput,
|
x: HeadObjectCommandOutput,
|
||||||
remotePrefix: string
|
remotePrefix: string,
|
||||||
|
useAccurateMTime: boolean
|
||||||
) => {
|
) => {
|
||||||
// console.debug(`fromS3HeadObjectToEntity: ${fileOrFolderPathWithRemotePrefix}: ${JSON.stringify(x,null,2)}`);
|
// console.debug(`fromS3HeadObjectToEntity: ${fileOrFolderPathWithRemotePrefix}: ${JSON.stringify(x,null,2)}`);
|
||||||
// S3 officially only supports seconds precision!!!!!
|
// S3 officially only supports seconds precision!!!!!
|
||||||
const mtimeSvr = Math.floor(x.LastModified!.valueOf() / 1000.0) * 1000;
|
const mtimeSvr = Math.floor(x.LastModified!.valueOf() / 1000.0) * 1000;
|
||||||
let mtimeCli = mtimeSvr;
|
let mtimeCli = mtimeSvr;
|
||||||
if (x.Metadata !== undefined) {
|
if (useAccurateMTime && x.Metadata !== undefined) {
|
||||||
const m2 = Math.floor(
|
const m2 = Math.floor(
|
||||||
parseFloat(x.Metadata.mtime || x.Metadata.MTime || "0")
|
parseFloat(x.Metadata.mtime || x.Metadata.MTime || "0")
|
||||||
);
|
);
|
||||||
@@ -561,7 +562,12 @@ export class FakeFsS3 extends FakeFs {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
return fromS3HeadObjectToEntity(key, res, this.s3Config.remotePrefix ?? "");
|
return fromS3HeadObjectToEntity(
|
||||||
|
key,
|
||||||
|
res,
|
||||||
|
this.s3Config.remotePrefix ?? "",
|
||||||
|
this.s3Config.useAccurateMTime ?? false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async mkdir(key: string, mtime?: number, ctime?: number): Promise<Entity> {
|
async mkdir(key: string, mtime?: number, ctime?: number): Promise<Entity> {
|
||||||
|
|||||||
+4
-2
@@ -50,7 +50,7 @@
|
|||||||
"statusbar_time_days": "Synced {{time}} days ago",
|
"statusbar_time_days": "Synced {{time}} days ago",
|
||||||
"statusbar_time_hours": "Synced {{time}} hours ago",
|
"statusbar_time_hours": "Synced {{time}} hours ago",
|
||||||
"statusbar_time_minutes": "Synced {{time}} minutes ago",
|
"statusbar_time_minutes": "Synced {{time}} minutes ago",
|
||||||
"statusbar_time_lessminute": "Synced less than a minute ago",
|
"statusbar_time_lessminute": "Synced last minute ago",
|
||||||
"statusbar_lastsync": "Synced {{time}} ago",
|
"statusbar_lastsync": "Synced {{time}} ago",
|
||||||
"statusbar_syncing": "Syncing...",
|
"statusbar_syncing": "Syncing...",
|
||||||
"statusbar_now": "Synced just now",
|
"statusbar_now": "Synced just now",
|
||||||
@@ -342,5 +342,7 @@
|
|||||||
"syncalgov3_checkbox_manual_backup": "I will backup my vault manually firstly.",
|
"syncalgov3_checkbox_manual_backup": "I will backup my vault manually firstly.",
|
||||||
"syncalgov3_checkbox_requiremultidevupdate": "I understand I need to update the plugin ACROSS ALL DEVICES to make them work properly.",
|
"syncalgov3_checkbox_requiremultidevupdate": "I understand I need to update the plugin ACROSS ALL DEVICES to make them work properly.",
|
||||||
"syncalgov3_button_agree": "Agree",
|
"syncalgov3_button_agree": "Agree",
|
||||||
"syncalgov3_button_disagree": "Do Not Agree"
|
"syncalgov3_button_disagree": "Do Not Agree",
|
||||||
|
|
||||||
|
"menu_check_file_stat": "Check file stats"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -341,5 +341,7 @@
|
|||||||
"syncalgov3_checkbox_manual_backup": "我将会首先手动备份我的库(Vault)。",
|
"syncalgov3_checkbox_manual_backup": "我将会首先手动备份我的库(Vault)。",
|
||||||
"syncalgov3_checkbox_requiremultidevupdate": "我理解,我需要在所有设备上都更新此插件使之正常运行。",
|
"syncalgov3_checkbox_requiremultidevupdate": "我理解,我需要在所有设备上都更新此插件使之正常运行。",
|
||||||
"syncalgov3_button_agree": "同意",
|
"syncalgov3_button_agree": "同意",
|
||||||
"syncalgov3_button_disagree": "不同意"
|
"syncalgov3_button_disagree": "不同意",
|
||||||
|
|
||||||
|
"menu_check_file_stat": "查看文件属性"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -340,5 +340,7 @@
|
|||||||
"syncalgov3_checkbox_manual_backup": "我將會首先手動備份我的庫(Vault)。",
|
"syncalgov3_checkbox_manual_backup": "我將會首先手動備份我的庫(Vault)。",
|
||||||
"syncalgov3_checkbox_requiremultidevupdate": "我理解,我需要在所有裝置上都更新此外掛使之正常執行。",
|
"syncalgov3_checkbox_requiremultidevupdate": "我理解,我需要在所有裝置上都更新此外掛使之正常執行。",
|
||||||
"syncalgov3_button_agree": "同意",
|
"syncalgov3_button_agree": "同意",
|
||||||
"syncalgov3_button_disagree": "不同意"
|
"syncalgov3_button_disagree": "不同意",
|
||||||
|
|
||||||
|
"menu_check_file_stat": "檢視檔案屬性"
|
||||||
}
|
}
|
||||||
|
|||||||
+38
@@ -9,6 +9,7 @@ import {
|
|||||||
Platform,
|
Platform,
|
||||||
requireApiVersion,
|
requireApiVersion,
|
||||||
Events,
|
Events,
|
||||||
|
TFolder,
|
||||||
} from "obsidian";
|
} from "obsidian";
|
||||||
import cloneDeep from "lodash/cloneDeep";
|
import cloneDeep from "lodash/cloneDeep";
|
||||||
import { createElement, RotateCcw, RefreshCcw, FileText } from "lucide";
|
import { createElement, RotateCcw, RefreshCcw, FileText } from "lucide";
|
||||||
@@ -783,6 +784,8 @@ export default class RemotelySavePlugin extends Plugin {
|
|||||||
// console.info("click", evt);
|
// console.info("click", evt);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
this.enableCheckingFileStat();
|
||||||
|
|
||||||
if (!this.settings.agreeToUseSyncV3) {
|
if (!this.settings.agreeToUseSyncV3) {
|
||||||
const syncAlgoV3Modal = new SyncAlgoV3Modal(this.app, this);
|
const syncAlgoV3Modal = new SyncAlgoV3Modal(this.app, this);
|
||||||
syncAlgoV3Modal.open();
|
syncAlgoV3Modal.open();
|
||||||
@@ -1198,6 +1201,41 @@ export default class RemotelySavePlugin extends Plugin {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enableCheckingFileStat() {
|
||||||
|
this.app.workspace.onLayoutReady(() => {
|
||||||
|
const t = (x: TransItemType, vars?: any) => {
|
||||||
|
return this.i18n.t(x, vars);
|
||||||
|
};
|
||||||
|
this.registerEvent(
|
||||||
|
this.app.workspace.on("file-menu", (menu, file) => {
|
||||||
|
if (file instanceof TFolder) {
|
||||||
|
// folder not supported yet
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
menu.addItem((item) => {
|
||||||
|
item
|
||||||
|
.setTitle(t("menu_check_file_stat"))
|
||||||
|
.setIcon("file-cog")
|
||||||
|
.onClick(async () => {
|
||||||
|
const filePath = file.path;
|
||||||
|
const fsLocal = new FakeFsLocal(
|
||||||
|
this.app.vault,
|
||||||
|
this.settings.syncConfigDir ?? false,
|
||||||
|
this.app.vault.configDir,
|
||||||
|
this.manifest.id,
|
||||||
|
undefined,
|
||||||
|
this.settings.deleteToWhere ?? "system"
|
||||||
|
);
|
||||||
|
const s = await fsLocal.stat(filePath);
|
||||||
|
new Notice(JSON.stringify(s, null, 2), 10000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async saveAgreeToUseNewSyncAlgorithm() {
|
async saveAgreeToUseNewSyncAlgorithm() {
|
||||||
this.settings.agreeToUseSyncV3 = true;
|
this.settings.agreeToUseSyncV3 = true;
|
||||||
await this.saveSettings();
|
await this.saveSettings();
|
||||||
|
|||||||
+2
-2
@@ -1370,8 +1370,8 @@ export async function syncer(
|
|||||||
settings.syncDirection ?? "bidirectional",
|
settings.syncDirection ?? "bidirectional",
|
||||||
profiler
|
profiler
|
||||||
);
|
);
|
||||||
console.info(`mixedEntityMappings:`);
|
console.debug(`mixedEntityMappings:`);
|
||||||
console.info(mixedEntityMappings); // for debugging
|
console.debug(mixedEntityMappings); // for debugging
|
||||||
profiler.insert("finish building full sync plan");
|
profiler.insert("finish building full sync plan");
|
||||||
|
|
||||||
await insertSyncPlanRecordByVault(
|
await insertSyncPlanRecordByVault(
|
||||||
|
|||||||
Reference in New Issue
Block a user