add ping tab
This commit is contained in:
@@ -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>
|
||||
) : (
|
||||
|
||||
21
client/src/components/PingTab.tsx
Normal file
21
client/src/components/PingTab.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { TabsContent } from "@/components/ui/tabs";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
const PingTab = ({ onPingClick }: { onPingClick: () => void }) => {
|
||||
return (
|
||||
<TabsContent value="ping" className="grid grid-cols-2 gap-4">
|
||||
<div className="col-span-2 flex justify-center items-center">
|
||||
<Button
|
||||
onClick={onPingClick}
|
||||
className="bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600 text-white font-bold py-6 px-12 rounded-full shadow-lg transform transition duration-300 hover:scale-110 focus:outline-none focus:ring-4 focus:ring-purple-300 animate-pulse"
|
||||
>
|
||||
<span className="text-3xl mr-2">🚀</span>
|
||||
Mega Ping
|
||||
<span className="text-3xl ml-2">💥</span>
|
||||
</Button>
|
||||
</div>
|
||||
</TabsContent>
|
||||
);
|
||||
};
|
||||
|
||||
export default PingTab;
|
||||
Reference in New Issue
Block a user