Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

Add system info to profile

yoma63b26067927c
diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsx
index 67d921e1..ef73d5fd 100644
--- a/apps/web/src/components/SettingsPane.tsx
+++ b/apps/web/src/components/SettingsPane.tsx
@@ -7,6 +7,7 @@ import { EvernoteImportGuideCard } from "./settings/EvernoteImportGuideCard";
import { McpConfigCard } from "./settings/McpConfigCard";
import { PreferenceCard } from "./settings/PreferenceCard";
import { SessionCard } from "./settings/SessionCard";
+import { SystemInfoCard } from "./settings/SystemInfoCard";
interface SettingsPaneProps {
onClose: () => void;
@@ -67,6 +68,7 @@ export const SettingsPane = ({
/>
<AdvancedPlayCard />
<EvernoteImportGuideCard onShowGuide={onShowGuide} />
+ <SystemInfoCard />
<McpConfigCard />
<SessionCard authRequired={authRequired} isLoggingOut={isLoggingOut} onLogout={onLogout} />
</div>
diff --git a/apps/web/src/components/settings/SystemInfoCard.tsx b/apps/web/src/components/settings/SystemInfoCard.tsx
new file mode 100644
index 00000000..36ed0c30
--- /dev/null
+++ b/apps/web/src/components/settings/SystemInfoCard.tsx
@@ -0,0 +1,137 @@
+import { useMemo, useState } from "react";
+import { Copy, Info } from "lucide-react";
+import { useTranslation } from "react-i18next";
+import { Button } from "@/components/ui/button";
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
+import { copyTextToClipboard } from "./settings-utils";
+
+type SystemInfoItem = {
+ label: string;
+ value: string;
+};
+
+type NavigatorWithStandalone = Navigator & {
+ standalone?: boolean;
+};
+
+const detectBrowser = (userAgent: string) => {
+ if (/Edg\//.test(userAgent) || /EdgA\//.test(userAgent) || /EdgiOS\//.test(userAgent)) {
+ return "Microsoft Edge";
+ }
+ if ((/Chrome\//.test(userAgent) || /CriOS\//.test(userAgent)) && !/Chromium\//.test(userAgent)) {
+ return "Chrome";
+ }
+ if (/Firefox\//.test(userAgent)) {
+ return "Firefox";
+ }
+ if (/Safari\//.test(userAgent) && !/Chrome\//.test(userAgent)) {
+ return "Safari";
+ }
+ return null;
+};
+
+const detectOperatingSystem = (userAgent: string, platform: string) => {
+ const source = `${userAgent} ${platform}`;
+
+ if (/Windows/i.test(source)) {
+ return "Windows";
+ }
+ if (/Android/i.test(source)) {
+ return "Android";
+ }
+ if (/(iPhone|iPad|iPod)/i.test(source)) {
+ return "iOS";
+ }
+ if (/Mac/i.test(source)) {
+ return "macOS";
+ }
+ if (/Linux/i.test(source)) {
+ return "Linux";
+ }
+ return null;
+};
+
+export const SystemInfoCard = () => {
+ const { t, i18n } = useTranslation();
+ const [copied, setCopied] = useState(false);
+
+ const infoItems = useMemo<SystemInfoItem[]>(() => {
+ const language = navigator.language || i18n.language;
+ const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || t("systemInfo.unknown");
+ const userAgent = navigator.userAgent;
+ const standalone =
+ window.matchMedia("(display-mode: standalone)").matches ||
+ (navigator as NavigatorWithStandalone).standalone === true;
+
+ return [
+ { label: t("systemInfo.version"), value: `v${__EDGEEVER_APP_VERSION__}` },
+ { label: t("systemInfo.build"), value: __EDGEEVER_BUILD_LABEL__ },
+ {
+ label: t("systemInfo.browser"),
+ value: detectBrowser(userAgent) ?? t("systemInfo.unknown"),
+ },
+ {
+ label: t("systemInfo.os"),
+ value: detectOperatingSystem(userAgent, navigator.platform) ?? t("systemInfo.unknown"),
+ },
+ { label: t("systemInfo.language"), value: language },
+ { label: t("systemInfo.timeZone"), value: timeZone },
+ {
+ label: t("systemInfo.installMode"),
+ value: standalone ? t("systemInfo.standalone") : t("systemInfo.browserMode"),
+ },
+ ];
+ }, [i18n.language, t]);
+
+ const handleCopy = async () => {
+ const details = infoItems.map((item) => `${item.label}: ${item.value}`).join("\n");
+
+ if (!(await copyTextToClipboard(details))) {
+ return;
+ }
+
+ setCopied(true);
+ window.setTimeout(() => setCopied(false), 1600);
+ };
+
+ return (
+ <Card className="w-full min-w-0 overflow-hidden shadow-none">
+ <CardHeader className="p-4">
+ <div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
+ <div className="min-w-0">
+ <CardTitle className="flex items-center gap-2 text-sm">
+ <Info className="h-4 w-4 text-emerald-700" />
+ {t("systemInfo.title")}
+ </CardTitle>
+ <CardDescription className="mt-1 text-xs leading-4">
+ {t("systemInfo.description")}
+ </CardDescription>
+ </div>
+ <Button
+ size="sm"
+ variant="outline"
+ className="h-8 w-full bg-white px-3 text-xs sm:w-auto"
+ type="button"
+ onClick={() => void handleCopy()}
+ >
+ <Copy className="h-3.5 w-3.5" />
+ {copied ? t("common.copied") : t("systemInfo.copy")}
+ </Button>
+ </div>
+ </CardHeader>
+ <CardContent className="grid gap-2 p-4 pt-0 sm:grid-cols-2">
+ {infoItems.map((item) => (
+ <div
+ key={item.label}
+ className="min-w-0 rounded-lg border border-slate-200 bg-white px-3 py-2.5"
+ >
+ <div className="text-[11px] font-semibold uppercase text-slate-400">{item.label}</div>
+ <div className="mt-1 truncate font-mono text-xs font-semibold text-slate-800" title={item.value}>
+ {item.value}
+ </div>
+ </div>
+ ))}
+ </CardContent>
+ </Card>
+ );
+};
diff --git a/apps/web/src/i18n/resources/en-US.ts b/apps/web/src/i18n/resources/en-US.ts
index 4055e615..835d46b9 100644
--- a/apps/web/src/i18n/resources/en-US.ts
+++ b/apps/web/src/i18n/resources/en-US.ts
@@ -131,7 +131,7 @@ export const enUS = {
},
settings: {
title: "Me",
- subtitle: "Preferences, MCP tokens, and sign-in session",
+ subtitle: "Preferences, system info, MCP tokens, and sign-in session",
preferences: "Preferences",
languageTitle: "Interface language",
languageDescription: "Change the display language for the product UI.",
@@ -139,6 +139,21 @@ export const enUS = {
imageCompressionDescription: "Compress large images locally before upload to reduce storage use.",
imageCompressionAria: "Compress note images",
},
+ systemInfo: {
+ title: "System info",
+ description: "View the current app version, build identifier, and runtime environment.",
+ version: "Version",
+ build: "Build",
+ browser: "Browser",
+ os: "System",
+ language: "Language",
+ timeZone: "Time zone",
+ installMode: "Mode",
+ standalone: "Installed app",
+ browserMode: "Browser",
+ unknown: "Unknown",
+ copy: "Copy info",
+ },
shortcuts: {
title: "Keyboard shortcuts",
manage: "Manage",
diff --git a/apps/web/src/i18n/resources/zh-CN.ts b/apps/web/src/i18n/resources/zh-CN.ts
index 6ae63b45..a69f2732 100644
--- a/apps/web/src/i18n/resources/zh-CN.ts
+++ b/apps/web/src/i18n/resources/zh-CN.ts
@@ -131,7 +131,7 @@ export const zhCN = {
},
settings: {
title: "我的",
- subtitle: "个人偏好、MCP Token 与登录会话",
+ subtitle: "个人偏好、系统信息、MCP Token 与登录会话",
preferences: "偏好设置",
languageTitle: "界面语言",
languageDescription: "切换产品界面的显示语言。",
@@ -139,6 +139,21 @@ export const zhCN = {
imageCompressionDescription: "上传大图时在本地压缩,节省资源占用。",
imageCompressionAria: "是否压缩笔记内图片",
},
+ systemInfo: {
+ title: "系统信息",
+ description: "查看当前应用版本、构建标识和运行环境。",
+ version: "版本号",
+ build: "构建",
+ browser: "浏览器",
+ os: "系统",
+ language: "语言",
+ timeZone: "时区",
+ installMode: "运行模式",
+ standalone: "已安装应用",
+ browserMode: "浏览器",
+ unknown: "未知",
+ copy: "复制信息",
+ },
shortcuts: {
title: "绑定快捷键",
manage: "管理",
diff --git a/apps/web/src/vite-env.d.ts b/apps/web/src/vite-env.d.ts
index f2f0f54c..650a5acf 100644
--- a/apps/web/src/vite-env.d.ts
+++ b/apps/web/src/vite-env.d.ts
@@ -3,3 +3,4 @@
declare const __EDGEEVER_BUILD_ID__: string;
declare const __EDGEEVER_BUILD_LABEL__: string;
+declare const __EDGEEVER_APP_VERSION__: string;
diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts
index 60dae5eb..193a4c26 100644
--- a/apps/web/vite.config.ts
+++ b/apps/web/vite.config.ts
@@ -1,9 +1,22 @@
import react from "@vitejs/plugin-react";
import { execSync } from "node:child_process";
+import { readFileSync } from "node:fs";
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
+const readPackageVersion = () => {
+ try {
+ const packagePath = fileURLToPath(new URL("../../package.json", import.meta.url));
+ const packageJson = JSON.parse(readFileSync(packagePath, "utf8")) as {
+ version?: string;
+ };
+ return packageJson.version ?? "0.0.0";
+ } catch {
+ return "0.0.0";
+ }
+};
+
const readGitCommit = () => {
try {
return execSync("git rev-parse --short=12 HEAD", { encoding: "utf8" }).trim();
@@ -13,10 +26,12 @@ const readGitCommit = () => {
};
const buildId = process.env.CF_PAGES_COMMIT_SHA?.slice(0, 12) ?? process.env.GITHUB_SHA?.slice(0, 12) ?? readGitCommit() ?? "local";
+const appVersion = readPackageVersion();
export default defineConfig({
root: "apps/web",
define: {
+ __EDGEEVER_APP_VERSION__: JSON.stringify(appVersion),
__EDGEEVER_BUILD_ID__: JSON.stringify(buildId),
__EDGEEVER_BUILD_LABEL__: JSON.stringify(buildId === "local" ? "local" : buildId.slice(0, 7)),
},