From 7670a62b6e0345e77a0fc66151c2ad81debf128e Mon Sep 17 00:00:00 2001 From: mlogclub Date: Sun, 24 May 2026 21:19:05 +0800 Subject: [PATCH] feat: refactor MCPDashboardPage layout with Dashboard components --- web/app/dashboard/mcp/page.tsx | 98 ++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/web/app/dashboard/mcp/page.tsx b/web/app/dashboard/mcp/page.tsx index 0d8b0ba..420fbec 100644 --- a/web/app/dashboard/mcp/page.tsx +++ b/web/app/dashboard/mcp/page.tsx @@ -4,6 +4,11 @@ import { Loader2Icon, PlugZapIcon, WrenchIcon } from "lucide-react"; import { useEffect, useMemo, useState } from "react"; import { toast } from "sonner"; +import { + DashboardPage, + DashboardTableShell, + DashboardToolbar, +} from "@/components/dashboard-page"; import { JsonCodeEditor } from "@/components/json-code-editor"; import { JsonViewer } from "@/components/json-viewer"; import { OptionCombobox } from "@/components/option-combobox"; @@ -158,7 +163,7 @@ export default function MCPDashboardPage() { return ( <> -
+ {/*
@@ -178,28 +183,9 @@ export default function MCPDashboardPage() {
*/} -
-
- 服务配置 -
- { - setServerCode(value); - setConnection(null); - setTools([]); - setToolResult(null); - setActiveTool(null); - }} - /> -
-
-
+ + + } + > +
+ 服务配置 +
+ { + setServerCode(value); + setConnection(null); + setTools([]); + setToolResult(null); + setActiveTool(null); + }} + />
- {connection ? ( -
-
- 已连接 - - {connection.serverName || "-"} - -
-
-
serverCode: {connection.serverCode}
-
protocol: {connection.protocol || "-"}
-
- endpoint: {connection.endpoint} -
-
version: {connection.version || "-"}
-
+
+ {connection ? ( +
+
+ 已连接 + + {connection.serverName || "-"} +
- ) : null} -
+
+
serverCode: {connection.serverCode}
+
protocol: {connection.protocol || "-"}
+
+ endpoint: {connection.endpoint} +
+
version: {connection.version || "-"}
+
+
+ ) : null} +
{tools.length === 0 ? (
暂无工具结果,先点击上方“列出工具”。
) : ( -
-
+ +
工具名
描述
@@ -278,9 +286,9 @@ export default function MCPDashboardPage() {
))}
-
+ )} -
+