mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-09 02:08:50 +01:00
🎨 Support exporting/importing S3 and WebDAV configurations https://github.com/siyuan-note/siyuan/issues/9566
This commit is contained in:
parent
f324f6a296
commit
1c47e0656d
1 changed files with 7 additions and 3 deletions
|
|
@ -4,6 +4,7 @@ import {showMessage} from "../dialog/message";
|
|||
import {bindSyncCloudListEvent, getSyncCloudList} from "../sync/syncGuide";
|
||||
import {processSync} from "../dialog/processSystem";
|
||||
import {getCloudURL} from "./util/about";
|
||||
import {openByMobile} from "../protyle/util/compatibility";
|
||||
|
||||
const renderProvider = (provider: number) => {
|
||||
if (provider === 0) {
|
||||
|
|
@ -404,7 +405,11 @@ export const repos = {
|
|||
const formData = new FormData();
|
||||
formData.append("file", event.target.files[0]);
|
||||
fetchPost(item.getAttribute("data-type") === "s3" ? "/api/sync/importSyncProviderS3" : "/api/sync/importSyncProviderWebDAV", formData, (response) => {
|
||||
window.siyuan.config.sync.s3 = response.data.s3;
|
||||
if (item.getAttribute("data-type") === "s3") {
|
||||
window.siyuan.config.sync.s3 = response.data.s3;
|
||||
} else {
|
||||
window.siyuan.config.sync.webdav = response.data.webdav;
|
||||
}
|
||||
renderProvider(window.siyuan.config.sync.provider);
|
||||
showMessage(window.siyuan.languages.imported);
|
||||
});
|
||||
|
|
@ -455,8 +460,7 @@ export const repos = {
|
|||
break;
|
||||
} else if (action === "exportData") {
|
||||
fetchPost(target.getAttribute("data-type") === "s3" ? "/api/sync/exportSyncProviderS3" : "/api/sync/exportSyncProviderWebDAV", {}, response => {
|
||||
window.location.href = response.data.zip;
|
||||
showMessage(window.siyuan.languages.exported);
|
||||
openByMobile(response.data.zip);
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue