From 842a942a5541810d73a02471b75c15c195cfaa6d Mon Sep 17 00:00:00 2001 From: CJACK Date: Sun, 1 Feb 2026 05:44:55 +0800 Subject: [PATCH] feat: implement responsive collapsible configuration panel in API Tester and refine account manager component styling. --- webui/src/App.jsx | 4 +- webui/src/components/AccountManager.jsx | 46 ++++---- webui/src/components/ApiTester.jsx | 149 ++++++++++++++---------- 3 files changed, 113 insertions(+), 86 deletions(-) diff --git a/webui/src/App.jsx b/webui/src/App.jsx index 6e968d1..2f14071 100644 --- a/webui/src/App.jsx +++ b/webui/src/App.jsx @@ -254,8 +254,8 @@ export default function App() { {/* Content Area */} -
-
+
+

{NAV_ITEMS.find(n => n.id === activeTab)?.label} diff --git a/webui/src/components/AccountManager.jsx b/webui/src/components/AccountManager.jsx index faa3720..6a0115c 100644 --- a/webui/src/components/AccountManager.jsx +++ b/webui/src/components/AccountManager.jsx @@ -243,36 +243,36 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch {/* Queue Status */} {queueStatus && (
-
-
-
- +
+
+
+
-

可用账号

-

{queueStatus.available}

+

可用账号

+

{queueStatus.available}

-
-
-
- +
+
+
+
-

使用中

-

{queueStatus.in_use}

+

使用中

+

{queueStatus.in_use}

-
-
-
- +
+
+
+
-

账号总数

-

{queueStatus.total}

+

账号总数

+

{queueStatus.total}

@@ -401,26 +401,26 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch
-
+
diff --git a/webui/src/components/ApiTester.jsx b/webui/src/components/ApiTester.jsx index 7d19bf0..a988559 100644 --- a/webui/src/components/ApiTester.jsx +++ b/webui/src/components/ApiTester.jsx @@ -10,7 +10,9 @@ import { User, Loader2, CheckCircle2, - AlertCircle + AlertCircle, + ChevronDown, + ShieldCheck } from 'lucide-react' import clsx from 'clsx' @@ -32,6 +34,9 @@ export default function ApiTester({ config, onMessage, authFetch }) { const [isStreaming, setIsStreaming] = useState(false) const abortControllerRef = useRef(null) + const [sidebarOpen, setSidebarOpen] = useState(false) + const [configExpanded, setConfigExpanded] = useState(false) + const apiFetch = authFetch || fetch const accounts = config.accounts || [] @@ -178,75 +183,97 @@ export default function ApiTester({ config, onMessage, authFetch }) { } return ( -
+
{/* Configuration Panel */} -
-
-

- - 模型选项 -

- -
- -
- {MODELS.map(m => { - const Icon = m.icon - return ( - - ) - })} +
+
+ {/* Mobile Toggle Header */} +
+
+ +
+ -
- - -
+
+

+ + 模型选项 +

-
- - setApiKey(e.target.value)} - /> +
+ +
+ {MODELS.map(m => { + const Icon = m.icon + return ( + + ) + })} +
+
+ +
+ + +
+ +
+ + setApiKey(e.target.value)} + /> +
{/* Chat Interface */} -
+
{/* Messages Area */}
{/* User Message */}