Skip to content

Commit 538b258

Browse files
author
Lasim
committed
feat(frontend): add programming language selection to technical step
1 parent b8f24d6 commit 538b258

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

services/frontend/src/components/admin/mcp-catalog/TechnicalStep.vue

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,14 @@ const isUpdatingFromStorage = ref(false)
6161
// Load data from storage
6262
const loadFromStorage = () => {
6363
const storedData = eventBus.getState<TechnicalFormData>(STORAGE_KEY)
64+
6465
if (storedData) {
6566
localData.value = { ...localData.value, ...storedData }
67+
} else if (props.formData?.technical) {
68+
// If no stored data but we have initial form data (edit mode), use it
69+
localData.value = { ...localData.value, ...props.formData.technical }
70+
// Save it to storage for consistency
71+
saveToStorage()
6672
}
6773
}
6874
@@ -98,6 +104,22 @@ const handleStorageChange = (data: { key: string; newValue: any }) => {
98104
// Watch for changes in localData and save to storage
99105
watch(localData, saveToStorage, { deep: true })
100106
107+
// Watch for changes in props.formData to handle initial data loading in edit mode
108+
watch(
109+
() => props.formData?.technical,
110+
(newTechnicalData) => {
111+
if (newTechnicalData && isEditMode.value) {
112+
// Only update if storage doesn't already have data or if the language is missing
113+
const storedData = eventBus.getState<TechnicalFormData>(STORAGE_KEY)
114+
if (!storedData || !storedData.language) {
115+
localData.value = { ...localData.value, ...newTechnicalData }
116+
saveToStorage()
117+
}
118+
}
119+
},
120+
{ immediate: true, deep: true }
121+
)
122+
101123
// Example configuration for hover card
102124
const exampleConfig = `{
103125
"mcpServers": {
@@ -397,6 +419,44 @@ onUnmounted(() => {
397419
<!-- Structured Form Fields -->
398420
<div class="mt-6 border-t border-gray-100">
399421
<dl class="divide-y divide-gray-100">
422+
<!-- Language Selection -->
423+
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
424+
<dt class="text-sm/6 font-medium text-gray-900">{{ t('mcpCatalog.form.technical.language.label') }}</dt>
425+
<dd class="mt-1 sm:col-span-2 sm:mt-0">
426+
<Select
427+
:model-value="localData.language"
428+
@update:model-value="(value) => updateField('language', String(value || ''))"
429+
>
430+
<SelectTrigger>
431+
<SelectValue :placeholder="t('mcpCatalog.form.technical.language.placeholder')" />
432+
</SelectTrigger>
433+
<SelectContent>
434+
<SelectItem value="JavaScript">
435+
{{ t('mcpCatalog.form.technical.language.options.javascript') }}
436+
</SelectItem>
437+
<SelectItem value="TypeScript">
438+
{{ t('mcpCatalog.form.technical.language.options.typescript') }}
439+
</SelectItem>
440+
<SelectItem value="Python">
441+
{{ t('mcpCatalog.form.technical.language.options.python') }}
442+
</SelectItem>
443+
<SelectItem value="Go">
444+
{{ t('mcpCatalog.form.technical.language.options.go') }}
445+
</SelectItem>
446+
<SelectItem value="C#">
447+
{{ t('mcpCatalog.form.technical.language.options.csharp') }}
448+
</SelectItem>
449+
<SelectItem value="C++">
450+
{{ t('mcpCatalog.form.technical.language.options.cpp') }}
451+
</SelectItem>
452+
</SelectContent>
453+
</Select>
454+
<p class="text-xs text-muted-foreground mt-1">
455+
{{ t('mcpCatalog.form.technical.language.description') }}
456+
</p>
457+
</dd>
458+
</div>
459+
400460
<!-- Transport Type -->
401461
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
402462
<dt class="text-sm/6 font-medium text-gray-900">{{ t('mcpCatalog.form.technical.transportType.label') }}</dt>

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,16 @@ export default {
235235
description: 'Define runtime and installation requirements',
236236
language: {
237237
label: 'Programming Language',
238-
placeholder: 'Select language',
239-
description: 'Primary programming language used'
238+
placeholder: 'Select programming language',
239+
description: 'Primary programming language used for this MCP server',
240+
options: {
241+
typescript: 'TypeScript',
242+
javascript: 'JavaScript',
243+
python: 'Python',
244+
go: 'Go',
245+
csharp: 'C#',
246+
cpp: 'C++'
247+
}
240248
},
241249
runtime: {
242250
label: 'Runtime Environment',

0 commit comments

Comments
 (0)