mirror of
https://github.com/zadam/trilium.git
synced 2026-03-26 05:40:15 +01:00
feat(desktop): improve integration of setup
This commit is contained in:
@@ -14,16 +14,18 @@ body.setup {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
|
||||
@media (min-width: 700px) {
|
||||
background:
|
||||
radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
|
||||
radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.25) 0%, transparent 50%),
|
||||
radial-gradient(ellipse at 60% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 50%),
|
||||
var(--left-pane-background-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 2em;
|
||||
body:not(.electron) & {
|
||||
@media (min-width: 700px) {
|
||||
background:
|
||||
radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
|
||||
radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.25) 0%, transparent 50%),
|
||||
radial-gradient(ellipse at 60% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 50%),
|
||||
var(--left-pane-background-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 2em;
|
||||
}
|
||||
}
|
||||
|
||||
.setup-container {
|
||||
|
||||
@@ -25,6 +25,9 @@ async function main() {
|
||||
const bodyWrapper = document.createElement("div");
|
||||
bodyWrapper.classList.add("setup-outer-wrapper");
|
||||
document.body.classList.add("setup");
|
||||
if (isElectron()) {
|
||||
document.body.classList.add("electron");
|
||||
}
|
||||
render(<App />, bodyWrapper);
|
||||
document.body.replaceChildren(bodyWrapper);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export function bootstrap(req: Request, res: Response) {
|
||||
if (!isDbInitialized) {
|
||||
res.send({
|
||||
...commonItems,
|
||||
baseApiUrl: "../api/"
|
||||
baseApiUrl: "api/"
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -390,16 +390,18 @@ async function createSetupWindow() {
|
||||
setupWindow = new BrowserWindow({
|
||||
width,
|
||||
height,
|
||||
useContentSize: true,
|
||||
resizable: false,
|
||||
autoHideMenuBar: true,
|
||||
title: "Trilium Notes Setup",
|
||||
icon: getIcon(),
|
||||
webPreferences: {
|
||||
// necessary for e.g. utils.isElectron()
|
||||
nodeIntegration: true
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false
|
||||
}
|
||||
});
|
||||
|
||||
setupWindow.setMenuBarVisibility(false);
|
||||
setupWindow.removeMenu();
|
||||
setupWindow.loadURL(`http://127.0.0.1:${port}`);
|
||||
setupWindow.on("closed", () => (setupWindow = null));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user