mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-15 03:28:07 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
f821e0284b
11 changed files with 77 additions and 0 deletions
|
|
@ -325,6 +325,17 @@ ${passwordHTML}
|
|||
<span class="fn__space"></span>
|
||||
<input type="checkbox" id="reposCloudSyncSwitch"${window.siyuan.config.sync.enabled ? " checked='checked'" : ""} class="b3-switch fn__flex-center">
|
||||
</label>
|
||||
<label class="fn__flex b3-label">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.syncMode}
|
||||
<div class="b3-label__text">${window.siyuan.languages.syncModeTip}</div>
|
||||
</div>
|
||||
<span class="fn__space"></span>
|
||||
<select id="syncMode" class="b3-select fn__flex-center fn__size200">
|
||||
<option value="1" ${window.siyuan.config.sync.mode === 1 ? "selected" : ""}>${window.siyuan.languages.syncMode1}</option>
|
||||
<option value="2" ${window.siyuan.config.sync.mode === 2 ? "selected" : ""}>${window.siyuan.languages.syncMode2}</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="b3-label">
|
||||
<div class="fn__flex">
|
||||
<div class="fn__flex-center">${window.siyuan.languages.cloudSync}</div>
|
||||
|
|
@ -362,6 +373,17 @@ ${passwordHTML}
|
|||
}
|
||||
});
|
||||
});
|
||||
const syncModeElement = repos.element.querySelector("#syncMode") as HTMLSelectElement;
|
||||
syncModeElement.addEventListener("change", () => {
|
||||
fetchPost("/api/sync/setSyncMode", {mode: parseInt(syncModeElement.value, 10)}, (response) => {
|
||||
if (response.code === 1) {
|
||||
showMessage(response.msg);
|
||||
syncModeElement.value = "1";
|
||||
} else {
|
||||
window.siyuan.config.sync.mode = parseInt(syncModeElement.value, 10);
|
||||
}
|
||||
});
|
||||
});
|
||||
const loadingElement = repos.element.querySelector("#reposLoading") as HTMLElement;
|
||||
loadingElement.style.width = repos.element.clientWidth + "px";
|
||||
loadingElement.style.height = repos.element.clientHeight + "px";
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -242,6 +242,7 @@ declare interface IConfig {
|
|||
e2eePasswdMode: number
|
||||
sync: {
|
||||
enabled: boolean
|
||||
mode: number
|
||||
synced: number
|
||||
stat: string
|
||||
interval: number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue