Skip to content

Build your personal knowledge base with Trilium Notes

feat(setup): drop config path text, add restart button to unreachable banner

Elian Doran3f4a07e3e7f1
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.css
index b57ca3c8e5..908dc91038 100644
--- a/apps/client/src/setup.css
+++ b/apps/client/src/setup.css
@@ -451,17 +451,12 @@ body[dir=rtl] .slide-in-backward {
}
}
- .sync-from-desktop-unreachable .config-path {
+ .sync-from-desktop-unreachable .unreachable-actions {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.75rem;
- margin-bottom: 0;
-
- code {
- user-select: text;
- word-break: break-all;
- }
+ margin-top: 1rem;
}
}
diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsx
index 54cf0c9907..eea24f1059 100644
--- a/apps/client/src/setup.tsx
+++ b/apps/client/src/setup.tsx
@@ -446,17 +446,22 @@ function SyncFromDesktop({ setState }: { setState: (state: State) => void }) {
<Admonition type="caution" className="sync-from-desktop-unreachable">
<strong>{t("setup.sync-from-desktop-unreachable-title")}</strong>
<p>{t("setup.sync-from-desktop-unreachable-description")}</p>
- {networkInfo.configPath && (
- <p class="config-path">
- <code>{networkInfo.configPath}</code>
- {isElectron() && (
+ {isElectron() && (
+ <div class="unreachable-actions">
+ {networkInfo.configPath && (
<Button
icon="bx bx-edit"
text={t("setup.sync-from-desktop-open-config")}
onClick={() => void openConfigFile(networkInfo.configPath)}
/>
)}
- </p>
+ <Button
+ kind="primary"
+ icon="bx bx-refresh"
+ text={t("setup.sync-from-desktop-restart")}
+ onClick={() => window.electronApi?.window.restartApp()}
+ />
+ </div>
)}
</Admonition>
) : (
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index c764ff1de6..963efe5c1e 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2792,6 +2792,7 @@
"sync-from-desktop-unreachable-title": "This device can't be reached by other devices",
"sync-from-desktop-unreachable-description": "Trilium is only listening on localhost, so another device can't connect to it. Set \"host=0.0.0.0\" under the [Network] section of your config.ini, restart Trilium, and try again.",
"sync-from-desktop-open-config": "Open config file",
+ "sync-from-desktop-restart": "Restart Trilium",
"advanced-options": "Advanced options",
"sync-failed": "Failed to sync: {{message}}",
"server-host": "Trilium server address",