Skip to content

Commit 3fdb93d

Browse files
author
Lasim
committed
refactor(frontend): simplify McpInstallationsCard component structure
1 parent 044c3e1 commit 3fdb93d

File tree

2 files changed

+14
-26
lines changed

2 files changed

+14
-26
lines changed
Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
<script setup lang="ts">
22
import type { McpInstallation } from '@/types/mcp-installations'
33
import McpInstallationsList from './McpInstallationsList.vue'
4-
import McpInstallationsEmptyState from './McpInstallationsEmptyState.vue'
54
65
interface Props {
76
installations: McpInstallation[]
8-
hasInstallations: boolean
97
showWalkthrough?: boolean
108
}
119
1210
defineProps<Props>()
1311
1412
const emit = defineEmits<{
15-
installServer: []
1613
viewInstallation: [serverId: string]
1714
manageInstallation: [installationId: string]
1815
removeInstallation: [installationId: string]
1916
}>()
2017
21-
const handleInstallServer = () => {
22-
emit('installServer')
23-
}
24-
2518
const handleViewInstallation = (serverId: string) => {
2619
emit('viewInstallation', serverId)
2720
}
@@ -36,21 +29,11 @@ const handleRemoveInstallation = (installationId: string) => {
3629
</script>
3730

3831
<template>
39-
<!-- Empty State -->
40-
<McpInstallationsEmptyState
41-
v-if="!hasInstallations"
42-
@install-server="handleInstallServer"
32+
<McpInstallationsList
33+
:installations="installations"
34+
:show-walkthrough="showWalkthrough"
35+
@view-installation="handleViewInstallation"
36+
@manage-installation="handleManageInstallation"
37+
@remove-installation="handleRemoveInstallation"
4338
/>
44-
45-
<!-- Installations List -->
46-
<div v-else>
47-
<McpInstallationsList
48-
:installations="installations"
49-
:show-walkthrough="showWalkthrough"
50-
@view-installation="handleViewInstallation"
51-
@manage-installation="handleManageInstallation"
52-
@remove-installation="handleRemoveInstallation"
53-
/>
54-
</div>
55-
5639
</template>

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

Lines changed: 8 additions & 3 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 McpInstallationsEmptyState from '@/components/mcp-server/McpInstallationsEmptyState.vue'
1112
import McpClientConnectionsCard from '@/components/mcp-server/McpClientConnectionsCard.vue'
1213
import McpStats from '@/components/mcp-server/McpStats.vue'
1314
import ClientConfigurationModal from '@/components/gateway-config/ClientConfigurationModal.vue'
@@ -450,17 +451,21 @@ onUnmounted(() => {
450451
{{ t('common.messages.error') }}: {{ error }}
451452
</div>
452453

453-
<!-- Main Content -->
454+
<!-- Empty State - No installations -->
455+
<McpInstallationsEmptyState
456+
v-else-if="!hasInstallations"
457+
@install-server="handleInstallServer"
458+
/>
459+
460+
<!-- Main Content - Has installations -->
454461
<div v-else>
455462
<McpStats />
456463

457464
<div class="flex gap-6 mt-18">
458465
<div class="flex-[0.7]">
459466
<McpInstallationsCard
460467
:installations="installations"
461-
:has-installations="hasInstallations"
462468
:show-walkthrough="showUserWalkthrough"
463-
@install-server="handleInstallServer"
464469
@view-installation="handleViewInstallation"
465470
@manage-installation="handleManageInstallation"
466471
@remove-installation="handleRemoveInstallation"

0 commit comments

Comments
 (0)