mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
This commit is contained in:
parent
2492068c4d
commit
6e7e154a3c
3 changed files with 16 additions and 0 deletions
|
|
@ -108,6 +108,14 @@ export const repos = {
|
|||
<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.generateConflictDoc}
|
||||
<div class="b3-label__text">${window.siyuan.languages.generateConflictDocTip}</div>
|
||||
</div>
|
||||
<span class="fn__space"></span>
|
||||
<input type="checkbox" id="generateConflictDoc"${window.siyuan.config.sync.generateConflictDoc ? " checked='checked'" : ""} class="b3-switch fn__flex-center">
|
||||
</label>
|
||||
${syncModeHTML}
|
||||
<div class="b3-label">
|
||||
<div class="fn__flex">
|
||||
|
|
@ -146,6 +154,12 @@ ${syncModeHTML}
|
|||
}
|
||||
});
|
||||
});
|
||||
const switchConflictElement = repos.element.querySelector("#generateConflictDoc") as HTMLInputElement;
|
||||
switchConflictElement.addEventListener("change", () => {
|
||||
fetchPost("/api/sync/setSyncGenerateConflictDoc", {enabled: switchConflictElement.checked}, (response) => {
|
||||
window.siyuan.config.sync.generateConflictDoc = switchConflictElement.checked;
|
||||
});
|
||||
});
|
||||
const syncModeElement = repos.element.querySelector("#syncMode") as HTMLSelectElement;
|
||||
syncModeElement.addEventListener("change", () => {
|
||||
fetchPost("/api/sync/setSyncMode", {mode: parseInt(syncModeElement.value, 10)}, (response) => {
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ export const initConfigSearch = (element: HTMLElement) => {
|
|||
// 云端
|
||||
getLang(["cloudStorage", "trafficStat", "sync", "backup", "cdn", "total", "sizeLimit", "cloudBackup",
|
||||
"cloudBackupTip", "updatePath", "cloudSync", "upload", "download", "syncMode", "syncModeTip",
|
||||
"generateConflictDoc", "generateConflictDocTip",
|
||||
"syncMode1", "syncMode2", "reposTip", "openSyncTip1", "openSyncTip2", "cloudSyncDir", "config"]),
|
||||
|
||||
// 账号
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -303,6 +303,7 @@ declare interface IConfig {
|
|||
key: string
|
||||
},
|
||||
sync: {
|
||||
generateConflictDoc: boolean
|
||||
enabled: boolean
|
||||
mode: number
|
||||
synced: number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue