diff --git a/src/langs/en.json b/src/langs/en.json index b71dd5e..4c382fe 100644 --- a/src/langs/en.json +++ b/src/langs/en.json @@ -18,6 +18,10 @@ "syncrun_step7": "7/8 Remotely Save Sync data exchanging!", "syncrun_step7skip": "7/8 Remotely Save real sync is skipped in dry run mode.", "syncrun_step8": "8/8 Remotely Save finish!", + "syncrun_shortstep0": "0/2 Remotely Save running in dry mode, not actual file changes would happen.", + "syncrun_shortstep1": "1/2 Remotely Save Sync Start Running ({{serviceType}})", + "syncrun_shortstep2skip": "2/2 Remotely Save real sync is skipped in dry run mode.", + "syncrun_shortstep2": "2/2 Remotely Save finish!", "syncrun_abort": "{{manifestID}}-{{theDate}}: abort sync, triggerSource={{triggerSource}}, error while {{syncStatus}}", "protocol_saveqr": "New not-oauth2 settings for {{manifestName}} saved. Reopen the plugin Settings to the effect.", "protocol_callbacknotsupported": "Your uri call a callback that's not supported yet: {{params}}", diff --git a/src/langs/zh_cn.json b/src/langs/zh_cn.json index 33f52a0..2354a18 100644 --- a/src/langs/zh_cn.json +++ b/src/langs/zh_cn.json @@ -18,6 +18,10 @@ "syncrun_step7": "7/8 Remotely Save 开始发生数据交换!", "syncrun_step7skip": "7/8 Remotely Save 在空跑模式,跳过实际数据交换步骤。", "syncrun_step8": "8/8 Remotely Save 已完成同步!", + "syncrun_shortstep0": "0/2 Remotely Save 在空跑(dry run)模式,不会发生实际的文件交换。", + "syncrun_shortstep1": "1/2 Remotely Save 开始同步({{serviceType}})", + "syncrun_shortstep2skip": "2/2 Remotely Save 在空跑模式,跳过实际数据交换步骤。", + "syncrun_shortstep2": "2/2 Remotely Save 已完成同步!", "syncrun_abort": "{{manifestID}}-{{theDate}}:中断同步,同步来源={{triggerSource}},出错阶段={{syncStatus}}", "protocol_saveqr": " {{manifestName}} 新的非 oauth2 设置保存完成。请重启插件设置页使之生效。", "protocol_callbacknotsupported": "您的 uri callback 暂不支持: {{params}}", diff --git a/src/langs/zh_tw.json b/src/langs/zh_tw.json index 85f9618..01421a3 100644 --- a/src/langs/zh_tw.json +++ b/src/langs/zh_tw.json @@ -18,6 +18,10 @@ "syncrun_step7": "7/8 Remotely Save 開始發生資料交換!", "syncrun_step7skip": "7/8 Remotely Save 在空跑模式,跳過實際資料交換步驟。", "syncrun_step8": "8/8 Remotely Save 已完成同步!", + "syncrun_shortstep0": "0/2 Remotely Save 在空跑(dry run)模式,不會發生實際的檔案交換。", + "syncrun_shortstep1": "1/2 Remotely Save 開始同步({{serviceType}})", + "syncrun_shortstep2skip": "2/2 Remotely Save 在空跑模式,跳過實際資料交換步驟。", + "syncrun_shortstep2": "2/2 Remotely Save 已完成同步!", "syncrun_abort": "{{manifestID}}-{{theDate}}:中斷同步,同步來源={{triggerSource}},出錯階段={{syncStatus}}", "protocol_saveqr": " {{manifestName}} 新的非 oauth2 設定儲存完成。請重啟外掛設定頁使之生效。", "protocol_callbacknotsupported": "您的 uri callback 暫不支援: {{params}}", diff --git a/src/main.ts b/src/main.ts index 0a49af1..204d9a9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -193,18 +193,35 @@ export default class RemotelySavePlugin extends Plugin { } if (triggerSource === "dry") { - getNotice(t("syncrun_step0")); + if (this.settings.currLogLevel === "info") { + getNotice(t("syncrun_shortstep0")); + } else { + getNotice(t("syncrun_step0")); + } } //log.info(`huh ${this.settings.password}`) - getNotice( - t("syncrun_step1", { - serviceType: this.settings.serviceType, - }) - ); + if (this.settings.currLogLevel === "info") { + getNotice( + t("syncrun_shortstep1", { + serviceType: this.settings.serviceType, + }) + ); + } else { + getNotice( + t("syncrun_step1", { + serviceType: this.settings.serviceType, + }) + ); + } + this.syncStatus = "preparing"; - getNotice(t("syncrun_step2")); + if (this.settings.currLogLevel === "info") { + // pass + } else { + getNotice(t("syncrun_step2")); + } this.syncStatus = "getting_remote_files_list"; const self = this; const client = new RemoteClient( @@ -219,7 +236,11 @@ export default class RemotelySavePlugin extends Plugin { const remoteRsp = await client.listFromRemote(); // log.debug(remoteRsp); - getNotice(t("syncrun_step3")); + if (this.settings.currLogLevel === "info") { + // pass + } else { + getNotice(t("syncrun_step3")); + } this.syncStatus = "checking_password"; const passwordCheckResult = await isPasswordOk( remoteRsp.Contents, @@ -230,7 +251,11 @@ export default class RemotelySavePlugin extends Plugin { throw Error(passwordCheckResult.reason); } - getNotice(t("syncrun_step4")); + if (this.settings.currLogLevel === "info") { + // pass + } else { + getNotice(t("syncrun_step4")); + } this.syncStatus = "getting_remote_extra_meta"; const { remoteStates, metadataFile } = await parseRemoteItems( remoteRsp.Contents, @@ -246,7 +271,11 @@ export default class RemotelySavePlugin extends Plugin { this.settings.password ); - getNotice(t("syncrun_step5")); + if (this.settings.currLogLevel === "info") { + // pass + } else { + getNotice(t("syncrun_step5")); + } this.syncStatus = "getting_local_meta"; const local = this.app.vault.getAllLoadedFiles(); const localHistory = await loadFileHistoryTableByVault( @@ -264,7 +293,11 @@ export default class RemotelySavePlugin extends Plugin { // log.info(local); // log.info(localHistory); - getNotice(t("syncrun_step6")); + if (this.settings.currLogLevel === "info") { + // pass + } else { + getNotice(t("syncrun_step6")); + } this.syncStatus = "generating_plan"; const { plan, sortedKeys, deletions, sizesGoWrong } = await getSyncPlan( remoteStates, @@ -289,8 +322,11 @@ export default class RemotelySavePlugin extends Plugin { // The operations below begins to write or delete (!!!) something. if (triggerSource !== "dry") { - getNotice(t("syncrun_step7")); - + if (this.settings.currLogLevel === "info") { + // pass + } else { + getNotice(t("syncrun_step7")); + } this.syncStatus = "syncing"; await doActualSync( client, @@ -320,10 +356,19 @@ export default class RemotelySavePlugin extends Plugin { ); } else { this.syncStatus = "syncing"; - getNotice(t("syncrun_step7skip")); + if (this.settings.currLogLevel === "info") { + getNotice(t("syncrun_shortstep2skip")); + } else { + getNotice(t("syncrun_step7skip")); + } + } + + if (this.settings.currLogLevel === "info") { + getNotice(t("syncrun_shortstep2")); + } else { + getNotice(t("syncrun_step8")); } - getNotice(t("syncrun_step8")); this.syncStatus = "finish"; this.syncStatus = "idle";