Skip to content

Commit 89f9447

Browse files
committed
refactor: update installation handling and status representation in MCP components
1 parent 855ce3a commit 89f9447

File tree

6 files changed

+24
-170
lines changed

6 files changed

+24
-170
lines changed

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

Lines changed: 0 additions & 144 deletions
This file was deleted.

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

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,26 @@ const sortedInstallations = computed(() => {
102102
})
103103
104104
// Methods
105-
const getStatusVariant = (status: McpInstallation['status']) => {
106-
switch (status) {
107-
case 'active':
108-
return 'default'
109-
case 'error':
110-
return 'destructive'
111-
case 'installing':
112-
return 'secondary'
113-
case 'stopped':
114-
return 'outline'
105+
const getStatusVariant = (installationType: string) => {
106+
switch (installationType) {
107+
case 'local':
108+
return 'default' // Green/success for local (ready)
109+
case 'cloud':
110+
return 'secondary' // Gray for cloud
115111
default:
116112
return 'secondary'
117113
}
118114
}
119115
120-
const getStatusText = (status: McpInstallation['status']) => {
121-
return t(`mcpInstallations.status.${status}`)
116+
const getStatusText = (installationType: string) => {
117+
switch (installationType) {
118+
case 'local':
119+
return t('mcpInstallations.status.ready')
120+
case 'cloud':
121+
return t('mcpInstallations.status.cloud')
122+
default:
123+
return t('mcpInstallations.status.unknown')
124+
}
122125
}
123126
124127
const formatDate = (dateString: string) => {
@@ -252,8 +255,8 @@ const handleInstallServer = () => {
252255
<p class="text-sm font-medium leading-none truncate">
253256
{{ installation.installation_name }}
254257
</p>
255-
<Badge :variant="getStatusVariant(installation.status)" class="text-xs">
256-
{{ getStatusText(installation.status) }}
258+
<Badge :variant="getStatusVariant(installation.installation_type)" class="text-xs">
259+
{{ getStatusText(installation.installation_type) }}
257260
</Badge>
258261
</div>
259262
<p class="text-sm text-muted-foreground truncate mb-1">

services/frontend/src/i18n/locales/en/mcp-installations.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export default {
1313
installing: 'Installing',
1414
stopped: 'Stopped',
1515
deprecated: 'Deprecated',
16-
maintenance: 'Maintenance'
16+
maintenance: 'Maintenance',
17+
ready: 'Ready',
18+
cloud: 'Cloud',
19+
unknown: 'Unknown'
1720
},
1821

1922
table: {

services/frontend/src/types/mcp-installations.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ export interface McpInstallation {
2626
installation_name: string
2727
server_id: string
2828
server: McpServer
29-
status: 'active' | 'error' | 'installing' | 'stopped'
29+
installation_type: 'local' | 'cloud'
3030
user_environment_variables: Record<string, string>
3131
team_id: string
32-
created_by: string
32+
user_id: string
3333
created_at: string
3434
updated_at: string
35+
last_used_at: string | null
3536
}
3637

3738
export interface InstallServerRequest {

services/frontend/src/views/teams/TeamTableColumns.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ const sortedTeams = computed(() => {
3030
return [...props.teams].sort((a, b) => a.name.localeCompare(b.name))
3131
})
3232
33-
// Helper function to check if user can manage a specific team
34-
const canManageTeam = (team: TeamWithRole): boolean => {
35-
return props.userPermissions.includes('teams.edit') && team.role === 'team_admin'
36-
}
37-
3833
// Helper function to format date
3934
const formatDate = (date: Date | string): string => {
4035
const dateObj = typeof date === 'string' ? new Date(date) : date

services/frontend/src/views/teams/manage/[id].vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ const canDeleteTeam = computed(() => {
7070
!team.value?.is_default
7171
})
7272
73-
const isTeamOwner = computed(() => {
74-
return team.value?.is_owner === true
75-
})
76-
7773
const hasChanges = computed(() => {
7874
if (!team.value) return false
7975
return formData.value.name !== team.value.name ||

0 commit comments

Comments
 (0)