Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-06-11 23:27:25 +08:00
commit 3579a45831
11 changed files with 48 additions and 0 deletions

View file

@ -307,6 +307,14 @@ export const repos = {
<option value="3" ${window.siyuan.config.sync.mode === 3 ? "selected" : ""}>${window.siyuan.languages.syncMode3}</option>
</select>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.syncPerception}
<div class="b3-label__text">${window.siyuan.languages.syncPerceptionTip}</div>
</div>
<span class="fn__space"></span>
<input type="checkbox" id="syncPerception"${window.siyuan.config.sync.perception ? " checked='checked'" : ""} class="b3-switch fn__flex-center">
</label>
<div class="b3-label">
<label class="fn__flex config__item">
<div class="fn__flex-center">${window.siyuan.languages.cloudSyncDir}</div>
@ -337,6 +345,13 @@ export const repos = {
processSync();
});
});
const syncPerceptionElement = repos.element.querySelector("#syncPerception") as HTMLInputElement;
syncPerceptionElement.addEventListener("change", () => {
fetchPost("/api/sync/setSyncPerception", {enabled: syncPerceptionElement.checked}, () => {
window.siyuan.config.sync.perception = syncPerceptionElement.checked;
processSync();
});
});
const switchConflictElement = repos.element.querySelector("#generateConflictDoc") as HTMLInputElement;
switchConflictElement.addEventListener("change", () => {
fetchPost("/api/sync/setSyncGenerateConflictDoc", {enabled: switchConflictElement.checked}, () => {

View file

@ -519,6 +519,7 @@ interface IConfig {
sync: {
generateConflictDoc: boolean
enabled: boolean
perception: boolean
mode: number
synced: number
stat: string