mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 工作空间多开
This commit is contained in:
parent
f316c44d35
commit
2296b6dc63
1 changed files with 15 additions and 8 deletions
|
|
@ -53,8 +53,10 @@ try {
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
require('electron').dialog.showErrorBox('创建配置目录失败 Failed to create config directory',
|
require('electron').
|
||||||
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
dialog.
|
||||||
|
showErrorBox('创建配置目录失败 Failed to create config directory',
|
||||||
|
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
||||||
app.exit()
|
app.exit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -834,9 +836,9 @@ app.whenReady().then(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const workspace = getArg("--workspace")
|
const workspace = getArg('--workspace')
|
||||||
if (workspace) {
|
if (workspace) {
|
||||||
writeLog("got arg [--workspace=" + workspace + "]")
|
writeLog('got arg [--workspace=' + workspace + ']')
|
||||||
}
|
}
|
||||||
initKernel(workspace).then((isSucc) => {
|
initKernel(workspace).then((isSucc) => {
|
||||||
if (isSucc) {
|
if (isSucc) {
|
||||||
|
|
@ -933,12 +935,17 @@ powerMonitor.on('resume', async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
writeLog('sync after system resume')
|
writeLog('sync after system resume')
|
||||||
// TODO
|
workspaces.forEach(item => {
|
||||||
fetch(getServer() + '/api/sync/performSync', {method: 'POST'})
|
const currentURL = new URL(item.browserWindow.getURL())
|
||||||
|
fetch(getServer(currentURL.port) + '/api/sync/performSync',
|
||||||
|
{method: 'POST'})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
powerMonitor.on('shutdown', () => {
|
powerMonitor.on('shutdown', () => {
|
||||||
writeLog('system shutdown')
|
writeLog('system shutdown')
|
||||||
// TODO
|
workspaces.forEach(item => {
|
||||||
fetch(getServer() + '/api/system/exit', {method: 'POST'})
|
const currentURL = new URL(item.browserWindow.getURL())
|
||||||
|
fetch(getServer(currentURL.port) + '/api/system/exit', {method: 'POST'})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue