feat(desktop): improve integration of setup

This commit is contained in:
Elian Doran
2026-03-25 23:08:10 +02:00
parent 2eef2f801f
commit fa7d1d3f80
4 changed files with 21 additions and 14 deletions

View File

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

View File

@@ -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);
}

View File

@@ -30,7 +30,7 @@ export function bootstrap(req: Request, res: Response) {
if (!isDbInitialized) {
res.send({
...commonItems,
baseApiUrl: "../api/"
baseApiUrl: "api/"
});
return;
}

View File

@@ -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));
}