mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 11:50:15 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a1c81fda03
6 changed files with 31 additions and 27 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import {fetchPost} from "../util/fetch";
|
||||
/// #if !BROWSER
|
||||
import {dialog} from "@electron/remote";
|
||||
import {SaveDialogReturnValue, shell} from "electron";
|
||||
import {shell} from "electron";
|
||||
import {afterExport} from "../protyle/export/util";
|
||||
import * as path from "path";
|
||||
/// #endif
|
||||
import {isBrowser} from "../util/functions";
|
||||
import {showMessage} from "../dialog/message";
|
||||
|
|
@ -157,19 +158,20 @@ export const exportConfig = {
|
|||
window.location.href = response.data.zip;
|
||||
});
|
||||
/// #else
|
||||
dialog.showSaveDialog({
|
||||
defaultPath: "data",
|
||||
properties: ["showOverwriteConfirmation"],
|
||||
}).then((result: SaveDialogReturnValue) => {
|
||||
if (!result.canceled) {
|
||||
const msgId = showMessage(window.siyuan.languages.exporting, -1);
|
||||
fetchPost("/api/export/exportDataInFolder", {
|
||||
folder: result.filePath
|
||||
}, () => {
|
||||
afterExport(result.filePath, msgId);
|
||||
});
|
||||
}
|
||||
});
|
||||
let filePaths = dialog.showOpenDialogSync({
|
||||
title: window.siyuan.languages.export + " " + "Data",
|
||||
properties: ["createDirectory", "openDirectory"],
|
||||
})
|
||||
if (filePaths && 0 < filePaths.length) {
|
||||
const savePath = filePaths[0];
|
||||
const msgId = showMessage(window.siyuan.languages.exporting, -1);
|
||||
fetchPost("/api/export/exportDataInFolder", {
|
||||
folder: savePath,
|
||||
}, response => {
|
||||
afterExport(path.join(savePath, response.data.name), msgId);
|
||||
});
|
||||
}
|
||||
|
||||
/// #endif
|
||||
});
|
||||
/// #if !BROWSER
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue