Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-12-07 18:27:39 +08:00
commit a1c81fda03
6 changed files with 31 additions and 27 deletions

View file

@ -550,7 +550,7 @@ const initKernel = (initData) => {
switch (code) {
case 20:
showErrorWindow('⚠️ 数据库被锁定 The database is locked',
`<div>数据库文件正在被其他进程占用请检查是否同时存在多个内核进程SiYuan Kernel。</div><div>The database file is being occupied by other processes, please check whether there are multiple kernel processes (SiYuan Kernel) at the same time.</div>`)
`<div>数据库文件正在被其他进程占用请检查是否同时存在多个内核进程SiYuan Kernel服务相同的工作空间。</div><div>The database file is being occupied by other processes, please check whether there are multiple kernel processes (SiYuan Kernel) serving the same workspace at the same time.</div>`)
break
case 21:
showErrorWindow('⚠️ 监听端口 ' + kernelPort + ' 失败 Failed to listen to port ' + kernelPort,

View file

@ -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