Skip to content

Build your personal knowledge base with Trilium Notes

feat(standalone/setup): use normal form groups for sync settings

Elian Dorana87266478923
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.css
index 0d36276c27..94778a538b 100644
--- a/apps/client/src/setup.css
+++ b/apps/client/src/setup.css
@@ -109,7 +109,6 @@ body.setup {
flex-direction: column;
justify-content: center;
flex-grow: 1;
- gap: 1rem;
width: 80%;
margin: auto;
diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsx
index 973fc2285e..277a2bb315 100644
--- a/apps/client/src/setup.tsx
+++ b/apps/client/src/setup.tsx
@@ -7,11 +7,12 @@ import { useEffect, useRef, useState } from "preact/hooks";
import { initLocale, t } from "./services/i18n";
import server from "./services/server";
-import { replaceHtmlEscapedSlashes } from "./services/utils";
+import { isElectron, replaceHtmlEscapedSlashes } from "./services/utils";
import Admonition from "./widgets/react/Admonition";
import Button from "./widgets/react/Button";
import { Card, CardFrame, CardSection } from "./widgets/react/Card";
import Collapsible from "./widgets/react/Collapsible";
+import FormGroup from "./widgets/react/FormGroup";
import FormTextBox from "./widgets/react/FormTextBox";
import Icon from "./widgets/react/Icon";
@@ -252,18 +253,22 @@ function SyncFromServer({ setState }: { setState: (state: State) => void }) {
</>}
>
<form>
- <FormItemWithIcon icon="bx bx-server">
- <FormTextBox placeholder="https://example.com" currentValue={syncServerHost} onChange={setSyncServerHost} required />
- </FormItemWithIcon>
+ <FormGroup label={t("setup.server-host")} name="serverHost">
+ <FormTextBox placeholder={t("setup.server-host-placeholder")} currentValue={syncServerHost} onChange={setSyncServerHost} required />
+ </FormGroup>
- <FormItemWithIcon icon="bx bx-lock">
- <FormTextBox placeholder={t("setup.password-placeholder")} type="password" currentValue={password} onChange={setPassword} required />
- </FormItemWithIcon>
+ <FormGroup label={t("setup.server-password")} name="serverPassword">
+ <FormTextBox type="password" currentValue={password} onChange={setPassword} required />
+ </FormGroup>
<Collapsible title={t("setup.advanced-options")} initiallyExpanded={false}>
- <FormItemWithIcon icon="bx bx-shape-polygon">
- <FormTextBox placeholder="http://my-proxy.com:8080" currentValue={syncProxy} onChange={setSyncProxy} />
- </FormItemWithIcon>
+ <FormGroup
+ name="proxyServer"
+ label={t("setup.proxy-server")}
+ description={isElectron() ? t("setup.proxy-instruction") : undefined}
+ >
+ <FormTextBox placeholder={t("setup.proxy-server-placeholder")} currentValue={syncProxy} onChange={setSyncProxy} />
+ </FormGroup>
</Collapsible>
{error && <Admonition className="error" type="caution">{replaceHtmlEscapedSlashes(error)}</Admonition>}
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index e5b60315af..fcdbfd7f83 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2246,7 +2246,6 @@
"sync-from-server-page-description": "Enter your server details below to connect your existing workspace.",
"sync-in-progress-title": "Sync in progress",
"sync-in-progress-description": "Your device is now connected and items are being synchronized.",
- "password-placeholder": "Password",
"button-back": "Back",
"button-finish-setup": "Finish setup",
"sync-step-connecting": "Connecting to server",
@@ -2265,6 +2264,12 @@
"sync-from-desktop-final": "Once you've completed these steps, you can proceed to the next step.",
"sync-from-desktop-waiting": "Waiting for connection...",
"advanced-options": "Advanced options",
- "sync-failed": "Failed to sync: {{message}}"
+ "sync-failed": "Failed to sync: {{message}}",
+ "server-host": "Trilium server address",
+ "server-host-placeholder": "https://<hostname>:<port>",
+ "server-password": "Password",
+ "proxy-server": "Proxy server (optional)",
+ "proxy-server-placeholder": "https://<hostname>:<port>",
+ "proxy-instruction": "If you leave proxy setting blank, system proxy will be used."
}
}
diff --git a/apps/server/src/assets/translations/en/server.json b/apps/server/src/assets/translations/en/server.json
index 62681756ba..f89bea235f 100644
--- a/apps/server/src/assets/translations/en/server.json
+++ b/apps/server/src/assets/translations/en/server.json
@@ -238,12 +238,7 @@
"setup_sync-from-server": {
"heading": "Sync from Server",
"instructions": "Please enter Trilium server address and credentials below. This will download the whole Trilium document from server and setup sync to it. Depending on the document size and your connection speed, this may take a while.",
- "server-host": "Trilium server address",
- "server-host-placeholder": "https://<hostname>:<port>",
- "proxy-server": "Proxy server (optional)",
- "proxy-server-placeholder": "https://<hostname>:<port>",
"note": "Note:",
- "proxy-instruction": "If you leave proxy setting blank, system proxy will be used (applies to the desktop application only)",
"password": "Password",
"password-placeholder": "Password",
"back": "Back",