feat(webui): system settings panel (port/host/TLS/trust-proxy)

New Settings → 服务 tab (SystemPanel) over the /api/system/settings + TLS cert
API: edit port / bind host / trust-proxy, paste cert+key PEM to enable HTTPS,
delete cert. Flags env-overridden fields ('被环境变量覆盖') and shows a
restart-to-apply banner (no self-restart). Typed systemSettings API client
domain. View layer — verified by tsc + vite build (webui has no component-test
infra).
This commit is contained in:
DrSmoothl committed 2026-06-18 14:39:35 +08:00
1 parent 7faef1b7c0
commit 82d5f782a3
6 files changed
+256 -3

No files matched your search

@@ -2,7 +2,7 @@ import { createContext, useContext, useId, useRef, useState, type ReactNode } fr
import { motion } from 'motion/react';
import {
Accessibility, AlertTriangle, Bell, Bug, Check, Clock, Code2, Download, ExternalLink, Github, Image as ImageIcon,
Info, KeyRound, Loader2, Monitor, Moon, Palette, PanelTop, Plus, RefreshCw, RotateCcw, ShieldCheck,
Info, KeyRound, Loader2, Monitor, Moon, Palette, PanelTop, Plus, RefreshCw, RotateCcw, Server, ShieldCheck,
Sparkles, Star, Sun, Tag, Upload, Trash2,
} from 'lucide-react';
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card';
@@ -41,12 +41,14 @@ import { useAppState } from '@/contexts/AppStateContext';
import { cn } from '@/lib/utils';
import { settingsRoute, type SettingsTab } from '@/router';
import { NotificationsPanel } from '@/components/settings/notifications-panel';
import { SystemPanel } from '@/components/settings/system-panel';
const TABS: { key: SettingsTab; label: string; icon: typeof Sun }[] = [
{ key: 'appearance', label: '外观', icon: Palette },
{ key: 'data', label: '数据与格式', icon: RefreshCw },
{ key: 'advanced', label: '高级', icon: Code2 },
{ key: 'account', label: '账号安全', icon: ShieldCheck },
{ key: 'system', label: '服务', icon: Server },
{ key: 'notifications', label: '通知', icon: Bell },
{ key: 'about', label: '关于', icon: Info },
];
@@ -78,6 +80,7 @@ export function SettingsPage() {
{tab === 'data' && <DataPanel />}
{tab === 'advanced' && <AdvancedPanel />}
{tab === 'account' && <AccountPanel />}
{tab === 'system' && <SystemPanel />}
{tab === 'notifications' && <NotificationsPanel />}
{tab === 'about' && <AboutPanel />}
</motion.div>