|
15 | 15 |
|
16 | 16 |
|
17 | 17 | <el-row :gutter="8"> |
18 | | - <el-col v-for="tool in mcpTools" :key="tool.name" :xs="24" :sm="12" :md="8" :lg="6"> |
19 | | - <el-card class="mb-5 h-[150px] flex flex-col overflow-hidden"> |
| 18 | + <el-col v-for="tool in mcpTools" :key="tool.name" :xs="24" :sm="12" :md="12" :lg="8"> |
| 19 | + <el-card class="mb-5 min-h-[150px] flex flex-col overflow-hidden"> |
20 | 20 | <template #header> |
21 | 21 | <div class="flex justify-between items-center font-bold"> |
22 | 22 | <span>{{ tool.name }}</span> |
|
25 | 25 | </el-tooltip> |
26 | 26 | </div> |
27 | 27 | </template> |
28 | | - <div class="text-sm">{{ tool.description }}</div> |
| 28 | + <div class="text-sm mb-1">{{ tool.description }}</div> |
| 29 | + <div v-if="tool.inputSchema && tool.inputSchema.properties && Object.keys(tool.inputSchema.properties).length > 0" class="mt-1 text-xs overflow-y-auto max-h-[100px] p-2 border-t border-gray-200 bg-gray-50 rounded-b"> |
| 30 | + <p class="font-semibold mb-1 text-gray-700 flex items-center"> |
| 31 | + <span class="mr-1 my-2">参数列表</span> |
| 32 | + <span class="text-xs text-gray-500">({{ Object.keys(tool.inputSchema.properties).length }})</span> |
| 33 | + </p> |
| 34 | + <div class="space-y-2"> |
| 35 | + <div v-for="(propDetails, propName) in tool.inputSchema.properties" :key="propName" class="flex flex-col p-1.5 bg-white rounded border border-gray-100 hover:border-gray-300 transition-colors"> |
| 36 | + <div class="flex items-center justify-between"> |
| 37 | + <div class="flex items-center"> |
| 38 | + <span class="font-medium text-gray-800">{{ propName }}</span> |
| 39 | + <span v-if="tool.inputSchema.required && tool.inputSchema.required.includes(propName)" class="ml-1 text-red-500 text-xs">*</span> |
| 40 | + </div> |
| 41 | + <span class="text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded">{{ propDetails.type }}</span> |
| 42 | + </div> |
| 43 | + <div class="text-gray-500 mt-0.5 text-xs line-clamp-2" :title="propDetails.description || '无描述'"> |
| 44 | + {{ propDetails.description || '无描述' }} |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + </div> |
| 48 | + </div> |
| 49 | + <div v-else class="mt-1 text-xs p-2 border-t border-gray-200 bg-gray-50 rounded-b flex items-center justify-center"> |
| 50 | + <span class="text-gray-500 italic py-3">无输入参数</span> |
| 51 | + </div> |
29 | 52 | </el-card> |
30 | 53 | </el-col> |
31 | 54 | </el-row> |
|
0 commit comments