Skip to content

Commit 7f95f3e

Browse files
author
Lasim
committed
feat(frontend): add McpClientConnectionsCard component
1 parent 3125aa4 commit 7f95f3e

File tree

5 files changed

+85
-12
lines changed

5 files changed

+85
-12
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<script setup lang="ts">
2+
import Card from '@/components/ui/card/Card.vue'
3+
import { Item } from '@/components/ui/item'
4+
5+
interface ClientConnection {
6+
id: string
7+
name: string
8+
type: string
9+
connectedAt: string
10+
status: 'active' | 'inactive'
11+
}
12+
13+
const dummyClients: ClientConnection[] = [
14+
{
15+
id: '1',
16+
name: 'VS Code',
17+
type: 'Desktop Client',
18+
connectedAt: '2 hours ago',
19+
status: 'active'
20+
},
21+
{
22+
id: '2',
23+
name: 'Cursor',
24+
type: 'Desktop Client',
25+
connectedAt: '5 minutes ago',
26+
status: 'active'
27+
}
28+
]
29+
</script>
30+
31+
<template>
32+
<Card variant="gray">
33+
<div class="px-6">
34+
<h3 class="text-lg font-semibold mb-4">Client Connections</h3>
35+
<div class="space-y-3">
36+
<Item
37+
v-for="client in dummyClients"
38+
:key="client.id"
39+
variant="filled"
40+
class="cursor-pointer"
41+
>
42+
<div class="flex items-center justify-between w-full">
43+
<div class="flex flex-col">
44+
<span class="font-medium">{{ client.name }}</span>
45+
<span class="text-sm text-muted-foreground">{{ client.type }}</span>
46+
</div>
47+
<div class="flex flex-col items-end">
48+
<span class="text-xs text-muted-foreground">{{ client.connectedAt }}</span>
49+
<span
50+
class="text-xs font-medium"
51+
:class="{
52+
'text-green-600': client.status === 'active',
53+
'text-gray-400': client.status === 'inactive'
54+
}"
55+
>
56+
{{ client.status }}
57+
</span>
58+
</div>
59+
</div>
60+
</Item>
61+
</div>
62+
</div>
63+
</Card>
64+
</template>

services/frontend/src/components/mcp-server/McpInstallationsCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const handleRemoveInstallation = (installationId: string) => {
7676
</div>
7777

7878
<!-- Installations List -->
79-
<div v-else class="mt-18">
79+
<div v-else>
8080
<McpInstallationsList
8181
:installations="installations"
8282
:show-walkthrough="showWalkthrough"

services/frontend/src/components/ui/card/Card.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const cardVariants = cva(
99
variants: {
1010
variant: {
1111
default: 'bg-card',
12-
gray: 'bg-stone-200',
12+
gray: 'bg-zinc-100',
1313
},
1414
},
1515
defaultVariants: {

services/frontend/src/components/ui/item/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const itemVariants = cva(
2020
default: "bg-transparent",
2121
outline: "border-border",
2222
muted: "bg-muted/50",
23+
filled: "bg-white border-border",
2324
},
2425
size: {
2526
default: "p-4 gap-4 ",

services/frontend/src/views/mcp-server/index.vue

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Plus } from 'lucide-vue-next'
88
import { toast } from 'vue-sonner'
99
import { useEventBus } from '@/composables/useEventBus'
1010
import McpInstallationsCard from '@/components/mcp-server/McpInstallationsCard.vue'
11+
import McpClientConnectionsCard from '@/components/mcp-server/McpClientConnectionsCard.vue'
1112
import McpStats from '@/components/mcp-server/McpStats.vue'
1213
import ClientConfigurationModal from '@/components/gateway-config/ClientConfigurationModal.vue'
1314
import UserWalkthroughPopover from '@/components/walkthrough/UserWalkthroughPopover.vue'
@@ -450,18 +451,25 @@ onUnmounted(() => {
450451
</div>
451452

452453
<!-- Main Content -->
453-
<div v-else class="space-y-6">
454+
<div v-else>
454455
<McpStats />
455456

456-
<McpInstallationsCard
457-
:installations="installations"
458-
:has-installations="hasInstallations"
459-
:show-walkthrough="showUserWalkthrough"
460-
@install-server="handleInstallServer"
461-
@view-installation="handleViewInstallation"
462-
@manage-installation="handleManageInstallation"
463-
@remove-installation="handleRemoveInstallation"
464-
/>
457+
<div class="flex gap-6 mt-18">
458+
<div class="flex-[0.7]">
459+
<McpInstallationsCard
460+
:installations="installations"
461+
:has-installations="hasInstallations"
462+
:show-walkthrough="showUserWalkthrough"
463+
@install-server="handleInstallServer"
464+
@view-installation="handleViewInstallation"
465+
@manage-installation="handleManageInstallation"
466+
@remove-installation="handleRemoveInstallation"
467+
/>
468+
</div>
469+
<div class="flex-[0.3]">
470+
<McpClientConnectionsCard />
471+
</div>
472+
</div>
465473
</div>
466474

467475
</div>

0 commit comments

Comments
 (0)