Skip to content

Commit 219dada

Browse files
authored
Merge pull request modelcontextprotocol#9 from modelcontextprotocol/ashwin/resourcerefresh
resource refreshing
2 parents f3da4d9 + 0c66e16 commit 219dada

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

client/src/components/ResourcesTab.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { FileText, PlayCircle, ChevronRight, AlertCircle } from "lucide-react";
1+
import {
2+
FileText,
3+
PlayCircle,
4+
ChevronRight,
5+
AlertCircle,
6+
RefreshCw,
7+
} from "lucide-react";
28
import { Button } from "@/components/ui/button";
39
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
410
import { TabsContent } from "@/components/ui/tabs";
@@ -58,10 +64,20 @@ const ResourcesTab = ({
5864
</div>
5965

6066
<div className="bg-white rounded-lg shadow">
61-
<div className="p-4 border-b border-gray-200">
67+
<div className="p-4 border-b border-gray-200 flex justify-between items-center">
6268
<h3 className="font-semibold">
6369
{selectedResource ? selectedResource.uri : "Select a resource"}
6470
</h3>
71+
{selectedResource && (
72+
<Button
73+
variant="outline"
74+
size="sm"
75+
onClick={() => readResource(selectedResource.uri)}
76+
>
77+
<RefreshCw className="w-4 h-4 mr-2" />
78+
Refresh
79+
</Button>
80+
)}
6581
</div>
6682
<div className="p-4">
6783
{error ? (
@@ -71,7 +87,7 @@ const ResourcesTab = ({
7187
<AlertDescription>{error}</AlertDescription>
7288
</Alert>
7389
) : selectedResource ? (
74-
<pre className="bg-gray-50 p-4 rounded text-sm overflow-auto max-h-96">
90+
<pre className="bg-gray-50 p-4 rounded text-sm overflow-auto max-h-96 whitespace-pre-wrap break-words">
7591
{resourceContent}
7692
</pre>
7793
) : (

0 commit comments

Comments
 (0)