mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-26 00:44:07 +01:00
🎨 公测云端同步数据仓库 https://github.com/siyuan-note/siyuan/issues/5337
This commit is contained in:
parent
5b1b38aabe
commit
eb79fbd37d
10 changed files with 59 additions and 0 deletions
|
|
@ -361,6 +361,14 @@ ${passwordHTML}
|
|||
<option value="2" ${window.siyuan.config.sync.mode === 2 ? "selected" : ""}>${window.siyuan.languages.syncMode2}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="fn__flex b3-label">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.syncDataRepo}
|
||||
<div class="b3-label__text">${window.siyuan.languages.syncDataRepoTip}</div>
|
||||
</div>
|
||||
<span class="fn__space"></span>
|
||||
<input type="checkbox" id="useDataRepo"${window.siyuan.config.sync.useDataRepo ? " checked='checked'" : ""} class="b3-switch fn__flex-center">
|
||||
</label>
|
||||
<div class="b3-label">
|
||||
<div class="fn__flex">
|
||||
<div class="fn__flex-center">${window.siyuan.languages.cloudSync}</div>
|
||||
|
|
@ -409,6 +417,17 @@ ${passwordHTML}
|
|||
}
|
||||
});
|
||||
});
|
||||
const useDataRepoElement = repos.element.querySelector("#useDataRepo") as HTMLInputElement;
|
||||
useDataRepoElement.addEventListener("change", () => {
|
||||
fetchPost("/api/sync/setSyncUseDataRepo", {enabled: useDataRepoElement.checked}, (response) => {
|
||||
if (response.code === 1) {
|
||||
showMessage(response.msg);
|
||||
useDataRepoElement.checked = false;
|
||||
} else {
|
||||
window.siyuan.config.sync.useDataRepo = useDataRepoElement.checked;
|
||||
}
|
||||
});
|
||||
});
|
||||
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
|
|
@ -255,6 +255,7 @@ declare interface IConfig {
|
|||
stat: string
|
||||
interval: number
|
||||
cloudName: string
|
||||
useDataRepo: boolean
|
||||
},
|
||||
lang: string
|
||||
api: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue