Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(desktop): improve integration of setup
Elian Doranfa7d1d3f80d8
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.cssindex 5938f6486b..a6bcc24cba 100644--- a/apps/client/src/setup.css+++ b/apps/client/src/setup.css@@ -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 {diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsxindex 761f3fedbc..88b009b3e9 100644--- a/apps/client/src/setup.tsx+++ b/apps/client/src/setup.tsx@@ -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);}diff --git a/apps/server/src/routes/index.ts b/apps/server/src/routes/index.tsindex f3878970b8..14eec1714c 100644--- a/apps/server/src/routes/index.ts+++ b/apps/server/src/routes/index.ts@@ -30,7 +30,7 @@ export function bootstrap(req: Request, res: Response) {if (!isDbInitialized) {res.send({...commonItems,- baseApiUrl: "../api/"+ baseApiUrl: "api/"});return;}diff --git a/apps/server/src/services/window.ts b/apps/server/src/services/window.tsindex e04b65e5c4..bf9f7fd033 100644--- a/apps/server/src/services/window.ts+++ b/apps/server/src/services/window.ts@@ -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));}