add ping tab

This commit is contained in:
Ashwin Bhat
2024-10-17 16:25:31 -07:00
parent 9ff362dd85
commit 7bb40c188f
2 changed files with 37 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import {
ClientRequest,
ProgressNotificationSchema,
ServerNotification,
EmptyResultSchema,
} from "mcp-typescript/types.js";
import { useState, useRef } from "react";
import {
@@ -43,6 +44,7 @@ import ToolsTab from "./components/ToolsTab";
import { AnyZodObject } from "zod";
import HistoryAndNotifications from "./components/History";
import "./App.css";
import PingTab from "./components/PingTab";
const App = () => {
const [connectionStatus, setConnectionStatus] = useState<
@@ -294,6 +296,10 @@ const App = () => {
<Terminal className="w-4 h-4 mr-2" />
Console
</TabsTrigger>
<TabsTrigger value="ping">
<Bell className="w-4 h-4 mr-2" />
Ping
</TabsTrigger>
</TabsList>
<div className="w-full">
@@ -332,6 +338,16 @@ const App = () => {
error={error}
/>
<ConsoleTab />
<PingTab
onPingClick={() => {
void makeRequest(
{
method: "ping" as const,
},
EmptyResultSchema,
);
}}
/>
</div>
</Tabs>
) : (