@@ -18,13 +18,13 @@ import {
1818 SelectContent ,
1919 SelectItem ,
2020 SelectTrigger ,
21- SelectValue ,
2221} from ' @/components/ui/select'
2322import { Badge } from ' @/components/ui/badge'
2423import { Button } from ' @/components/ui/button'
2524import { Alert , AlertDescription } from ' @/components/ui/alert'
2625import { Switch } from ' @/components/ui/switch'
2726import { X , Plus , CheckCircle } from ' lucide-vue-next'
27+ import { DynamicIcon } from ' @/components/ui/dynamic-icon'
2828import type { BasicInfoFormData } from ' @/views/admin/mcp-server-catalog/types'
2929import { useCategories } from ' @/composables/admin/mcp-catalog/useCategories'
3030import { useTagManager } from ' @/composables/admin/mcp-catalog/useTagManager'
@@ -66,6 +66,11 @@ const isAutoPopulated = computed(() => {
6666 return props .formData ?.github ?.auto_populated || false
6767})
6868
69+ // Get selected category for displaying icon in trigger
70+ const selectedCategory = computed (() => {
71+ return categories .value .find (c => c .id === localData .value .category_id )
72+ })
73+
6974// Update field helper
7075const updateField = <K extends keyof BasicInfoFormData >(field : K , value : BasicInfoFormData [K ]) => {
7176 const newData = {
@@ -125,19 +130,31 @@ loadCategories()
125130 :disabled =" categoriesLoading "
126131 >
127132 <SelectTrigger >
128- <SelectValue
129- :placeholder =" categoriesLoading
130- ? ' Loading categories...'
131- : t (' mcpCatalog.form.basic.category.placeholder' ) "
132- />
133+ <div class =" flex items-center gap-2" >
134+ <DynamicIcon
135+ v-if =" selectedCategory ?.icon "
136+ :name =" selectedCategory .icon "
137+ class="h-4 w-4 shrink-0 text-muted-foreground"
138+ />
139+ <span class =" truncate" >
140+ {{ selectedCategory?.name || (categoriesLoading ? 'Loading categories...' : t('mcpCatalog.form.basic.category.placeholder')) }}
141+ </span >
142+ </div >
133143 </SelectTrigger >
134144 <SelectContent >
135145 <SelectItem
136146 v-for =" category in categories "
137147 :key =" category .id "
138148 :value =" category .id "
139149 >
140- {{ category.name }}
150+ <div class =" flex items-center gap-2" >
151+ <DynamicIcon
152+ v-if =" category .icon "
153+ :name =" category .icon "
154+ class="h-4 w-4 shrink-0 text-muted-foreground"
155+ />
156+ <span >{{ category.name }}</span >
157+ </div >
141158 </SelectItem >
142159 </SelectContent >
143160 </Select >
@@ -273,6 +290,20 @@ loadCategories()
273290 />
274291 </SharedFormField >
275292
293+ <!-- Icon URL -->
294+ <SharedFormField
295+ label="Icon URL"
296+ description="URL to the server icon image (auto-generated from GitHub avatar if not provided)"
297+ >
298+ <Input
299+ id="icon_url"
300+ :model-value =" localData .icon_url "
301+ @update :model-value =" (value ) => updateField (' icon_url' , String (value )) "
302+ placeholder="https://example.com /icon.png "
303+ type="url"
304+ />
305+ </SharedFormField >
306+
276307 <!-- Tags -->
277308 <SharedFormField
278309 :label =" t (' mcpCatalog.form.basic.tags.label' )"
0 commit comments