mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
dbce98d811
commit
46620cd838
1 changed files with 32 additions and 1 deletions
|
|
@ -137,7 +137,38 @@ export const syncGuide = (element?: Element) => {
|
||||||
setSync();
|
setSync();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (window.siyuan.config.sync.mode !== 3) {
|
||||||
fetchPost("/api/sync/performSync", {});
|
fetchPost("/api/sync/performSync", {});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const manualDialog = new Dialog({
|
||||||
|
title: window.siyuan.languages.syncMod3,
|
||||||
|
content: `<div class="b3-dialog__content">
|
||||||
|
<label>
|
||||||
|
<input type="radio" name="upload" value="true"> upload
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<input type="radio" name="upload" value="false"> download
|
||||||
|
</label>
|
||||||
|
<div class="b3-dialog__action">
|
||||||
|
<button class="b3-button b3-button--cancel">${window.siyuan.languages.cancel}</button><div class="fn__space"></div>
|
||||||
|
<button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button>
|
||||||
|
</div>`,
|
||||||
|
width: isMobile() ? "80vw" : "520px",
|
||||||
|
});
|
||||||
|
const btnsElement = manualDialog.element.querySelectorAll(".b3-button");
|
||||||
|
btnsElement[0].addEventListener("click", () => {
|
||||||
|
manualDialog.destroy();
|
||||||
|
});
|
||||||
|
btnsElement[1].addEventListener("click", () => {
|
||||||
|
const uploadElement = manualDialog.element.querySelector("input[name=upload]:checked") as HTMLInputElement
|
||||||
|
if (!uploadElement) {
|
||||||
|
showMessage(window.siyuan.languages.plsChoose)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fetchPost("/api/sync/performSync", {upload: uploadElement.value === "true"});
|
||||||
|
manualDialog.destroy();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const setSync = (key?: string, dialog?: Dialog) => {
|
const setSync = (key?: string, dialog?: Dialog) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue