reduce hints

This commit is contained in:
fyears 2024-01-06 14:56:07 +08:00
parent 2d9ba514fa
commit cbf656c7b7
4 changed files with 72 additions and 15 deletions

View File

@ -18,6 +18,10 @@
"syncrun_step7": "7/8 Remotely Save Sync data exchanging!", "syncrun_step7": "7/8 Remotely Save Sync data exchanging!",
"syncrun_step7skip": "7/8 Remotely Save real sync is skipped in dry run mode.", "syncrun_step7skip": "7/8 Remotely Save real sync is skipped in dry run mode.",
"syncrun_step8": "8/8 Remotely Save finish!", "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}}", "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_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}}", "protocol_callbacknotsupported": "Your uri call a callback that's not supported yet: {{params}}",

View File

@ -18,6 +18,10 @@
"syncrun_step7": "7/8 Remotely Save 开始发生数据交换!", "syncrun_step7": "7/8 Remotely Save 开始发生数据交换!",
"syncrun_step7skip": "7/8 Remotely Save 在空跑模式,跳过实际数据交换步骤。", "syncrun_step7skip": "7/8 Remotely Save 在空跑模式,跳过实际数据交换步骤。",
"syncrun_step8": "8/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}}", "syncrun_abort": "{{manifestID}}-{{theDate}}:中断同步,同步来源={{triggerSource}},出错阶段={{syncStatus}}",
"protocol_saveqr": " {{manifestName}} 新的非 oauth2 设置保存完成。请重启插件设置页使之生效。", "protocol_saveqr": " {{manifestName}} 新的非 oauth2 设置保存完成。请重启插件设置页使之生效。",
"protocol_callbacknotsupported": "您的 uri callback 暂不支持: {{params}}", "protocol_callbacknotsupported": "您的 uri callback 暂不支持: {{params}}",

View File

@ -18,6 +18,10 @@
"syncrun_step7": "7/8 Remotely Save 開始發生資料交換!", "syncrun_step7": "7/8 Remotely Save 開始發生資料交換!",
"syncrun_step7skip": "7/8 Remotely Save 在空跑模式,跳過實際資料交換步驟。", "syncrun_step7skip": "7/8 Remotely Save 在空跑模式,跳過實際資料交換步驟。",
"syncrun_step8": "8/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}}", "syncrun_abort": "{{manifestID}}-{{theDate}}:中斷同步,同步來源={{triggerSource}},出錯階段={{syncStatus}}",
"protocol_saveqr": " {{manifestName}} 新的非 oauth2 設定儲存完成。請重啟外掛設定頁使之生效。", "protocol_saveqr": " {{manifestName}} 新的非 oauth2 設定儲存完成。請重啟外掛設定頁使之生效。",
"protocol_callbacknotsupported": "您的 uri callback 暫不支援: {{params}}", "protocol_callbacknotsupported": "您的 uri callback 暫不支援: {{params}}",

View File

@ -193,18 +193,35 @@ export default class RemotelySavePlugin extends Plugin {
} }
if (triggerSource === "dry") { if (triggerSource === "dry") {
if (this.settings.currLogLevel === "info") {
getNotice(t("syncrun_shortstep0"));
} else {
getNotice(t("syncrun_step0")); getNotice(t("syncrun_step0"));
} }
}
//log.info(`huh ${this.settings.password}`) //log.info(`huh ${this.settings.password}`)
if (this.settings.currLogLevel === "info") {
getNotice(
t("syncrun_shortstep1", {
serviceType: this.settings.serviceType,
})
);
} else {
getNotice( getNotice(
t("syncrun_step1", { t("syncrun_step1", {
serviceType: this.settings.serviceType, serviceType: this.settings.serviceType,
}) })
); );
}
this.syncStatus = "preparing"; this.syncStatus = "preparing";
if (this.settings.currLogLevel === "info") {
// pass
} else {
getNotice(t("syncrun_step2")); getNotice(t("syncrun_step2"));
}
this.syncStatus = "getting_remote_files_list"; this.syncStatus = "getting_remote_files_list";
const self = this; const self = this;
const client = new RemoteClient( const client = new RemoteClient(
@ -219,7 +236,11 @@ export default class RemotelySavePlugin extends Plugin {
const remoteRsp = await client.listFromRemote(); const remoteRsp = await client.listFromRemote();
// log.debug(remoteRsp); // log.debug(remoteRsp);
if (this.settings.currLogLevel === "info") {
// pass
} else {
getNotice(t("syncrun_step3")); getNotice(t("syncrun_step3"));
}
this.syncStatus = "checking_password"; this.syncStatus = "checking_password";
const passwordCheckResult = await isPasswordOk( const passwordCheckResult = await isPasswordOk(
remoteRsp.Contents, remoteRsp.Contents,
@ -230,7 +251,11 @@ export default class RemotelySavePlugin extends Plugin {
throw Error(passwordCheckResult.reason); throw Error(passwordCheckResult.reason);
} }
if (this.settings.currLogLevel === "info") {
// pass
} else {
getNotice(t("syncrun_step4")); getNotice(t("syncrun_step4"));
}
this.syncStatus = "getting_remote_extra_meta"; this.syncStatus = "getting_remote_extra_meta";
const { remoteStates, metadataFile } = await parseRemoteItems( const { remoteStates, metadataFile } = await parseRemoteItems(
remoteRsp.Contents, remoteRsp.Contents,
@ -246,7 +271,11 @@ export default class RemotelySavePlugin extends Plugin {
this.settings.password this.settings.password
); );
if (this.settings.currLogLevel === "info") {
// pass
} else {
getNotice(t("syncrun_step5")); getNotice(t("syncrun_step5"));
}
this.syncStatus = "getting_local_meta"; this.syncStatus = "getting_local_meta";
const local = this.app.vault.getAllLoadedFiles(); const local = this.app.vault.getAllLoadedFiles();
const localHistory = await loadFileHistoryTableByVault( const localHistory = await loadFileHistoryTableByVault(
@ -264,7 +293,11 @@ export default class RemotelySavePlugin extends Plugin {
// log.info(local); // log.info(local);
// log.info(localHistory); // log.info(localHistory);
if (this.settings.currLogLevel === "info") {
// pass
} else {
getNotice(t("syncrun_step6")); getNotice(t("syncrun_step6"));
}
this.syncStatus = "generating_plan"; this.syncStatus = "generating_plan";
const { plan, sortedKeys, deletions, sizesGoWrong } = await getSyncPlan( const { plan, sortedKeys, deletions, sizesGoWrong } = await getSyncPlan(
remoteStates, remoteStates,
@ -289,8 +322,11 @@ export default class RemotelySavePlugin extends Plugin {
// The operations below begins to write or delete (!!!) something. // The operations below begins to write or delete (!!!) something.
if (triggerSource !== "dry") { if (triggerSource !== "dry") {
if (this.settings.currLogLevel === "info") {
// pass
} else {
getNotice(t("syncrun_step7")); getNotice(t("syncrun_step7"));
}
this.syncStatus = "syncing"; this.syncStatus = "syncing";
await doActualSync( await doActualSync(
client, client,
@ -320,10 +356,19 @@ export default class RemotelySavePlugin extends Plugin {
); );
} else { } else {
this.syncStatus = "syncing"; this.syncStatus = "syncing";
if (this.settings.currLogLevel === "info") {
getNotice(t("syncrun_shortstep2skip"));
} else {
getNotice(t("syncrun_step7skip")); 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 = "finish";
this.syncStatus = "idle"; this.syncStatus = "idle";