Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

feat(ui): add i18n support with Chinese/English language switch

cyhhao5572695ec2f2
diff --git a/ui/package-lock.json b/ui/package-lock.json
index f95159559..61063aea6 100644
--- a/ui/package-lock.json
+++ b/ui/package-lock.json
@@ -10,9 +10,12 @@
"dependencies": {
"clsx": "^2.1.1",
"framer-motion": "^12.26.2",
+ "i18next": "^25.7.4",
+ "i18next-browser-languagedetector": "^8.2.0",
"lucide-react": "^0.562.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
+ "react-i18next": "^16.5.3",
"react-router-dom": "^7.12.0",
"tailwind-merge": "^3.4.0"
},
@@ -282,6 +285,15 @@
"@babel/core": "^7.0.0-0"
}
},
+ "node_modules/@babel/runtime": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz",
+ "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@babel/template": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz",
@@ -2847,6 +2859,55 @@
"hermes-estree": "0.25.1"
}
},
+ "node_modules/html-parse-stringify": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz",
+ "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==",
+ "license": "MIT",
+ "dependencies": {
+ "void-elements": "3.1.0"
+ }
+ },
+ "node_modules/i18next": {
+ "version": "25.7.4",
+ "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.7.4.tgz",
+ "integrity": "sha512-hRkpEblXXcXSNbw8mBNq9042OEetgyB/ahc/X17uV/khPwzV+uB8RHceHh3qavyrkPJvmXFKXME2Sy1E0KjAfw==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://locize.com"
+ },
+ {
+ "type": "individual",
+ "url": "https://locize.com/i18next.html"
+ },
+ {
+ "type": "individual",
+ "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.28.4"
+ },
+ "peerDependencies": {
+ "typescript": "^5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/i18next-browser-languagedetector": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.2.0.tgz",
+ "integrity": "sha512-P+3zEKLnOF0qmiesW383vsLdtQVyKtCNA9cjSoKCppTKPQVfKd2W8hbVo5ZhNJKDqeM7BOcvNoKJOjpHh4Js9g==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.23.2"
+ }
+ },
"node_modules/ignore": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
@@ -3576,6 +3637,33 @@
"react": "^19.2.3"
}
},
+ "node_modules/react-i18next": {
+ "version": "16.5.3",
+ "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-16.5.3.tgz",
+ "integrity": "sha512-fo+/NNch37zqxOzlBYrWMx0uy/yInPkRfjSuy4lqKdaecR17nvCHnEUt3QyzA8XjQ2B/0iW/5BhaHR3ZmukpGw==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.28.4",
+ "html-parse-stringify": "^3.0.1",
+ "use-sync-external-store": "^1.6.0"
+ },
+ "peerDependencies": {
+ "i18next": ">= 25.6.2",
+ "react": ">= 16.8.0",
+ "typescript": "^5"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ },
+ "react-native": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
"node_modules/react-refresh": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz",
@@ -3844,7 +3932,7 @@
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
- "dev": true,
+ "devOptional": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
@@ -3926,6 +4014,15 @@
"punycode": "^2.1.0"
}
},
+ "node_modules/use-sync-external-store": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz",
+ "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==",
+ "license": "MIT",
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
"node_modules/vite": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz",
@@ -4001,6 +4098,15 @@
}
}
},
+ "node_modules/void-elements": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
+ "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/ui/package.json b/ui/package.json
index a9a69ee49..27fa0b0cb 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -12,9 +12,12 @@
"dependencies": {
"clsx": "^2.1.1",
"framer-motion": "^12.26.2",
+ "i18next": "^25.7.4",
+ "i18next-browser-languagedetector": "^8.2.0",
"lucide-react": "^0.562.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
+ "react-i18next": "^16.5.3",
"react-router-dom": "^7.12.0",
"tailwind-merge": "^3.4.0"
},
diff --git a/ui/src/components/AppShell.tsx b/ui/src/components/AppShell.tsx
index 3668c852e..e7d9d8d63 100644
--- a/ui/src/components/AppShell.tsx
+++ b/ui/src/components/AppShell.tsx
@@ -1,8 +1,11 @@
import React from 'react';
import { NavLink, Outlet, useLocation } from 'react-router-dom';
import { LayoutDashboard, MessageSquare, Activity } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
import { useStatus } from '../context/StatusContext';
+import { LanguageSwitcher } from './LanguageSwitcher';
import clsx from 'clsx';
+import logoImg from '../assets/logo.png';
const NavItem = ({ to, icon: Icon, children }: { to: string; icon: any; children: React.ReactNode }) => (
<NavLink
@@ -20,6 +23,7 @@ const NavItem = ({ to, icon: Icon, children }: { to: string; icon: any; children
);
export const AppShell: React.FC = () => {
+ const { t } = useTranslation();
const { status } = useStatus();
const location = useLocation();
@@ -35,22 +39,23 @@ export const AppShell: React.FC = () => {
<aside className="w-64 border-r border-border bg-panel hidden md:flex flex-col">
<div className="p-6 border-b border-border">
<h1 className="text-xl font-bold font-display tracking-tight flex items-center gap-2">
- <div className="w-6 h-6 bg-accent rounded-md"></div>
- Vibe Remote
+ <img src={logoImg} alt="Vibe Remote Logo" className="w-6 h-6 rounded-md" />
+ {t('appShell.title')}
</h1>
</div>
<nav className="flex-1 p-4 space-y-1">
- <NavItem to="/dashboard" icon={LayoutDashboard}>Dashboard</NavItem>
- <NavItem to="/channels" icon={MessageSquare}>Channels</NavItem>
- <NavItem to="/doctor" icon={Activity}>Doctor</NavItem>
+ <NavItem to="/dashboard" icon={LayoutDashboard}>{t('nav.dashboard')}</NavItem>
+ <NavItem to="/channels" icon={MessageSquare}>{t('nav.channels')}</NavItem>
+ <NavItem to="/doctor" icon={Activity}>{t('nav.doctor')}</NavItem>
</nav>
- <div className="p-4 border-t border-border">
+ <div className="p-4 border-t border-border space-y-3">
+ <LanguageSwitcher />
<div className="flex items-center justify-between bg-neutral-50 p-3 rounded-lg border border-border">
<div className="flex items-center gap-2">
<div className={clsx("w-2.5 h-2.5 rounded-full", isRunning ? "bg-success" : "bg-muted")}></div>
- <span className="text-sm font-medium">{isRunning ? 'Running' : 'Stopped'}</span>
+ <span className="text-sm font-medium">{isRunning ? t('common.running') : t('common.stopped')}</span>
</div>
</div>
</div>
diff --git a/ui/src/components/Dashboard.tsx b/ui/src/components/Dashboard.tsx
index a081c0f04..ad1941ed4 100644
--- a/ui/src/components/Dashboard.tsx
+++ b/ui/src/components/Dashboard.tsx
@@ -1,13 +1,20 @@
import React from 'react';
+import { useTranslation } from 'react-i18next';
import { useStatus } from '../context/StatusContext';
-import { Play, Square, RotateCw, Activity, Terminal, CheckCircle } from 'lucide-react';
+import { Play, Square, RotateCw, Activity, Terminal, CheckCircle, MessageSquare, Server, Settings, Info } from 'lucide-react';
import { Link } from 'react-router-dom';
export const Dashboard: React.FC = () => {
+ const { t } = useTranslation();
const { status, control } = useStatus();
const [loading, setLoading] = React.useState(false);
const [config, setConfig] = React.useState<any>({});
const [doctor, setDoctor] = React.useState<any>(null);
+ const [settingsMessage, setSettingsMessage] = React.useState<string | null>(null);
+ const [uiSaving, setUiSaving] = React.useState(false);
+ const [uiMessage, setUiMessage] = React.useState<string | null>(null);
+ const [diagnosticsSaving, setDiagnosticsSaving] = React.useState(false);
+ const [diagnosticsMessage, setDiagnosticsMessage] = React.useState<string | null>(null);
const handleAction = async (action: string) => {
setLoading(true);
@@ -18,12 +25,91 @@ export const Dashboard: React.FC = () => {
}
};
+ // Auto-save Message Handling config (no restart needed)
+ const autoSaveMessageConfig = async (newConfig: any) => {
+ try {
+ await fetch('/config', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(newConfig),
+ });
+ setSettingsMessage(t('common.saved'));
+ } catch {
+ setSettingsMessage(t('common.saveFailed'));
+ }
+ };
+
+ // Save Console Server config and restart UI service
+ const handleUiSaveRestart = async () => {
+ setUiSaving(true);
+ setUiMessage(null);
+ try {
+ const uiPayload = {
+ setup_host: config.ui?.setup_host || '127.0.0.1',
+ setup_port: config.ui?.setup_port || 5123,
+ };
+ const configPayload = {
+ ...config,
+ ui: { ...(config.ui || {}), ...uiPayload },
+ };
+ // Save config first
+ await fetch('/config', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(configPayload),
+ });
+ // Restart UI service
+ await fetch('/ui/reload', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ host: uiPayload.setup_host, port: uiPayload.setup_port }),
+ });
+ setUiMessage(t('dashboard.uiRestartMessage'));
+ const newUrl = `http://${uiPayload.setup_host}:${uiPayload.setup_port}`;
+ window.setTimeout(() => {
+ window.location.href = newUrl;
+ }, 2000);
+ } catch {
+ setUiMessage(t('common.saveFailed'));
+ } finally {
+ setUiSaving(false);
+ }
+ };
+
+ // Save Diagnostics config and restart main service
+ const handleDiagnosticsSaveRestart = async () => {
+ setDiagnosticsSaving(true);
+ setDiagnosticsMessage(null);
+ try {
+ const runtimePayload = {
+ log_level: config.runtime?.log_level || 'INFO',
+ };
+ const configPayload = {
+ ...config,
+ runtime: { ...(config.runtime || {}), ...runtimePayload },
+ };
+ await fetch('/config', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(configPayload),
+ });
+ await control('restart');
+ setDiagnosticsMessage(t('dashboard.mainServiceRestarted'));
+ } catch {
+ setDiagnosticsMessage(t('common.saveFailed'));
+ } finally {
+ setDiagnosticsSaving(false);
+ }
+ };
+
+
React.useEffect(() => {
const load = async () => {
try {
const res = await fetch('/config');
if (res.ok) {
- setConfig(await res.json());
+ const nextConfig = await res.json();
+ setConfig(nextConfig);
}
const doctorRes = await fetch('/doctor', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: '{}' });
if (doctorRes.ok) {
@@ -36,11 +122,29 @@ export const Dashboard: React.FC = () => {
load();
}, []);
+ React.useEffect(() => {
+ if (!settingsMessage) return;
+ const timer = window.setTimeout(() => {
+ setSettingsMessage(null);
+ }, 4000);
+ return () => window.clearTimeout(timer);
+ }, [settingsMessage]);
+
+ React.useEffect(() => {
+ if (!diagnosticsMessage) return;
+ const timer = window.setTimeout(() => {
+ setDiagnosticsMessage(null);
+ }, 4000);
+ return () => window.clearTimeout(timer);
+ }, [diagnosticsMessage]);
+
+ const showWorkspaceGateway = config.mode !== 'self_host';
+
return (
<div className="max-w-5xl mx-auto space-y-8">
<header>
- <h2 className="text-3xl font-display font-bold mb-2 text-text">Dashboard</h2>
- <p className="text-muted">Manage your local Vibe Remote instance.</p>
+ <h2 className="text-3xl font-display font-bold mb-2 text-text">{t('dashboard.title')}</h2>
+ <p className="text-muted">{t('dashboard.subtitle')}</p>
</header>
{/* Overview Card */}
@@ -48,14 +152,14 @@ export const Dashboard: React.FC = () => {
<div className="flex items-center justify-between mb-6">
<div>
<h3 className="text-lg font-semibold flex items-center gap-2">
- Service Status
+ {t('dashboard.serviceStatus')}
<span className={`px-2 py-0.5 rounded-full text-xs font-medium ${
status.state === 'running' ? 'bg-success/10 text-success' : 'bg-muted/10 text-muted'
}`}>
- {status.state?.toUpperCase() || 'UNKNOWN'}
+ {status.state?.toUpperCase() || t('common.unknown').toUpperCase()}
</span>
</h3>
- <p className="text-sm text-muted mt-1">PID: {status.pid || '-'}</p>
+ <p className="text-sm text-muted mt-1">PID: {status.service_pid || status.pid || '-'}</p>
</div>
<div className="flex gap-2">
{status.state !== 'running' && (
@@ -64,7 +168,7 @@ export const Dashboard: React.FC = () => {
disabled={loading}
className="flex items-center gap-2 px-4 py-2 bg-success text-white rounded-lg hover:bg-success/90 disabled:opacity-50 font-medium shadow-sm transition-colors"
>
- <Play size={16} /> Start
+ <Play size={16} /> {t('common.start')}
</button>
)}
{status.state === 'running' && (
@@ -73,7 +177,7 @@ export const Dashboard: React.FC = () => {
disabled={loading}
className="flex items-center gap-2 px-4 py-2 bg-danger text-white rounded-lg hover:bg-danger/90 disabled:opacity-50 font-medium shadow-sm transition-colors"
>
- <Square size={16} /> Stop
+ <Square size={16} /> {t('common.stop')}
</button>
)}
<button
@@ -81,85 +185,247 @@ export const Dashboard: React.FC = () => {
disabled={loading}
className="flex items-center gap-2 px-4 py-2 border border-border bg-white hover:bg-neutral-50 rounded-lg disabled:opacity-50 text-text font-medium transition-colors"
>
- <RotateCw size={16} /> Restart
+ <RotateCw size={16} /> {t('common.restart')}
</button>
</div>
</div>
- <div className="grid grid-cols-1 md:grid-cols-3 gap-6 border-t border-border pt-6">
+ <div className={`grid grid-cols-1 gap-6 border-t border-border pt-6 ${showWorkspaceGateway ? 'md:grid-cols-3' : 'md:grid-cols-1'}`}>
<div>
- <div className="text-sm text-muted mb-1">Mode</div>
+ <div className="text-sm text-muted mb-1">{t('dashboard.mode')}</div>
<div className="font-mono font-medium text-text capitalize">{config.mode || '-'}</div>
</div>
- <div>
- <div className="text-sm text-muted mb-1">Workspace</div>
- <div className="font-medium text-text">{config.slack?.team_name || '-'}</div>
- <div className="text-xs text-muted font-mono">{config.slack?.team_id || ''}</div>
- </div>
- <div>
- <div className="text-sm text-muted mb-1">Gateway</div>
- <div className="flex items-center gap-2">
- <div className={`w-2 h-2 rounded-full ${config.gateway?.relay_url ? 'bg-success' : 'bg-danger'}`}></div>
- <span className="text-text">{config.gateway?.relay_url ? 'Online' : 'Offline'}</span>
+ {showWorkspaceGateway && (
+ <div>
+ <div className="text-sm text-muted mb-1">{t('dashboard.workspace')}</div>
+ <div className="font-medium text-text">{config.slack?.team_name || '-'}</div>
+ <div className="text-xs text-muted font-mono">{config.slack?.team_id || ''}</div>
</div>
- </div>
+ )}
+ {showWorkspaceGateway && (
+ <div>
+ <div className="text-sm text-muted mb-1">{t('dashboard.gateway')}</div>
+ <div className="flex items-center gap-2">
+ <div className={`w-2 h-2 rounded-full ${config.gateway?.relay_url ? 'bg-success' : 'bg-danger'}`}></div>
+ <span className="text-text">{config.gateway?.relay_url ? t('common.online') : t('common.offline')}</span>
+ </div>
+ </div>
+ )}
</div>
</div>
{/* Quick Actions / Snapshots */}
- <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
- <div className="bg-panel rounded-xl border border-border p-6 shadow-sm">
- <div className="flex items-center justify-between mb-4">
- <h3 className="font-semibold flex items-center gap-2 text-text"><Activity size={18} /> Health</h3>
- <Link to="/doctor" className="text-sm text-accent hover:underline font-medium">View details</Link>
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
+ <div className="bg-panel rounded-xl border border-border p-6 shadow-sm">
+ <div className="flex items-center justify-between mb-4">
+ <h3 className="font-semibold flex items-center gap-2 text-text"><Activity size={18} /> {t('dashboard.health')}</h3>
+ <Link to="/doctor" className="text-sm text-accent hover:underline font-medium">{t('common.viewDetails')}</Link>
+ </div>
+ <div className={`flex items-center gap-2 font-medium ${doctor?.ok ? 'text-success' : 'text-warning'}`}>
+ <CheckCircle size={16} /> {doctor?.ok ? t('dashboard.allSystemsOperational') : t('dashboard.issuesDetected')}
+ </div>
+ </div>
+
+ <div className="bg-panel rounded-xl border border-border p-6 shadow-sm">
+ <div className="flex items-center justify-between mb-4">
+ <h3 className="font-semibold flex items-center gap-2 text-text"><Settings size={18} /> {t('dashboard.globalPolicy')}</h3>
+ <Link to="/setup" className="text-sm text-accent hover:underline font-medium">{t('common.editSetup')}</Link>
+ </div>
+ <div className="space-y-3 text-sm">
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.mode')}</span>
+ <span className="font-mono text-xs text-text capitalize">{config.mode || '-'}</span>
+ </div>
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.defaultBackend')}</span>
+ <span className="font-mono text-xs text-text">{config.agents?.default_backend || 'opencode'}</span>
</div>
- <div className={`flex items-center gap-2 font-medium ${doctor?.ok ? 'text-success' : 'text-warning'}`}>
- <CheckCircle size={16} /> {doctor?.ok ? 'All systems operational' : 'Issues detected'}
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.slackWorkspace')}</span>
+ <span className="text-xs text-text">{config.slack?.team_name || t('common.notLinked')}</span>
+ </div>
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.gateway')}</span>
+ <span className="text-xs text-text">{config.gateway?.relay_url ? t('common.online') : t('common.offline')}</span>
</div>
</div>
+ </div>
+
+ <div className="bg-panel rounded-xl border border-border p-6 shadow-sm">
+ <div className="flex items-center justify-between mb-4">
+ <h3 className="font-semibold flex items-center gap-2 text-text"><MessageSquare size={18} /> {t('dashboard.messageHandling')}</h3>
+ </div>
+ <div className="space-y-3 text-sm">
+ <div className="flex justify-between items-center">
+ <span className="text-muted flex items-center gap-1">
+ {t('dashboard.requireMention')}
+ <span className="relative group">
+ <Info size={12} className="text-muted/50 cursor-help" />
+ <span className="absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-text text-bg text-xs rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none">
+ {t('dashboard.requireMentionHint')}
+ </span>
+ </span>
+ </span>
+ <button
+ onClick={() => {
+ setSettingsMessage(null);
+ const newConfig = {
+ ...config,
+ slack: {
+ ...(config.slack || {}),
+ require_mention: !config.slack?.require_mention,
+ },
+ };
+ setConfig(newConfig);
+ autoSaveMessageConfig(newConfig);
+ }}
+ className={`px-2 py-1 rounded text-xs font-semibold border ${
+ config.slack?.require_mention
+ ? 'bg-success/10 text-success border-success/20'
+ : 'bg-neutral-100 text-muted border-border'
+ }`}
+ >
+ {config.slack?.require_mention ? t('common.enabled') : t('common.disabled')}
+ </button>
+
+ </div>
+ <div className="flex justify-between items-center">
+ <span className="text-muted flex items-center gap-1">
+ {t('dashboard.ackMode')}
+ <span className="relative group">
+ <Info size={12} className="text-muted/50 cursor-help" />
+ <span className="absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-text text-bg text-xs rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none">
+ {t('dashboard.ackModeHint')}
+ </span>
+ </span>
+ </span>
+ <select
+ value={config.ack_mode || 'reaction'}
+ onChange={(e) => {
+ const mode = e.target.value || 'reaction';
+ setSettingsMessage(null);
+ const newConfig = {
+ ...config,
+ ack_mode: mode,
+ };
+ setConfig(newConfig);
+ autoSaveMessageConfig(newConfig);
+ }}
+ className="w-36 bg-neutral-100 border border-border rounded px-2 py-1 text-xs font-mono"
+ >
+ <option value="reaction">{t('dashboard.ackReaction')}</option>
+ <option value="message">{t('dashboard.ackMessage')}</option>
+ </select>
+ </div>
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.allowedChannels')}</span>
+ <Link to="/channels" className="text-xs text-accent hover:underline font-medium">{t('common.manageChannels')}</Link>
+ </div>
+ </div>
+ </div>
+
+ <div className="bg-panel rounded-xl border border-border p-6 shadow-sm">
+ <div className="flex items-center justify-between mb-4">
+ <h3 className="font-semibold flex items-center gap-2 text-text"><Server size={18} /> {t('dashboard.consoleServer')}</h3>
+ </div>
+ <div className="space-y-3 text-sm">
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.host')}</span>
+ <input
+ type="text"
+ value={config.ui?.setup_host || '127.0.0.1'}
+ onChange={(e) => {
+ const host = e.target.value || '127.0.0.1';
+ setUiMessage(null);
+ setConfig((prev: any) => ({
+ ...prev,
+ ui: { ...(prev.ui || {}), setup_host: host },
+ }));
+ }}
+ className="w-40 bg-neutral-100 border border-border rounded px-2 py-1 text-xs font-mono"
+ />
+ </div>
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.port')}</span>
+ <input
+ type="number"
+ min={1024}
+ max={65535}
+ value={config.ui?.setup_port || 5123}
+ onChange={(e) => {
+ const port = Number(e.target.value) || 5123;
+ setUiMessage(null);
+ setConfig((prev: any) => ({
+ ...prev,
+ ui: { ...(prev.ui || {}), setup_port: port },
+ }));
+ }}
+ className="w-24 bg-neutral-100 border border-border rounded px-2 py-1 text-xs font-mono"
+ />
+ </div>
+ </div>
+ <div className="flex justify-between items-center mt-4 pt-4 border-t border-border">
+ {uiMessage && <span className="text-xs text-muted">{uiMessage}</span>}
+ {!uiMessage && <span />}
+ <button
+ onClick={handleUiSaveRestart}
+ disabled={uiSaving}
+ className="px-3 py-1.5 bg-accent text-white rounded-md text-xs font-semibold disabled:opacity-50 flex items-center gap-1"
+ >
+ <RotateCw size={12} /> {uiSaving ? t('common.saving') : t('common.saveAndRestart')}
+ </button>
+ </div>
+ </div>
+
+ <div className="bg-panel rounded-xl border border-border p-6 shadow-sm">
+ <div className="flex items-center justify-between mb-4">
+ <h3 className="font-semibold flex items-center gap-2 text-text"><Terminal size={18} /> {t('dashboard.diagnostics')}</h3>
+ <Link to="/doctor/logs" className="text-sm text-accent hover:underline font-medium">{t('common.viewLogs')}</Link>
+ </div>
+ <div className="space-y-3 text-sm">
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.logLevel')}</span>
+ <select
+ value={config.runtime?.log_level || 'INFO'}
+ onChange={(e) => {
+ const level = e.target.value || 'INFO';
+ setDiagnosticsMessage(null);
+ setConfig((prev: any) => ({
+ ...prev,
+ runtime: { ...(prev.runtime || {}), log_level: level },
+ }));
+ }}
+ className="w-28 bg-neutral-100 border border-border rounded px-2 py-1 text-xs font-mono"
+ >
+ {['DEBUG', 'INFO', 'WARNING', 'ERROR'].map((level) => (
+ <option key={level} value={level}>{level}</option>
+ ))}
+ </select>
+ </div>
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.configFile')}</span>
+ <code className="font-mono text-xs bg-neutral-100 px-2 py-1 rounded text-text">~/.vibe_remote/config/config.json</code>
+ </div>
+ <div className="flex justify-between items-center">
+ <span className="text-muted">{t('dashboard.logs')}</span>
+ <code className="font-mono text-xs bg-neutral-100 px-2 py-1 rounded text-text">~/.vibe_remote/logs/vibe_remote.log</code>
+ </div>
+ </div>
+ <div className="flex justify-between items-center mt-4 pt-4 border-t border-border">
+ {diagnosticsMessage && <span className="text-xs text-muted">{diagnosticsMessage}</span>}
+ {!diagnosticsMessage && <span />}
+ <button
+ onClick={handleDiagnosticsSaveRestart}
+ disabled={diagnosticsSaving}
+ className="px-3 py-1.5 bg-accent text-white rounded-md text-xs font-semibold disabled:opacity-50 flex items-center gap-1"
+ >
+ <RotateCw size={12} /> {diagnosticsSaving ? t('common.saving') : t('common.saveAndRestart')}
+ </button>
+ </div>
+ </div>
+ </div>
+
- <div className="bg-panel rounded-xl border border-border p-6 shadow-sm">
- <div className="flex items-center justify-between mb-4">
- <h3 className="font-semibold flex items-center gap-2 text-text"><Terminal size={18} /> Config</h3>
- <Link to="/setup" className="text-sm text-accent hover:underline font-medium">Edit setup</Link>
- </div>
- <div className="space-y-2 text-sm">
- <div className="flex justify-between items-center">
- <span className="text-muted">UI Port</span>
- <input
- type="number"
- min={1024}
- max={65535}
- value={config.ui?.setup_port || 5123}
- onChange={(e) => {
- const port = Number(e.target.value) || 5123;
- setConfig((prev: any) => ({
- ...prev,
- ui: { ...(prev.ui || {}), setup_port: port },
- }));
- }}
- onBlur={async (e) => {
- const port = Number(e.target.value) || 5123;
- await fetch('/config', {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ ...config, ui: { ...(config.ui || {}), setup_port: port } }),
- });
- }}
- className="w-24 bg-neutral-100 border border-border rounded px-2 py-1 text-xs font-mono"
- />
- </div>
- <div className="flex justify-between items-center">
- <span className="text-muted">Config File</span>
- <code className="font-mono text-xs bg-neutral-100 px-2 py-1 rounded text-text">~/.vibe_remote/config/config.json</code>
- </div>
- <div className="flex justify-between items-center">
- <span className="text-muted">Logs</span>
- <code className="font-mono text-xs bg-neutral-100 px-2 py-1 rounded text-text">~/.vibe_remote/logs/vibe_remote.log</code>
- </div>
- </div>
- </div>
- </div>
</div>
);
diff --git a/ui/src/components/LanguageSwitcher.tsx b/ui/src/components/LanguageSwitcher.tsx
new file mode 100644
index 000000000..cdc5ba09e
--- /dev/null
+++ b/ui/src/components/LanguageSwitcher.tsx
@@ -0,0 +1,35 @@
+import React from 'react';
+import { useTranslation } from 'react-i18next';
+import { Languages } from 'lucide-react';
+
+const languages = [
+ { code: 'en', label: 'English' },
+ { code: 'zh', label: '中文' },
+];
+
+export const LanguageSwitcher: React.FC = () => {
+ const { i18n } = useTranslation();
+
+ const currentLang = languages.find((l) => l.code === i18n.language) || languages[0];
+
+ const handleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
+ i18n.changeLanguage(e.target.value);
+ };
+
+ return (
+ <div className="flex items-center gap-2">
+ <Languages size={16} className="text-muted" />
+ <select
+ value={currentLang.code}
+ onChange={handleChange}
+ className="bg-transparent border border-border rounded px-2 py-1 text-sm text-text cursor-pointer hover:bg-neutral-50 focus:outline-none focus:ring-1 focus:ring-accent"
+ >
+ {languages.map((lang) => (
+ <option key={lang.code} value={lang.code}>
+ {lang.label}
+ </option>
+ ))}
+ </select>
+ </div>
+ );
+};
diff --git a/ui/src/components/Wizard.tsx b/ui/src/components/Wizard.tsx
index 6c9c3ccb0..27201d378 100644
--- a/ui/src/components/Wizard.tsx
+++ b/ui/src/components/Wizard.tsx
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
+import { useTranslation } from 'react-i18next';
import { Welcome } from './steps/Welcome';
import { ModeSelection } from './steps/ModeSelection';
import { AgentDetection } from './steps/AgentDetection';
@@ -7,6 +8,7 @@ import { SlackConfig } from './steps/SlackConfig';
import { ChannelList } from './steps/ChannelList';
import { Summary } from './steps/Summary';
import { useApi } from '../context/ApiContext';
+import { LanguageSwitcher } from './LanguageSwitcher';
import clsx from 'clsx';
const buildConfigPayload = (data: any) => ({
@@ -15,14 +17,11 @@ const buildConfigPayload = (data: any) => ({
slack: {
bot_token: data.slack?.bot_token || '',
app_token: data.slack?.app_token || '',
+ require_mention: data.slack?.require_mention || false,
},
runtime: {
default_cwd: data.default_cwd || '.',
log_level: 'INFO',
- require_mention: false,
- target_channels: Object.keys(data.channelConfigs || {}).filter(
- (id) => data.channelConfigs[id]?.enabled
- ),
},
agents: {
default_backend: data.default_backend || 'opencode',
@@ -45,7 +44,8 @@ const buildConfigPayload = (data: any) => ({
},
},
ui: {
- setup_port: 5123,
+ setup_host: data.ui?.setup_host || '127.0.0.1',
+ setup_port: data.ui?.setup_port || 5123,
open_browser: true,
},
});
@@ -60,6 +60,7 @@ const steps = [
];
export const Wizard: React.FC = () => {
+ const { t } = useTranslation();
const api = useApi();
const [currentStep, setCurrentStep] = useState(0);
const [data, setData] = useState<any>({});
@@ -117,7 +118,7 @@ export const Wizard: React.FC = () => {
const CurrentComponent = steps[currentStep].component;
- if (!loaded) return <div className="min-h-screen flex items-center justify-center bg-bg text-muted">Loading...</div>;
+ if (!loaded) return <div className="min-h-screen flex items-center justify-center bg-bg text-muted">{t('common.loading')}</div>;
return (
<div className="min-h-screen bg-bg flex flex-col items-center justify-center p-4 md:p-8">
@@ -125,24 +126,27 @@ export const Wizard: React.FC = () => {
{/* Header */}
<div className="bg-panel border-b border-border p-6 flex justify-between items-center relative z-10">
<div>
- <h1 className="text-xl font-bold text-text font-display">Vibe Remote Setup</h1>
+ <h1 className="text-xl font-bold text-text font-display">{t('wizard.title')}</h1>
</div>
- <div className="flex gap-2">
- {steps.map((s, i) => {
- if (s.id === 'welcome') return null; // Skip welcome dot
- const isCompleted = i < currentStep;
- const isCurrent = i === currentStep;
- return (
- <div key={s.id} className="flex flex-col items-center gap-1">
- <div
- className={clsx(
- "w-8 h-1 rounded-full transition-all duration-300",
- isCompleted ? 'bg-success' : isCurrent ? 'bg-accent' : 'bg-neutral-200'
- )}
- />
- </div>
- );
- })}
+ <div className="flex items-center gap-4">
+ <LanguageSwitcher />
+ <div className="flex gap-2">
+ {steps.map((s, i) => {
+ if (s.id === 'welcome') return null; // Skip welcome dot
+ const isCompleted = i < currentStep;
+ const isCurrent = i === currentStep;
+ return (
+ <div key={s.id} className="flex flex-col items-center gap-1">
+ <div
+ className={clsx(
+ "w-8 h-1 rounded-full transition-all duration-300",
+ isCompleted ? 'bg-success' : isCurrent ? 'bg-accent' : 'bg-neutral-200'
+ )}
+ />
+ </div>
+ );
+ })}
+ </div>
</div>
</div>
diff --git a/ui/src/components/steps/AgentDetection.tsx b/ui/src/components/steps/AgentDetection.tsx
index 36ff9f42a..689f563ba 100644
--- a/ui/src/components/steps/AgentDetection.tsx
+++ b/ui/src/components/steps/AgentDetection.tsx
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import { Check, X, RefreshCw, Search } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
import clsx from 'clsx';
import { useApi } from '../../context/ApiContext';
@@ -16,6 +17,7 @@ type AgentState = {
};
export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, onBack }) => {
+ const { t } = useTranslation();
const api = useApi();
const [checking, setChecking] = useState(false);
const [defaultBackend, setDefaultBackend] = useState<string>(data.default_backend || 'opencode');
@@ -69,19 +71,19 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
return (
<div className="flex flex-col h-full max-w-2xl mx-auto">
- <h2 className="text-3xl font-display font-bold mb-2 text-text">Agent Configuration</h2>
+ <h2 className="text-3xl font-display font-bold mb-2 text-text">{t('agentDetection.title')}</h2>
<p className="text-muted mb-6">
- Detect local CLI paths and choose enabled backends.
+ {t('agentDetection.subtitle')}
</p>
<div className="mb-6 p-4 border border-border rounded-xl bg-panel shadow-sm">
- <label className="text-sm font-medium text-muted uppercase">Default Backend</label>
+ <label className="text-sm font-medium text-muted uppercase">{t('agentDetection.defaultBackend')}</label>
<select
value={defaultBackend}
onChange={(e) => setDefaultBackend(e.target.value)}
className="mt-2 w-full bg-bg border border-border rounded px-3 py-2 text-sm"
>
- <option value="opencode">OpenCode (recommended)</option>
+ <option value="opencode">OpenCode {t('agentDetection.recommended')}</option>
<option value="claude">Claude</option>
<option value="codex">Codex</option>
</select>
@@ -92,7 +94,7 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
onClick={detectAll}
className="flex items-center gap-2 px-4 py-2 bg-neutral-100 hover:bg-neutral-200 text-text rounded-lg transition-colors font-medium text-sm"
>
- <Search size={16} /> Detect all
+ <Search size={16} /> {t('common.detectAll')}
</button>
</div>
@@ -102,7 +104,7 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
<div className="flex items-center justify-between mb-4">
<div>
<h3 className="font-semibold capitalize text-lg text-text font-display">{name}</h3>
- <p className="text-sm text-muted">CLI path detection and enablement</p>
+ <p className="text-sm text-muted">{t('agentDetection.cliPathDetection')}</p>
</div>
<StatusBadge status={agent.status || 'unknown'} loading={checking} />
</div>
@@ -115,17 +117,17 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
onChange={(e) => toggle(name, e.target.checked)}
className="w-4 h-4 text-accent rounded focus:ring-accent border-gray-300"
/>
- Enabled
+ {t('common.enabled')}
</label>
<div className="flex-1">
<div className="flex items-center gap-2 mb-2">
- <label className="text-xs font-medium text-muted uppercase">CLI Path</label>
+ <label className="text-xs font-medium text-muted uppercase">{t('agentDetection.cliPath')}</label>
{isMissing(agent) && (
- <span className="text-[10px] text-danger bg-danger/10 px-1.5 py-0.5 rounded border border-danger/20">Not Found</span>
+ <span className="text-[10px] text-danger bg-danger/10 px-1.5 py-0.5 rounded border border-danger/20">{t('common.notFound')}</span>
)}
{!isMissing(agent) && agent.status === 'ok' && (
- <span className="text-[10px] text-success bg-success/10 px-1.5 py-0.5 rounded border border-success/20">Found</span>
+ <span className="text-[10px] text-success bg-success/10 px-1.5 py-0.5 rounded border border-success/20">{t('common.found')}</span>
)}
</div>
<div className="flex gap-2">
@@ -136,7 +138,7 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
...prev,
[name]: { ...prev[name], cli_path: e.target.value }
}))}
- placeholder={`Path to ${name} CLI...`}
+ placeholder={t('agentDetection.cliPathPlaceholder', { name })}
className="flex-1 bg-bg border border-border rounded px-3 py-2 text-sm focus:outline-none focus:border-accent font-mono text-text"
/>
<button
@@ -144,7 +146,7 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
disabled={checking}
className="px-3 py-2 bg-neutral-100 hover:bg-neutral-200 rounded text-sm text-muted hover:text-text font-medium transition-colors border border-border"
>
- {checking ? <RefreshCw size={14} className="animate-spin" /> : 'Detect'}
+ {checking ? <RefreshCw size={14} className="animate-spin" /> : t('common.detect')}
</button>
</div>
</div>
@@ -159,7 +161,7 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
onClick={onBack}
className="px-6 py-2 text-muted hover:text-text font-medium transition-colors"
>
- Back
+ {t('common.back')}
</button>
<button
onClick={() => onNext({ agents, default_backend: defaultBackend })}
@@ -171,7 +173,7 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
: 'bg-neutral-200 text-muted cursor-not-allowed'
)}
>
- Continue
+ {t('common.continue')}
</button>
</div>
</div>
@@ -179,6 +181,8 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
};
const StatusBadge = ({ status, loading }: { status: 'unknown' | 'ok' | 'missing'; loading: boolean }) => {
+ const { t } = useTranslation();
+
if (loading) {
return (
<div className="animate-spin text-muted">
@@ -187,15 +191,15 @@ const StatusBadge = ({ status, loading }: { status: 'unknown' | 'ok' | 'missing'
);
}
if (status === 'unknown') {
- return <span className="text-sm text-muted italic">Not checked</span>;
+ return <span className="text-sm text-muted italic">{t('common.notChecked')}</span>;
}
return status === 'ok' ? (
<div className="flex items-center gap-2 text-success bg-success/10 px-3 py-1 rounded-full text-sm font-medium border border-success/20">
- <Check size={14} /> Found
+ <Check size={14} /> {t('common.found')}
</div>
) : (
<div className="flex items-center gap-2 text-danger bg-danger/10 px-3 py-1 rounded-full text-sm font-medium border border-danger/20">
- <X size={14} /> Missing
+ <X size={14} /> {t('common.missing')}
</div>
);
};
diff --git a/ui/src/components/steps/ChannelList.tsx b/ui/src/components/steps/ChannelList.tsx
index 9318ba958..f4d82f017 100644
--- a/ui/src/components/steps/ChannelList.tsx
+++ b/ui/src/components/steps/ChannelList.tsx
@@ -1,6 +1,8 @@
import React, { useEffect, useState } from 'react';
-import { Hash, CheckSquare, Square, RefreshCw, Save } from 'lucide-react';
+import { Hash, CheckSquare, Square, RefreshCw } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
import { useApi } from '../../context/ApiContext';
+import { useToast } from '../../context/ToastContext';
import clsx from 'clsx';
interface ChannelListProps {
@@ -12,6 +14,7 @@ interface ChannelListProps {
interface ChannelConfig {
enabled: boolean;
+ hidden_message_types: string[];
custom_cwd: string;
routing: {
agent_backend: string | null;
@@ -22,24 +25,30 @@ interface ChannelConfig {
}
export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onBack, isPage }) => {
+ const { t } = useTranslation();
const api = useApi();
+ const { showToast } = useToast();
const [loading, setLoading] = useState(false);
const [channels, setChannels] = useState<any[]>([]);
const [configs, setConfigs] = useState<Record<string, ChannelConfig>>(data.channelConfigs || {});
const [config, setConfig] = useState<any>(data);
- const [saved, setSaved] = useState(false);
const [opencodeOptions, setOpencodeOptions] = useState<any>(null);
+ const [selectedModels, setSelectedModels] = useState<Record<string, string>>({});
+
+ useEffect(() => {
+ if (!isPage) {
+ setConfigs(data.channelConfigs || {});
+ }
+ }, [data.channelConfigs, isPage]);
- // Load config if in page mode
useEffect(() => {
if (isPage) {
- api.getConfig().then(c => {
- setConfig(c);
- // Also need settings for channelConfigs
- api.getSettings().then(s => {
- setConfigs(s.channels || {});
- });
- });
+ api.getConfig().then(c => {
+ setConfig(c);
+ api.getSettings().then(s => {
+ setConfigs(s.channels || {});
+ });
+ });
}
}, [isPage]);
@@ -54,7 +63,7 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
setChannels(result.channels || []);
}
} catch (e) {
- console.error("Failed to load channels:", e);
+ console.error('Failed to load channels:', e);
} finally {
setLoading(false);
}
@@ -68,7 +77,7 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
setOpencodeOptions(result.data);
}
} catch (e) {
- console.error("Failed to load OpenCode options:", e);
+ console.error('Failed to load OpenCode options:', e);
}
};
@@ -84,31 +93,59 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
}
}, [config.agents?.opencode?.enabled]);
- const updateConfig = (channelId: string, patch: Partial<ChannelConfig>) => {
- setConfigs((prev) => {
- const base = prev[channelId] || defaultConfig();
- const next = { ...base, ...patch };
- if (!next.routing || typeof next.routing !== 'object') {
- next.routing = { agent_backend: config.agents?.default_backend || 'opencode' };
- }
- return { ...prev, [channelId]: next };
+ useEffect(() => {
+ if (!channels.length) return;
+ setSelectedModels((prev) => {
+ const next = { ...prev };
+ channels.forEach((channel) => {
+ const model = configs[channel.id]?.routing?.opencode_model || '';
+ if (next[channel.id] !== model) {
+ next[channel.id] = model;
+ }
+ });
+ return next;
});
- setSaved(false);
+ }, [channels, configs]);
+
+ const isChannelEnabled = (channelId: string) => {
+ const channel = configs[channelId];
+ return channel ? channel.enabled !== false : false;
};
- const handleSave = async () => {
- setLoading(true);
- try {
- await api.saveSettings({ channels: configs });
- setSaved(true);
- setTimeout(() => setSaved(false), 2000);
- } finally {
- setLoading(false);
- }
+ const persistConfigs = async (nextConfigs: Record<string, ChannelConfig>) => {
+ if (!isPage) {
+ setConfigs(nextConfigs);
+ return;
+ }
+
+ setLoading(true);
+ try {
+ await api.saveSettings({ channels: nextConfigs });
+ showToast(t('channelList.settingsSaved'));
+ } catch {
+ showToast(t('channelList.settingsSaveFailed'), 'error');
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const updateConfig = (channelId: string, patch: Partial<ChannelConfig>) => {
+ const base = configs[channelId] || defaultConfig();
+ const next = { ...base, ...patch };
+ if (!next.hidden_message_types || next.hidden_message_types.length === 0) {
+ next.hidden_message_types = defaultConfig().hidden_message_types;
+ }
+ if (!next.routing || typeof next.routing !== 'object') {
+ next.routing = { agent_backend: config.agents?.default_backend || 'opencode' };
+ }
+ const nextConfigs = { ...configs, [channelId]: next };
+ setConfigs(nextConfigs);
+ void persistConfigs(nextConfigs);
};
const defaultConfig = (): ChannelConfig => ({
- enabled: true,
+ enabled: false,
+ hidden_message_types: ['system', 'assistant', 'toolcall'],
custom_cwd: '',
routing: {
agent_backend: config.agents?.default_backend || 'opencode',
@@ -118,52 +155,64 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
},
});
- const selectedCount = channels.filter((channel) => {
- const rawConfig = configs[channel.id];
- if (!rawConfig) {
- return true;
+ const reasoningOptionsByModel = React.useMemo(() => {
+ const lookup = opencodeOptions?.reasoning_options || {};
+ if (lookup && typeof lookup === 'object') {
+ return lookup as Record<string, { value: string; label: string }[]>;
}
- return rawConfig.enabled !== false;
- }).length;
+ return {} as Record<string, { value: string; label: string }[]>;
+ }, [opencodeOptions]);
+
+ const getReasoningOptions = (modelKey: string) => reasoningOptionsByModel[modelKey] || [];
+
+ const selectedCount = channels.filter((channel) => isChannelEnabled(channel.id)).length;
return (
- <div className={clsx("flex flex-col h-full", isPage ? "max-w-5xl mx-auto" : "")}>
+ <div className={clsx('flex flex-col h-full', isPage ? 'max-w-5xl mx-auto' : '')}>
<div className="flex justify-between items-center mb-6">
- <div>
- <h2 className={clsx("font-display font-bold", isPage ? "text-3xl" : "text-2xl")}>Channel Settings</h2>
- <p className="text-muted">Enable channels and configure per-channel routing.</p>
- </div>
- {isPage && (
- <button
- onClick={handleSave}
- disabled={loading || saved}
- className="flex items-center gap-2 px-4 py-2 bg-accent text-white rounded-lg hover:bg-accent/90 disabled:opacity-50 transition-colors"
- >
- <Save size={16} /> {saved ? 'Saved' : 'Save Changes'}
- </button>
- )}
+ <div>
+ <h2 className={clsx('font-display font-bold', isPage ? 'text-3xl' : 'text-2xl')}>{t('channelList.title')}</h2>
+ <p className="text-muted">{t('channelList.subtitle')}</p>
+ </div>
</div>
- <div className="flex items-center justify-between mb-4 bg-panel border border-border p-3 rounded-lg">
- <div className="flex items-center gap-4">
+ <div className="mb-4 bg-panel border border-border p-4 rounded-lg space-y-3">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center gap-4">
<button
onClick={loadChannels}
className="flex items-center gap-2 px-3 py-1.5 bg-neutral-100 hover:bg-neutral-200 text-text rounded text-sm font-medium transition-colors"
>
- <RefreshCw size={14} className={loading ? 'animate-spin' : ''} /> Refresh List
+ <RefreshCw size={14} className={loading ? 'animate-spin' : ''} /> {t('channelList.refreshList')}
</button>
- {channels.length === 0 && !loading && <span className="text-sm text-warning">No channels found. Check token or invite bot.</span>}
+ {channels.length === 0 && !loading && (
+ <span className="text-sm text-warning">{t('channelList.noChannelsFound')}</span>
+ )}
+ </div>
+ <span className="text-sm text-muted font-mono">{t('channelList.enabledCount', { count: selectedCount })}</span>
</div>
- <span className="text-sm text-muted font-mono">{selectedCount} enabled</span>
+ {isPage && (
+ <div className="flex flex-wrap items-center gap-3 text-sm">
+ <span className="text-muted">{t('channelList.accessPolicy')}</span>
+ <span className="text-xs text-muted">{t('channelList.accessPolicyHint')}</span>
+ </div>
+ )}
</div>
<div className="flex-1 overflow-y-auto border border-border rounded-xl divide-y divide-border bg-panel shadow-sm">
+ {!loading && channels.length === 0 && !botToken && (
+ <div className="p-8 text-center text-muted">
+ {t('channelList.addTokenFirst')}
+ </div>
+ )}
{channels.map((channel) => {
const rawConfig = configs[channel.id] || {};
const def = defaultConfig();
const channelConfig = {
...def,
...rawConfig,
+ enabled: isChannelEnabled(channel.id),
+ hidden_message_types: rawConfig.hidden_message_types || def.hidden_message_types,
routing: {
...def.routing,
...(rawConfig.routing || {}),
@@ -175,7 +224,7 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
<div className="flex items-center gap-3">
<button
onClick={() => updateConfig(channel.id, { enabled: !channelConfig.enabled })}
- className={channelConfig.enabled ? "text-accent" : "text-muted"}
+ className={channelConfig.enabled ? 'text-accent' : 'text-muted'}
>
{channelConfig.enabled ? <CheckSquare size={20} /> : <Square size={20} />}
</button>
@@ -186,45 +235,84 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
<div className="text-xs text-muted font-mono">ID: {channel.id}</div>
</div>
</div>
- <span className={clsx("text-xs px-2 py-0.5 rounded-full border", channel.is_private ? "bg-warning/10 text-warning border-warning/20" : "bg-success/10 text-success border-success/20")}>
- {channel.is_private ? 'Private' : 'Public'}
+ <span
+ className={clsx(
+ 'text-xs px-2 py-0.5 rounded-full border',
+ channel.is_private
+ ? 'bg-warning/10 text-warning border-warning/20'
+ : 'bg-success/10 text-success border-success/20'
+ )}
+ >
+ {channel.is_private ? t('common.private') : t('common.public')}
</span>
</div>
{channelConfig.enabled && (
- <div className="mt-4 pl-8 space-y-3">
- <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
- <div className="space-y-1">
- <label className="text-xs font-medium text-muted uppercase">Working Directory</label>
+ <div className="mt-4 pl-8 space-y-4">
+ {/* Basic Settings */}
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
+ <div className="space-y-1">
+ <label className="text-xs font-medium text-muted uppercase">{t('channelList.workingDirectory')}</label>
+ <input
+ type="text"
+ placeholder={config.runtime?.default_cwd || t('channelList.useGlobalDefault')}
+ value={channelConfig.custom_cwd}
+ onChange={(e) => updateConfig(channel.id, { custom_cwd: e.target.value })}
+ className="w-full bg-bg border border-border rounded px-3 py-2 text-sm focus:outline-none focus:border-accent text-text placeholder:text-muted/50 font-mono"
+ />
+ </div>
+ <div className="space-y-1">
+ <label className="text-xs font-medium text-muted uppercase">{t('channelList.backend')}</label>
+ <select
+ value={channelConfig.routing.agent_backend || ''}
+ onChange={(e) =>
+ updateConfig(channel.id, {
+ routing: { ...channelConfig.routing, agent_backend: e.target.value || null },
+ })
+ }
+ className="w-full bg-bg border border-border rounded px-3 py-2 text-sm focus:outline-none focus:border-accent text-text"
+ >
+ <option value="">{t('common.default')} ({config.agents?.default_backend || 'opencode'})</option>
+ <option value="opencode">OpenCode</option>
+ <option value="claude">Claude</option>
+ <option value="codex">Codex</option>
+ </select>
+ </div>
+ </div>
+
+ {/* Hidden Message Types */}
+ <div className="space-y-2">
+ <div className="text-xs font-medium text-muted uppercase">{t('channelList.hiddenMessageTypes')}</div>
+ <div className="flex flex-wrap gap-3 text-sm">
+ {['system', 'assistant', 'toolcall'].map((msgType) => {
+ const checked = channelConfig.hidden_message_types.includes(msgType);
+ return (
+ <label key={msgType} className="flex items-center gap-2 text-text">
<input
- type="text"
- placeholder="Default (empty)"
- value={channelConfig.custom_cwd}
- onChange={(e) => updateConfig(channel.id, { custom_cwd: e.target.value })}
- className="w-full bg-bg border border-border rounded px-3 py-2 text-sm focus:outline-none focus:border-accent text-text placeholder:text-muted/50 font-mono"
+ type="checkbox"
+ checked={checked}
+ onChange={() => {
+ const next = checked
+ ? channelConfig.hidden_message_types.filter((value) => value !== msgType)
+ : [...channelConfig.hidden_message_types, msgType];
+ updateConfig(channel.id, { hidden_message_types: next });
+ }}
+ className="h-4 w-4 rounded border-border text-accent focus:ring-accent"
/>
- </div>
- <div className="space-y-1">
- <label className="text-xs font-medium text-muted uppercase">Backend</label>
- <select
- value={channelConfig.routing.agent_backend || ''}
- onChange={(e) =>
- updateConfig(channel.id, {
- routing: { ...channelConfig.routing, agent_backend: e.target.value || null },
- })
- }
- className="w-full bg-bg border border-border rounded px-3 py-2 text-sm focus:outline-none focus:border-accent text-text"
- >
- <option value="">Default ({config.agents?.default_backend || 'opencode'})</option>
- <option value="opencode">OpenCode</option>
- <option value="claude">Claude</option>
- <option value="codex">Codex</option>
- </select>
- </div>
+ <span className="capitalize">{msgType === 'toolcall' ? 'Toolcall' : msgType}</span>
+ </label>
+ );
+ })}
</div>
+ </div>
- {channelConfig.routing.agent_backend === 'opencode' && (
- <div className="grid grid-cols-1 md:grid-cols-3 gap-3 bg-bg/50 p-3 rounded border border-border">
+ {/* OpenCode Settings */}
+ {channelConfig.routing.agent_backend === 'opencode' && (
+ <div className="space-y-3">
+ <div className="text-xs font-medium text-muted uppercase">{t('channelList.opencodeSettings')}</div>
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-3 bg-bg/50 p-3 rounded border border-border">
+ <div className="space-y-1">
+ <label className="text-xs text-muted">{t('channelList.agent')}</label>
<select
value={channelConfig.routing.opencode_agent || ''}
onChange={(e) =>
@@ -232,23 +320,32 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
routing: { ...channelConfig.routing, opencode_agent: e.target.value || null },
})
}
- className="bg-panel border border-border rounded px-3 py-2 text-sm"
+ className="w-full bg-panel border border-border rounded px-3 py-2 text-sm"
>
- <option value="">Agent: Default</option>
+ <option value="">{t('common.default')}</option>
{(opencodeOptions?.agents || []).map((agent: any) => (
<option key={agent.name} value={agent.name}>{agent.name}</option>
))}
</select>
+ </div>
+ <div className="space-y-1">
+ <label className="text-xs text-muted">{t('channelList.model')}</label>
<select
value={channelConfig.routing.opencode_model || ''}
- onChange={(e) =>
+ onChange={(e) => {
+ const modelKey = e.target.value || '';
+ setSelectedModels((prev) => ({ ...prev, [channel.id]: modelKey }));
updateConfig(channel.id, {
- routing: { ...channelConfig.routing, opencode_model: e.target.value || null },
- })
- }
- className="bg-panel border border-border rounded px-3 py-2 text-sm"
+ routing: {
+ ...channelConfig.routing,
+ opencode_model: modelKey || null,
+ opencode_reasoning_effort: null,
+ },
+ });
+ }}
+ className="w-full bg-panel border border-border rounded px-3 py-2 text-sm"
>
- <option value="">Model: Default</option>
+ <option value="">{t('common.default')}</option>
{(opencodeOptions?.models?.providers || []).flatMap((provider: any) => {
const providerId = provider.id || provider.provider_id || provider.name;
const providerLabel = provider.name || providerId;
@@ -270,6 +367,9 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
));
})}
</select>
+ </div>
+ <div className="space-y-1">
+ <label className="text-xs text-muted">{t('channelList.reasoningEffort')}</label>
<select
value={channelConfig.routing.opencode_reasoning_effort || ''}
onChange={(e) =>
@@ -280,40 +380,44 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
},
})
}
- className="bg-panel border border-border rounded px-3 py-2 text-sm"
+ disabled={!getReasoningOptions(selectedModels[channel.id] || channelConfig.routing.opencode_model || '').length}
+ className="w-full bg-panel border border-border rounded px-3 py-2 text-sm disabled:opacity-50"
>
- <option value="">Reasoning: Default</option>
- <option value="low">Low</option>
- <option value="medium">Medium</option>
- <option value="high">High</option>
- <option value="xhigh">Extra High</option>
+ <option value="">{t('common.default')}</option>
+ {getReasoningOptions(selectedModels[channel.id] || channelConfig.routing.opencode_model || '').map((option) => (
+ <option key={option.value} value={option.value}>
+ {option.label}
+ </option>
+ ))}
</select>
</div>
- )}
- </div>
+ </div>
+ </div>
+ )}
+ </div>
)}
</div>
);
})}
{channels.length === 0 && !loading && (
<div className="p-8 text-center text-muted">
- No channels loaded.
+ {t('channelList.noChannelsLoaded')}
</div>
)}
</div>
{!isPage && (
- <div className="mt-6 flex justify-between">
- <button onClick={onBack} className="px-6 py-2 text-muted hover:text-text font-medium">
- Back
- </button>
- <button
- onClick={() => onNext && onNext({ channelConfigs: configs })}
- className="px-6 py-2 bg-accent hover:bg-accent/90 text-white rounded-lg font-medium shadow-sm"
- >
- Continue
- </button>
- </div>
+ <div className="mt-6 flex justify-between">
+ <button onClick={onBack} className="px-6 py-2 text-muted hover:text-text font-medium">
+ {t('common.back')}
+ </button>
+ <button
+ onClick={() => onNext && onNext({ channelConfigs: configs })}
+ className="px-6 py-2 bg-accent hover:bg-accent/90 text-white rounded-lg font-medium shadow-sm"
+ >
+ {t('common.continue')}
+ </button>
+ </div>
)}
</div>
);
diff --git a/ui/src/components/steps/DoctorPanel.tsx b/ui/src/components/steps/DoctorPanel.tsx
index 6747cd95f..4f55a5de2 100644
--- a/ui/src/components/steps/DoctorPanel.tsx
+++ b/ui/src/components/steps/DoctorPanel.tsx
@@ -1,6 +1,8 @@
import React, { useEffect, useState } from 'react';
-import { Activity, RefreshCw, CheckCircle, AlertTriangle, XCircle, Copy } from 'lucide-react';
+import { Activity, RefreshCw, CheckCircle, AlertTriangle, XCircle, Copy, FileText } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
import { useApi } from '../../context/ApiContext';
+import { Link } from 'react-router-dom';
import clsx from 'clsx';
interface DoctorPanelProps {
@@ -8,6 +10,7 @@ interface DoctorPanelProps {
}
export const DoctorPanel: React.FC<DoctorPanelProps> = ({ isPage }) => {
+ const { t } = useTranslation();
const api = useApi();
const [loading, setLoading] = useState(false);
const [results, setResults] = useState<any>(null);
@@ -40,15 +43,21 @@ export const DoctorPanel: React.FC<DoctorPanelProps> = ({ isPage }) => {
<div className="flex items-center justify-between mb-6">
<h2 className={clsx("font-display font-bold flex items-center gap-2", isPage ? "text-3xl" : "text-xl")}>
<Activity className="text-accent" />
- System Status
+ {t('doctor.title')}
</h2>
<div className="flex gap-2">
+ <Link
+ to="/doctor/logs"
+ className="flex items-center gap-2 px-3 py-2 border border-border rounded-lg text-sm text-muted hover:bg-neutral-50 hover:text-text transition-colors"
+ >
+ <FileText size={16} /> {t('common.viewLogs')}
+ </Link>
{results && (
<button
onClick={() => navigator.clipboard.writeText(JSON.stringify(results, null, 2))}
className="flex items-center gap-2 px-3 py-2 border border-border rounded-lg text-sm text-muted hover:bg-neutral-50 hover:text-text transition-colors"
>
- <Copy size={16} /> Copy Report
+ <Copy size={16} /> {t('doctor.copyReport')}
</button>
)}
<button
@@ -56,7 +65,7 @@ export const DoctorPanel: React.FC<DoctorPanelProps> = ({ isPage }) => {
disabled={loading}
className="flex items-center gap-2 px-4 py-2 bg-accent text-white rounded-lg hover:bg-accent/90 disabled:opacity-50 transition-colors font-medium shadow-sm"
>
- <RefreshCw size={16} className={loading ? 'animate-spin' : ''} /> Run Checks
+ <RefreshCw size={16} className={loading ? 'animate-spin' : ''} /> {t('doctor.runChecks')}
</button>
</div>
</div>
@@ -89,15 +98,15 @@ export const DoctorPanel: React.FC<DoctorPanelProps> = ({ isPage }) => {
<div className="grid grid-cols-3 gap-4">
<div className="bg-success/10 border border-success/20 rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-success">{results.summary?.pass || 0}</div>
- <div className="text-sm text-success/80 font-medium">Passed</div>
+ <div className="text-sm text-success/80 font-medium">{t('doctor.passed')}</div>
</div>
<div className="bg-warning/10 border border-warning/20 rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-warning">{results.summary?.warn || 0}</div>
- <div className="text-sm text-warning/80 font-medium">Warnings</div>
+ <div className="text-sm text-warning/80 font-medium">{t('doctor.warnings')}</div>
</div>
<div className="bg-danger/10 border border-danger/20 rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-danger">{results.summary?.fail || 0}</div>
- <div className="text-sm text-danger/80 font-medium">Failed</div>
+ <div className="text-sm text-danger/80 font-medium">{t('doctor.failed')}</div>
</div>
</div>
</div>
diff --git a/ui/src/components/steps/LogsPanel.tsx b/ui/src/components/steps/LogsPanel.tsx
new file mode 100644
index 000000000..9b315e249
--- /dev/null
+++ b/ui/src/components/steps/LogsPanel.tsx
@@ -0,0 +1,272 @@
+import React, { useEffect, useState, useMemo, useRef } from 'react';
+import { FileText, RefreshCw, Search, Filter, ArrowDown, Pause, Play } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
+import { useApi, type LogEntry } from '../../context/ApiContext';
+import clsx from 'clsx';
+
+type LogLevel = 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR' | 'ALL';
+
+const LOG_LEVEL_COLORS: Record<string, { bg: string; text: string; border: string }> = {
+ DEBUG: { bg: 'bg-neutral-100', text: 'text-neutral-500', border: 'border-neutral-200' },
+ INFO: { bg: 'bg-blue-50', text: 'text-blue-600', border: 'border-blue-200' },
+ WARNING: { bg: 'bg-yellow-50', text: 'text-yellow-600', border: 'border-yellow-200' },
+ ERROR: { bg: 'bg-red-50', text: 'text-red-600', border: 'border-red-200' },
+};
+
+// Parse file location from message like "[__init__.py:246] - actual message"
+const parseLogMessage = (message: string): { location?: string; content: string } => {
+ const match = message.match(/^\[([^\]]+)\]\s*-?\s*(.*)$/s);
+ if (match) {
+ return { location: match[1], content: match[2] };
+ }
+ return { content: message };
+};
+
+export const LogsPanel: React.FC = () => {
+ const { t } = useTranslation();
+ const api = useApi();
+ const [logs, setLogs] = useState<LogEntry[]>([]);
+ const [loading, setLoading] = useState(false);
+ const [logsTotal, setLogsTotal] = useState(0);
+ const [searchQuery, setSearchQuery] = useState('');
+ const [levelFilter, setLevelFilter] = useState<LogLevel>('ALL');
+ const [autoRefresh, setAutoRefresh] = useState(false);
+ const logsContainerRef = useRef<HTMLDivElement>(null);
+ const autoRefreshRef = useRef<ReturnType<typeof setInterval> | null>(null);
+
+ const loadLogs = async () => {
+ setLoading(true);
+ try {
+ const res = await api.getLogs(2000);
+ setLogs(res.logs);
+ setLogsTotal(res.total);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ useEffect(() => {
+ loadLogs();
+ }, []);
+
+ // Auto-refresh logic
+ useEffect(() => {
+ if (autoRefresh) {
+ autoRefreshRef.current = setInterval(loadLogs, 5000);
+ } else if (autoRefreshRef.current) {
+ clearInterval(autoRefreshRef.current);
+ autoRefreshRef.current = null;
+ }
+ return () => {
+ if (autoRefreshRef.current) {
+ clearInterval(autoRefreshRef.current);
+ }
+ };
+ }, [autoRefresh]);
+
+ // Auto-scroll to bottom when new logs arrive
+ useEffect(() => {
+ if (logsContainerRef.current) {
+ logsContainerRef.current.scrollTop = 0; // Since we reverse the list, top is newest
+ }
+ }, [logs]);
+
+ // Filter logs based on search and level
+ const filteredLogs = useMemo(() => {
+ return logs.filter((log) => {
+ const matchesLevel = levelFilter === 'ALL' || log.level === levelFilter;
+ const matchesSearch = !searchQuery ||
+ log.message.toLowerCase().includes(searchQuery.toLowerCase()) ||
+ log.logger.toLowerCase().includes(searchQuery.toLowerCase()) ||
+ log.timestamp.includes(searchQuery);
+ return matchesLevel && matchesSearch;
+ });
+ }, [logs, levelFilter, searchQuery]);
+
+ // Count logs by level
+ const levelCounts = useMemo(() => {
+ const counts: Record<string, number> = { DEBUG: 0, INFO: 0, WARNING: 0, ERROR: 0 };
+ logs.forEach((log) => {
+ if (counts[log.level] !== undefined) {
+ counts[log.level]++;
+ }
+ });
+ return counts;
+ }, [logs]);
+
+ const LogLevelBadge = ({ level }: { level: string }) => {
+ const colors = LOG_LEVEL_COLORS[level] || LOG_LEVEL_COLORS.INFO;
+ return (
+ <span className={clsx(
+ 'px-1.5 py-0.5 rounded text-xs font-medium border min-w-[60px] text-center inline-block',
+ colors.bg, colors.text, colors.border
+ )}>
+ {level}
+ </span>
+ );
+ };
+
+ const scrollToBottom = () => {
+ if (logsContainerRef.current) {
+ logsContainerRef.current.scrollTop = 0;
+ }
+ };
+
+ return (
+ <div className="max-w-6xl mx-auto flex flex-col h-full">
+ <div className="flex items-center justify-between mb-6">
+ <h2 className="text-3xl font-display font-bold flex items-center gap-2">
+ <FileText className="text-accent" />
+ {t('logs.title')}
+ </h2>
+ <div className="flex gap-2">
+ <button
+ onClick={() => setAutoRefresh(!autoRefresh)}
+ className={clsx(
+ 'flex items-center gap-2 px-3 py-2 border rounded-lg text-sm transition-colors',
+ autoRefresh
+ ? 'bg-accent/10 border-accent text-accent'
+ : 'border-border text-muted hover:bg-neutral-50 hover:text-text'
+ )}
+ >
+ {autoRefresh ? <Pause size={16} /> : <Play size={16} />}
+ {autoRefresh ? t('logs.autoRefreshOn') : t('logs.autoRefresh')}
+ </button>
+ <button
+ onClick={loadLogs}
+ disabled={loading}
+ className="flex items-center gap-2 px-4 py-2 bg-accent text-white rounded-lg hover:bg-accent/90 disabled:opacity-50 transition-colors font-medium shadow-sm"
+ >
+ <RefreshCw size={16} className={loading ? 'animate-spin' : ''} />
+ {t('common.refresh')}
+ </button>
+ </div>
+ </div>
+
+ <div className="space-y-4 flex-1 flex flex-col min-h-0">
+ {/* Search and Filter Bar */}
+ <div className="flex gap-3 items-center flex-wrap">
+ <div className="relative flex-1 min-w-[200px]">
+ <Search size={16} className="absolute left-3 top-1/2 -translate-y-1/2 text-muted" />
+ <input
+ type="text"
+ placeholder={t('logs.searchPlaceholder')}
+ value={searchQuery}
+ onChange={(e) => setSearchQuery(e.target.value)}
+ className="w-full pl-10 pr-4 py-2 border border-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent"
+ />
+ </div>
+ <div className="flex items-center gap-2">
+ <Filter size={16} className="text-muted" />
+ <select
+ value={levelFilter}
+ onChange={(e) => setLevelFilter(e.target.value as LogLevel)}
+ className="px-3 py-2 border border-border rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-accent/20"
+ >
+ <option value="ALL">{t('logs.allLevels')}</option>
+ <option value="ERROR">{t('logs.error')} ({levelCounts.ERROR})</option>
+ <option value="WARNING">{t('logs.warning')} ({levelCounts.WARNING})</option>
+ <option value="INFO">{t('logs.info')} ({levelCounts.INFO})</option>
+ <option value="DEBUG">{t('logs.debug')} ({levelCounts.DEBUG})</option>
+ </select>
+ </div>
+ </div>
+
+ {/* Level Quick Filters */}
+ <div className="flex gap-2 flex-wrap">
+ {(['ALL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] as LogLevel[]).map((level) => (
+ <button
+ key={level}
+ onClick={() => setLevelFilter(level)}
+ className={clsx(
+ 'px-3 py-1 rounded-full text-xs font-medium border transition-colors',
+ levelFilter === level
+ ? 'bg-accent text-white border-accent'
+ : 'bg-white text-muted border-border hover:border-accent/50'
+ )}
+ >
+ {level === 'ALL' ? t('logs.all') : level}
+ {level !== 'ALL' && ` (${levelCounts[level]})`}
+ </button>
+ ))}
+ </div>
+
+ {/* Logs List */}
+ <div className="bg-panel border border-border rounded-xl overflow-hidden shadow-sm flex-1 flex flex-col min-h-0">
+ <div className="px-4 py-3 bg-neutral-50 border-b border-border flex justify-between items-center flex-shrink-0">
+ <span className="font-semibold text-sm text-muted">
+ {t('logs.entriesCount', { filtered: filteredLogs.length, total: logs.length })}
+ {logsTotal > logs.length && ` ${t('logs.totalInFile', { total: logsTotal })}`}
+ </span>
+ <div className="flex items-center gap-3">
+ <button
+ onClick={scrollToBottom}
+ className="text-xs text-accent hover:underline flex items-center gap-1"
+ >
+ <ArrowDown size={12} /> {t('logs.jumpToLatest')}
+ </button>
+ <code className="text-xs text-muted bg-neutral-100 px-2 py-1 rounded">
+ ~/.vibe_remote/logs/vibe_remote.log
+ </code>
+ </div>
+ </div>
+
+ {loading && logs.length === 0 ? (
+ <div className="p-8 text-center text-muted flex-1 flex items-center justify-center">
+ <div>
+ <RefreshCw size={24} className="animate-spin mx-auto mb-2" />
+ {t('logs.loadingLogs')}
+ </div>
+ </div>
+ ) : filteredLogs.length === 0 ? (
+ <div className="p-8 text-center text-muted flex-1 flex items-center justify-center">
+ {logs.length === 0 ? t('logs.noLogsAvailable') : t('logs.noLogsMatch')}
+ </div>
+ ) : (
+ <div
+ ref={logsContainerRef}
+ className="divide-y divide-border overflow-y-auto flex-1 font-mono text-sm"
+ style={{ minHeight: '500px', maxHeight: 'calc(100vh - 380px)' }}
+ >
+ {filteredLogs.slice().reverse().map((log, i) => {
+ const { location, content } = parseLogMessage(log.message);
+ return (
+ <div
+ key={i}
+ className={clsx(
+ 'p-3 hover:bg-neutral-50/50 transition-colors',
+ log.level === 'ERROR' && 'bg-red-50/30',
+ log.level === 'WARNING' && 'bg-yellow-50/30'
+ )}
+ >
+ <div className="flex items-center gap-2 flex-wrap">
+ <span className="text-muted text-xs whitespace-nowrap">
+ {log.timestamp}
+ </span>
+ <LogLevelBadge level={log.level} />
+ <span className="text-muted text-xs truncate max-w-[200px]" title={log.logger}>
+ {log.logger}
+ </span>
+ {location && (
+ <span className="text-muted/60 text-xs font-normal">
+ [{location}]
+ </span>
+ )}
+ </div>
+ <div className={clsx(
+ 'mt-1.5 whitespace-pre-wrap break-words leading-relaxed',
+ log.level === 'ERROR' ? 'text-red-700' :
+ log.level === 'WARNING' ? 'text-yellow-700' : 'text-text'
+ )}>
+ {content}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ );
+};
diff --git a/ui/src/components/steps/ModeSelection.tsx b/ui/src/components/steps/ModeSelection.tsx
index d25500eab..e971ad4a4 100644
--- a/ui/src/components/steps/ModeSelection.tsx
+++ b/ui/src/components/steps/ModeSelection.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import clsx from 'clsx';
import { Cloud, Server } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
interface ModeSelectionProps {
data: any;
@@ -8,41 +9,50 @@ interface ModeSelectionProps {
onBack: () => void;
}
-const modes = [
- {
- id: 'saas',
- title: 'SaaS Mode (Recommended)',
- description: 'Fastest setup: OAuth install + cloud relay + local execution.',
- icon: Cloud,
- },
- {
- id: 'self_host',
- title: 'Self-host Mode',
- description: 'Use your own Slack app + Socket Mode tokens.',
- icon: Server,
- },
-];
-
export const ModeSelection: React.FC<ModeSelectionProps> = ({ data, onNext, onBack }) => {
- const [selected, setSelected] = React.useState(data.mode || 'saas');
+ const { t } = useTranslation();
+ const [selected, setSelected] = React.useState(data.mode || 'self_host');
+
+ const modes = [
+ {
+ id: 'saas',
+ title: t('modeSelection.saasMode'),
+ description: t('modeSelection.saasDescription'),
+ icon: Cloud,
+ disabled: true,
+ },
+ {
+ id: 'self_host',
+ title: t('modeSelection.selfHostMode'),
+ description: t('modeSelection.selfHostDescription'),
+ icon: Server,
+ },
+ ];
return (
<div className="flex flex-col h-full max-w-2xl mx-auto">
- <h2 className="text-3xl font-display font-bold mb-6 text-text">Choose Mode</h2>
+ <h2 className="text-3xl font-display font-bold mb-6 text-text">{t('modeSelection.title')}</h2>
<div className="grid gap-4 mb-8">
{modes.map((m) => {
const isSelected = selected === m.id;
const Icon = m.icon;
+ const isDisabled = m.disabled;
return (
<button
key={m.id}
- onClick={() => setSelected(m.id)}
+ onClick={() => {
+ if (!isDisabled) {
+ setSelected(m.id);
+ }
+ }}
+ disabled={isDisabled}
className={clsx(
'flex items-start gap-4 p-6 rounded-xl border-2 text-left transition-all',
isSelected
? 'border-accent bg-accent/5 shadow-md'
- : 'border-border hover:border-accent/50 bg-panel'
+ : 'border-border bg-panel',
+ isDisabled ? 'opacity-50 cursor-not-allowed' : 'hover:border-accent/50'
)}
>
<div className={clsx("p-3 rounded-lg", isSelected ? "bg-accent/10 text-accent" : "bg-neutral-100 text-muted")}>
@@ -59,13 +69,13 @@ export const ModeSelection: React.FC<ModeSelectionProps> = ({ data, onNext, onBa
<div className="mt-auto flex justify-between">
<button onClick={onBack} className="px-6 py-2 text-muted hover:text-text font-medium">
- Back
+ {t('common.back')}
</button>
<button
onClick={() => onNext({ mode: selected })}
className="px-8 py-3 bg-accent hover:bg-accent/90 text-white rounded-lg font-medium transition-colors shadow-sm"
>
- Continue
+ {t('common.continue')}
</button>
</div>
</div>
diff --git a/ui/src/components/steps/SlackConfig.tsx b/ui/src/components/steps/SlackConfig.tsx
index 76f980b26..433d23fe7 100644
--- a/ui/src/components/steps/SlackConfig.tsx
+++ b/ui/src/components/steps/SlackConfig.tsx
@@ -1,5 +1,6 @@
import React, { useMemo, useState } from 'react';
import { Lock, Shield, RefreshCw } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
import clsx from 'clsx';
import { useApi } from '../../context/ApiContext';
@@ -10,6 +11,7 @@ interface SlackConfigProps {
}
export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }) => {
+ const { t } = useTranslation();
const api = useApi();
const [botToken, setBotToken] = useState(data.slack?.bot_token || data.slackBotToken || '');
const [appToken, setAppToken] = useState(data.slack?.app_token || data.slackAppToken || '');
@@ -36,26 +38,26 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }
return (
<div className="flex flex-col h-full max-w-2xl mx-auto">
- <h2 className="text-3xl font-display font-bold mb-2 text-text">Slack Configuration</h2>
+ <h2 className="text-3xl font-display font-bold mb-2 text-text">{t('slackConfig.title')}</h2>
<p className="text-muted mb-8">
{mode === 'saas'
- ? 'Authorize the official Slack app and wait for workspace binding.'
- : 'Provide bot and app tokens for Socket Mode.'}
+ ? t('slackConfig.saasDescription')
+ : t('slackConfig.selfHostDescription')}
</p>
{mode === 'saas' ? (
<div className="flex flex-col items-center justify-center h-64 border-2 border-dashed border-border rounded-xl bg-neutral-50">
- <p className="text-muted mb-6 text-center max-w-xs">Open OAuth in your browser to authorize Vibe Remote with your Slack workspace.</p>
+ <p className="text-muted mb-6 text-center max-w-xs">{t('slackConfig.oauthPrompt')}</p>
<button className="px-6 py-3 bg-accent text-white rounded-lg font-medium hover:bg-accent/90 transition-colors shadow-sm">
- Open Slack OAuth
+ {t('slackConfig.openSlackOAuth')}
</button>
- <p className="text-xs text-muted mt-6">After authorization, return here to continue.</p>
+ <p className="text-xs text-muted mt-6">{t('slackConfig.afterAuth')}</p>
</div>
) : (
<div className="space-y-6">
<div className="space-y-2">
<label className="text-sm font-medium text-text flex items-center gap-2">
- <Shield size={16} className="text-accent" /> Bot User OAuth Token
+ <Shield size={16} className="text-accent" /> {t('slackConfig.botToken')}
</label>
<input
type="password"
@@ -64,12 +66,12 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }
placeholder="xoxb-..."
className="w-full bg-bg border border-border rounded-lg p-3 text-text focus:outline-none focus:border-accent font-mono transition-colors shadow-sm"
/>
- <p className="text-xs text-muted pl-1">Starts with <code className="bg-neutral-100 px-1 rounded">xoxb-</code></p>
+ <p className="text-xs text-muted pl-1">{t('slackConfig.botTokenHint')} <code className="bg-neutral-100 px-1 rounded">xoxb-</code></p>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-text flex items-center gap-2">
- <Lock size={16} className="text-accent" /> App-Level Token
+ <Lock size={16} className="text-accent" /> {t('slackConfig.appToken')}
</label>
<input
type="password"
@@ -78,7 +80,7 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }
placeholder="xapp-..."
className="w-full bg-bg border border-border rounded-lg p-3 text-text focus:outline-none focus:border-accent font-mono transition-colors shadow-sm"
/>
- <p className="text-xs text-muted pl-1">Starts with <code className="bg-neutral-100 px-1 rounded">xapp-</code></p>
+ <p className="text-xs text-muted pl-1">{t('slackConfig.botTokenHint')} <code className="bg-neutral-100 px-1 rounded">xapp-</code></p>
</div>
<div className="flex items-center gap-3 pt-2">
@@ -87,19 +89,19 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }
className="px-4 py-2 bg-neutral-100 hover:bg-neutral-200 text-text rounded-lg flex items-center gap-2 transition-colors font-medium border border-border"
>
{checking ? <RefreshCw size={16} className="animate-spin" /> : <RefreshCw size={16} />}
- Validate Tokens
+ {t('slackConfig.validateTokens')}
</button>
{authResult && (
<span className={clsx('flex items-center gap-2 text-sm font-medium px-3 py-1.5 rounded-lg border', authResult.ok ? 'text-success bg-success/10 border-success/20' : 'text-danger bg-danger/10 border-danger/20')}>
{authResult.ok ? (
<>
<Shield size={14} />
- <span>Success: Token Validated</span>
+ <span>{t('slackConfig.tokenValidated')}</span>
</>
) : (
<>
<Shield size={14} />
- <span>Auth failed: {authResult.error}</span>
+ <span>{t('slackConfig.authFailed')}: {authResult.error}</span>
</>
)}
</span>
@@ -113,7 +115,7 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }
onClick={onBack}
className="px-6 py-2 text-muted hover:text-text font-medium transition-colors"
>
- Back
+ {t('common.back')}
</button>
<button
onClick={() => onNext({ slack: { bot_token: botToken, app_token: appToken }, mode })}
@@ -123,7 +125,7 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }
isValid ? 'bg-accent hover:bg-accent/90 text-white' : 'bg-neutral-200 text-muted cursor-not-allowed'
)}
>
- Continue
+ {t('common.continue')}
</button>
</div>
</div>
diff --git a/ui/src/components/steps/Summary.tsx b/ui/src/components/steps/Summary.tsx
index 7e57c50b6..bb42a23ac 100644
--- a/ui/src/components/steps/Summary.tsx
+++ b/ui/src/components/steps/Summary.tsx
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import { CheckCircle2 } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
import { useApi } from '../../context/ApiContext';
import { useStatus } from '../../context/StatusContext';
import { useNavigate } from 'react-router-dom';
@@ -13,6 +14,7 @@ interface SummaryProps {
}
export const Summary: React.FC<SummaryProps> = ({ data, onBack }) => {
+ const { t } = useTranslation();
const api = useApi();
const { control } = useStatus();
const [saving, setSaving] = useState(false);
@@ -49,17 +51,17 @@ export const Summary: React.FC<SummaryProps> = ({ data, onBack }) => {
<CheckCircle2 size={32} />
</div>
<div>
- <h2 className="text-2xl font-display font-bold text-text">Review & Finish</h2>
- <p className="text-muted">Confirm settings and start Vibe Remote.</p>
+ <h2 className="text-2xl font-display font-bold text-text">{t('summary.title')}</h2>
+ <p className="text-muted">{t('summary.subtitle')}</p>
</div>
</div>
<div className="flex-1 space-y-4 overflow-y-auto mb-6">
- <Section title="Mode" value={data.mode} />
- <Section title="Slack Bot Token" value={mask(data.slack?.bot_token || '')} />
- <Section title="Slack App Token" value={mask(data.slack?.app_token || '')} />
- <Section title="Enabled Agents" value={enabledAgents(data).join(', ')} />
- <Section title="Channels Configured" value={Object.keys(data.channelConfigs || {}).filter(k => data.channelConfigs[k]?.enabled).length} />
+ <Section title={t('summary.mode')} value={data.mode} />
+ <Section title={t('summary.slackBotToken')} value={mask(data.slack?.bot_token || '')} />
+ <Section title={t('summary.slackAppToken')} value={mask(data.slack?.app_token || '')} />
+ <Section title={t('summary.enabledAgents')} value={enabledAgents(data).join(', ')} />
+ <Section title={t('summary.channelsConfigured')} value={Object.keys(data.channelConfigs || {}).filter(k => data.channelConfigs[k]?.enabled).length} />
</div>
{error && (
@@ -73,14 +75,14 @@ export const Summary: React.FC<SummaryProps> = ({ data, onBack }) => {
onClick={onBack}
className="px-6 py-2 text-muted hover:text-text font-medium transition-colors"
>
- Back
+ {t('common.back')}
</button>
<button
onClick={saveAll}
disabled={saving}
className="px-8 py-3 bg-success hover:bg-success/90 text-white rounded-lg font-bold transition-colors shadow-sm"
>
- {saving ? 'Saving...' : 'Finish & Start'}
+ {saving ? t('common.saving') : t('summary.finishAndStart')}
</button>
</div>
</div>
@@ -109,14 +111,11 @@ const buildConfigPayload = (data: any) => {
slack: {
bot_token: data.slack?.bot_token || '',
app_token: data.slack?.app_token || '',
+ require_mention: data.slack?.require_mention || false,
},
runtime: {
default_cwd: data.default_cwd || '/Users/cyh/PycharmProjects/vibe-remote/_tmp', // Use default if empty
log_level: 'INFO',
- require_mention: false,
- target_channels: Object.keys(data.channelConfigs || {}).filter(
- (id) => data.channelConfigs[id]?.enabled
- ),
},
agents: {
default_backend: data.default_backend || 'opencode',
@@ -139,7 +138,8 @@ const buildConfigPayload = (data: any) => {
},
},
ui: {
- setup_port: 5123,
+ setup_host: data.ui?.setup_host || '127.0.0.1',
+ setup_port: data.ui?.setup_port || 5123,
open_browser: true,
},
};
@@ -153,7 +153,7 @@ const buildSettingsPayload = (data: any) => {
id,
{
enabled: cfg.enabled,
- hidden_message_types: ['system', 'assistant', 'toolcall'],
+ hidden_message_types: cfg.hidden_message_types || ['system', 'toolcall'],
custom_cwd: cfg.custom_cwd || null,
routing: {
agent_backend: cfg.routing?.agent_backend || null,
diff --git a/ui/src/components/steps/Welcome.tsx b/ui/src/components/steps/Welcome.tsx
index 6f5835811..6c4d8f542 100644
--- a/ui/src/components/steps/Welcome.tsx
+++ b/ui/src/components/steps/Welcome.tsx
@@ -1,5 +1,6 @@
import React from 'react';
import { ArrowRight } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
import logo from '../../assets/logo.png';
interface WelcomeProps {
@@ -7,28 +8,30 @@ interface WelcomeProps {
}
export const Welcome: React.FC<WelcomeProps> = ({ onNext }) => {
+ const { t } = useTranslation();
+
return (
<div className="flex flex-col h-full justify-center items-center text-center max-w-lg mx-auto">
<div className="mb-8">
<img src={logo} alt="Vibe Remote Logo" className="w-20 h-20 mx-auto mb-6 drop-shadow-lg" />
- <h1 className="text-4xl font-display font-bold mb-4 text-text">Set up Vibe Remote</h1>
+ <h1 className="text-4xl font-display font-bold mb-4 text-text">{t('welcome.title')}</h1>
<p className="text-xl text-muted font-light">
- Your local AI coding assistant for Slack.
+ {t('welcome.subtitle')}
</p>
</div>
<div className="space-y-4 text-left w-full mb-10 bg-panel border border-border p-6 rounded-xl shadow-sm">
<div className="flex items-start gap-3">
<div className="w-1.5 h-1.5 rounded-full bg-accent mt-2"></div>
- <p className="text-text">Runs locally. Your code stays on your computer.</p>
+ <p className="text-text">{t('welcome.feature1')}</p>
</div>
<div className="flex items-start gap-3">
<div className="w-1.5 h-1.5 rounded-full bg-accent mt-2"></div>
- <p className="text-text">SaaS mode uses a cloud relay for Slack delivery, but does not store message content.</p>
+ <p className="text-text">{t('welcome.feature2')}</p>
</div>
<div className="flex items-start gap-3">
<div className="w-1.5 h-1.5 rounded-full bg-accent mt-2"></div>
- <p className="text-text">Self-host mode runs entirely locally via Slack Socket Mode.</p>
+ <p className="text-text">{t('welcome.feature3')}</p>
</div>
</div>
@@ -36,7 +39,7 @@ export const Welcome: React.FC<WelcomeProps> = ({ onNext }) => {
onClick={() => onNext({})}
className="group flex items-center gap-2 px-8 py-3 bg-accent hover:bg-accent/90 text-white rounded-full font-bold text-lg transition-all shadow-md hover:shadow-lg hover:-translate-y-0.5"
>
- Get started <ArrowRight size={20} className="group-hover:translate-x-1 transition-transform" />
+ {t('welcome.getStarted')} <ArrowRight size={20} className="group-hover:translate-x-1 transition-transform" />
</button>
</div>
);
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
new file mode 100644
index 000000000..25e9a24f7
--- /dev/null
+++ b/ui/src/i18n/en.json
@@ -0,0 +1,181 @@
+{
+ "common": {
+ "back": "Back",
+ "continue": "Continue",
+ "save": "Save",
+ "cancel": "Cancel",
+ "loading": "Loading...",
+ "saving": "Saving...",
+ "saved": "Saved",
+ "saveFailed": "Save failed",
+ "enabled": "Enabled",
+ "disabled": "Disabled",
+ "default": "Default",
+ "running": "Running",
+ "stopped": "Stopped",
+ "unknown": "Unknown",
+ "online": "Online",
+ "offline": "Offline",
+ "public": "Public",
+ "private": "Private",
+ "notSet": "Not set",
+ "notLinked": "Not linked",
+ "found": "Found",
+ "notFound": "Not Found",
+ "notChecked": "Not checked",
+ "missing": "Missing",
+ "detect": "Detect",
+ "detectAll": "Detect all",
+ "refresh": "Refresh",
+ "start": "Start",
+ "stop": "Stop",
+ "restart": "Restart",
+ "viewDetails": "View details",
+ "editSetup": "Edit setup",
+ "manageChannels": "Manage channels",
+ "viewLogs": "View logs",
+ "saveAndRestart": "Save & Restart"
+ },
+ "nav": {
+ "dashboard": "Dashboard",
+ "channels": "Channels",
+ "doctor": "Doctor"
+ },
+ "appShell": {
+ "title": "Vibe Remote"
+ },
+ "wizard": {
+ "title": "Vibe Remote Setup"
+ },
+ "welcome": {
+ "title": "Set up Vibe Remote",
+ "subtitle": "Your local AI coding assistant for Slack.",
+ "getStarted": "Get started",
+ "feature1": "Runs locally. Your code stays on your computer.",
+ "feature2": "SaaS mode uses a cloud relay for Slack delivery, but does not store message content.",
+ "feature3": "Self-host mode runs entirely locally via Slack Socket Mode."
+ },
+ "modeSelection": {
+ "title": "Choose Mode",
+ "saasMode": "SaaS Mode",
+ "saasDescription": "OAuth install + cloud relay + local execution (coming soon).",
+ "selfHostMode": "Self-host Mode",
+ "selfHostDescription": "Use your own Slack app + Socket Mode tokens."
+ },
+ "slackConfig": {
+ "title": "Slack Configuration",
+ "saasDescription": "Authorize the official Slack app and wait for workspace binding.",
+ "selfHostDescription": "Provide bot and app tokens for Socket Mode.",
+ "oauthPrompt": "Open OAuth in your browser to authorize Vibe Remote with your Slack workspace.",
+ "openSlackOAuth": "Open Slack OAuth",
+ "afterAuth": "After authorization, return here to continue.",
+ "botToken": "Bot User OAuth Token",
+ "botTokenHint": "Starts with",
+ "appToken": "App-Level Token",
+ "validateTokens": "Validate Tokens",
+ "tokenValidated": "Success: Token Validated",
+ "authFailed": "Auth failed"
+ },
+ "agentDetection": {
+ "title": "Agent Configuration",
+ "subtitle": "Detect local CLI paths and choose enabled backends.",
+ "defaultBackend": "Default Backend",
+ "cliPath": "CLI Path",
+ "cliPathPlaceholder": "Path to {{name}} CLI...",
+ "cliPathDetection": "CLI path detection and enablement",
+ "recommended": "(recommended)"
+ },
+ "channelList": {
+ "title": "Channel Settings",
+ "subtitle": "Enable channels and configure per-channel routing.",
+ "refreshList": "Refresh List",
+ "enabledCount": "{{count}} enabled",
+ "accessPolicy": "Access Policy",
+ "accessPolicyHint": "Channels are enabled only when checked below.",
+ "noChannelsFound": "No channels found. Check token or invite bot.",
+ "noChannelsLoaded": "No channels loaded.",
+ "addTokenFirst": "Add a Slack bot token first to load channels.",
+ "workingDirectory": "Working Directory",
+ "useGlobalDefault": "Use global default",
+ "backend": "Backend",
+ "hiddenMessageTypes": "Hidden Message Types",
+ "opencodeSettings": "OpenCode Settings",
+ "agent": "Agent",
+ "model": "Model",
+ "reasoningEffort": "Reasoning Effort",
+ "settingsSaved": "Settings saved",
+ "settingsSaveFailed": "Failed to save settings"
+ },
+ "summary": {
+ "title": "Review & Finish",
+ "subtitle": "Confirm settings and start Vibe Remote.",
+ "mode": "Mode",
+ "slackBotToken": "Slack Bot Token",
+ "slackAppToken": "Slack App Token",
+ "enabledAgents": "Enabled Agents",
+ "channelsConfigured": "Channels Configured",
+ "finishAndStart": "Finish & Start"
+ },
+ "dashboard": {
+ "title": "Dashboard",
+ "subtitle": "Manage your local Vibe Remote instance.",
+ "serviceStatus": "Service Status",
+ "mode": "Mode",
+ "workspace": "Workspace",
+ "gateway": "Gateway",
+ "health": "Health",
+ "allSystemsOperational": "All systems operational",
+ "issuesDetected": "Issues detected",
+ "globalPolicy": "Global Policy",
+ "defaultBackend": "Default Backend",
+ "slackWorkspace": "Slack Workspace",
+ "messageHandling": "Message Handling",
+ "requireMention": "Require Mention",
+ "requireMentionHint": "Bot only responds when @mentioned",
+ "ackMode": "Ack Mode",
+ "ackModeHint": "How bot acknowledges received messages",
+ "ackReaction": "Reaction",
+ "ackMessage": "Message",
+ "allowedChannels": "Allowed Channels",
+ "consoleServer": "Console Server",
+ "host": "Host",
+ "port": "Port",
+ "diagnostics": "Diagnostics",
+ "logLevel": "Log Level",
+ "configFile": "Config File",
+ "logs": "Logs",
+ "uiRestartMessage": "Saved. Restarting UI server...",
+ "mainServiceRestarted": "Saved. Main service restarted."
+ },
+ "doctor": {
+ "title": "System Status",
+ "copyReport": "Copy Report",
+ "runChecks": "Run Checks",
+ "passed": "Passed",
+ "warnings": "Warnings",
+ "failed": "Failed"
+ },
+ "logs": {
+ "title": "System Logs",
+ "autoRefreshOn": "Auto-refresh ON",
+ "autoRefresh": "Auto-refresh",
+ "searchPlaceholder": "Search logs by message, logger, or timestamp...",
+ "allLevels": "All Levels",
+ "error": "Error",
+ "warning": "Warning",
+ "info": "Info",
+ "debug": "Debug",
+ "all": "All",
+ "entriesCount": "{{filtered}} of {{total}} entries",
+ "totalInFile": "({{total}} total in file)",
+ "jumpToLatest": "Jump to latest",
+ "loadingLogs": "Loading logs...",
+ "noLogsAvailable": "No logs available",
+ "noLogsMatch": "No logs match your filter"
+ },
+ "language": {
+ "switchLanguage": "Language",
+ "en": "English",
+ "zh": "Chinese"
+ }
+}
diff --git a/ui/src/i18n/index.ts b/ui/src/i18n/index.ts
new file mode 100644
index 000000000..36b67b77e
--- /dev/null
+++ b/ui/src/i18n/index.ts
@@ -0,0 +1,28 @@
+import i18n from 'i18next';
+import { initReactI18next } from 'react-i18next';
+import LanguageDetector from 'i18next-browser-languagedetector';
+
+import en from './en.json';
+import zh from './zh.json';
+
+const resources = {
+ en: { translation: en },
+ zh: { translation: zh },
+};
+
+i18n
+ .use(LanguageDetector)
+ .use(initReactI18next)
+ .init({
+ resources,
+ fallbackLng: 'en',
+ interpolation: {
+ escapeValue: false, // React already escapes
+ },
+ detection: {
+ order: ['localStorage', 'navigator'],
+ caches: ['localStorage'],
+ },
+ });
+
+export default i18n;
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
new file mode 100644
index 000000000..97fe7783f
--- /dev/null
+++ b/ui/src/i18n/zh.json
@@ -0,0 +1,181 @@
+{
+ "common": {
+ "back": "返回",
+ "continue": "继续",
+ "save": "保存",
+ "cancel": "取消",
+ "loading": "加载中...",
+ "saving": "保存中...",
+ "saved": "已保存",
+ "saveFailed": "保存失败",
+ "enabled": "已启用",
+ "disabled": "已禁用",
+ "default": "默认",
+ "running": "运行中",
+ "stopped": "已停止",
+ "unknown": "未知",
+ "online": "在线",
+ "offline": "离线",
+ "public": "公开",
+ "private": "私有",
+ "notSet": "未设置",
+ "notLinked": "未关联",
+ "found": "已找到",
+ "notFound": "未找到",
+ "notChecked": "未检测",
+ "missing": "缺失",
+ "detect": "检测",
+ "detectAll": "检测全部",
+ "refresh": "刷新",
+ "start": "启动",
+ "stop": "停止",
+ "restart": "重启",
+ "viewDetails": "查看详情",
+ "editSetup": "编辑设置",
+ "manageChannels": "管理频道",
+ "viewLogs": "查看日志",
+ "saveAndRestart": "保存并重启"
+ },
+ "nav": {
+ "dashboard": "仪表盘",
+ "channels": "频道",
+ "doctor": "诊断"
+ },
+ "appShell": {
+ "title": "Vibe Remote"
+ },
+ "wizard": {
+ "title": "Vibe Remote 设置向导"
+ },
+ "welcome": {
+ "title": "设置 Vibe Remote",
+ "subtitle": "为 Slack 打造的本地 AI 编程助手",
+ "getStarted": "开始设置",
+ "feature1": "本地运行,代码留在您的电脑上",
+ "feature2": "SaaS 模式使用云端中继进行 Slack 消息传输,但不会存储消息内容",
+ "feature3": "自托管模式通过 Slack Socket Mode 完全在本地运行"
+ },
+ "modeSelection": {
+ "title": "选择模式",
+ "saasMode": "SaaS 模式",
+ "saasDescription": "OAuth 安装 + 云端中继 + 本地执行(即将推出)",
+ "selfHostMode": "自托管模式",
+ "selfHostDescription": "使用您自己的 Slack 应用 + Socket Mode 令牌"
+ },
+ "slackConfig": {
+ "title": "Slack 配置",
+ "saasDescription": "授权官方 Slack 应用并等待工作区绑定",
+ "selfHostDescription": "提供用于 Socket Mode 的 Bot 和 App 令牌",
+ "oauthPrompt": "在浏览器中打开 OAuth 以授权 Vibe Remote 访问您的 Slack 工作区",
+ "openSlackOAuth": "打开 Slack OAuth",
+ "afterAuth": "授权后返回此处继续",
+ "botToken": "Bot 用户 OAuth 令牌",
+ "botTokenHint": "以此开头",
+ "appToken": "应用级别令牌",
+ "validateTokens": "验证令牌",
+ "tokenValidated": "成功:令牌已验证",
+ "authFailed": "认证失败"
+ },
+ "agentDetection": {
+ "title": "Agent 配置",
+ "subtitle": "检测本地 CLI 路径并选择启用的后端",
+ "defaultBackend": "默认后端",
+ "cliPath": "CLI 路径",
+ "cliPathPlaceholder": "{{name}} CLI 路径...",
+ "cliPathDetection": "CLI 路径检测和启用设置",
+ "recommended": "(推荐)"
+ },
+ "channelList": {
+ "title": "频道设置",
+ "subtitle": "启用频道并配置每个频道的路由",
+ "refreshList": "刷新列表",
+ "enabledCount": "已启用 {{count}} 个",
+ "accessPolicy": "访问策略",
+ "accessPolicyHint": "只有勾选的频道才会启用",
+ "noChannelsFound": "未找到频道,请检查令牌或邀请机器人",
+ "noChannelsLoaded": "未加载频道",
+ "addTokenFirst": "请先添加 Slack Bot 令牌以加载频道",
+ "workingDirectory": "工作目录",
+ "useGlobalDefault": "使用全局默认值",
+ "backend": "后端",
+ "hiddenMessageTypes": "隐藏的消息类型",
+ "opencodeSettings": "OpenCode 设置",
+ "agent": "Agent",
+ "model": "模型",
+ "reasoningEffort": "推理强度",
+ "settingsSaved": "设置已保存",
+ "settingsSaveFailed": "保存设置失败"
+ },
+ "summary": {
+ "title": "检查并完成",
+ "subtitle": "确认设置并启动 Vibe Remote",
+ "mode": "模式",
+ "slackBotToken": "Slack Bot 令牌",
+ "slackAppToken": "Slack App 令牌",
+ "enabledAgents": "已启用的 Agent",
+ "channelsConfigured": "已配置的频道",
+ "finishAndStart": "完成并启动"
+ },
+ "dashboard": {
+ "title": "仪表盘",
+ "subtitle": "管理您的本地 Vibe Remote 实例",
+ "serviceStatus": "服务状态",
+ "mode": "模式",
+ "workspace": "工作区",
+ "gateway": "网关",
+ "health": "健康状态",
+ "allSystemsOperational": "所有系统正常运行",
+ "issuesDetected": "检测到问题",
+ "globalPolicy": "全局策略",
+ "defaultBackend": "默认后端",
+ "slackWorkspace": "Slack 工作区",
+ "messageHandling": "消息处理",
+ "requireMention": "需要 @提及",
+ "requireMentionHint": "机器人仅在被 @提及时响应",
+ "ackMode": "确认模式",
+ "ackModeHint": "机器人如何确认收到的消息",
+ "ackReaction": "表情回应",
+ "ackMessage": "消息回复",
+ "allowedChannels": "允许的频道",
+ "consoleServer": "控制台服务器",
+ "host": "主机",
+ "port": "端口",
+ "diagnostics": "诊断",
+ "logLevel": "日志级别",
+ "configFile": "配置文件",
+ "logs": "日志",
+ "uiRestartMessage": "已保存,正在重启 UI 服务器...",
+ "mainServiceRestarted": "已保存,主服务已重启"
+ },
+ "doctor": {
+ "title": "系统状态",
+ "copyReport": "复制报告",
+ "runChecks": "运行检查",
+ "passed": "通过",
+ "warnings": "警告",
+ "failed": "失败"
+ },
+ "logs": {
+ "title": "系统日志",
+ "autoRefreshOn": "自动刷新已开启",
+ "autoRefresh": "自动刷新",
+ "searchPlaceholder": "按消息、记录器或时间戳搜索日志...",
+ "allLevels": "所有级别",
+ "error": "错误",
+ "warning": "警告",
+ "info": "信息",
+ "debug": "调试",
+ "all": "全部",
+ "entriesCount": "{{filtered}} / {{total}} 条",
+ "totalInFile": "(文件中共 {{total}} 条)",
+ "jumpToLatest": "跳转到最新",
+ "loadingLogs": "加载日志中...",
+ "noLogsAvailable": "暂无日志",
+ "noLogsMatch": "没有匹配的日志"
+ },
+ "language": {
+ "switchLanguage": "语言",
+ "en": "English",
+ "zh": "中文"
+ }
+}
diff --git a/ui/src/main.tsx b/ui/src/main.tsx
index bef5202a3..0a27bc376 100644
--- a/ui/src/main.tsx
+++ b/ui/src/main.tsx
@@ -1,5 +1,6 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
+import './i18n'
import './index.css'
import App from './App.tsx'