|
164 | 164 | class="d-flex flex-wrap ga-1"> |
165 | 165 | <v-chip v-for="toolName in viewingPersona.tools" :key="toolName" size="small" |
166 | 166 | color="primary" variant="tonal"> |
167 | | - {{ toolName }} |
| 167 | + {{ getToolDisplayName(toolName) }} |
168 | 168 | </v-chip> |
169 | 169 | </div> |
170 | 170 | <div v-else class="text-body-2 text-medium-emphasis"> |
|
265 | 265 |
|
266 | 266 | <script lang="ts"> |
267 | 267 | import { defineComponent } from 'vue'; |
| 268 | +import axios from 'axios'; |
268 | 269 | import { useI18n, useModuleI18n } from '@/i18n/composables'; |
269 | 270 | import { usePersonaStore } from '@/stores/personaStore'; |
270 | 271 | import { mapState, mapActions } from 'pinia'; |
@@ -347,7 +348,10 @@ export default defineComponent({ |
347 | 348 |
|
348 | 349 | // 骨架屏延迟显示控制 |
349 | 350 | showSkeleton: false, |
350 | | - skeletonTimer: null as ReturnType<typeof setTimeout> | null |
| 351 | + skeletonTimer: null as ReturnType<typeof setTimeout> | null, |
| 352 | +
|
| 353 | + // 工具列表用于显示名称 |
| 354 | + availableTools: [] as any[] |
351 | 355 | }; |
352 | 356 | }, |
353 | 357 | computed: { |
@@ -411,10 +415,27 @@ export default defineComponent({ |
411 | 415 | async initialize() { |
412 | 416 | await Promise.all([ |
413 | 417 | this.loadFolderTree(), |
414 | | - this.navigateToFolder(null) |
| 418 | + this.navigateToFolder(null), |
| 419 | + this.loadTools() |
415 | 420 | ]); |
416 | 421 | }, |
417 | 422 |
|
| 423 | + async loadTools() { |
| 424 | + try { |
| 425 | + const response = await axios.get('/api/tools/list'); |
| 426 | + if (response.data.status === 'ok') { |
| 427 | + this.availableTools = response.data.data || []; |
| 428 | + } |
| 429 | + } catch (error) { |
| 430 | + console.error('Failed to load tools:', error); |
| 431 | + } |
| 432 | + }, |
| 433 | +
|
| 434 | + getToolDisplayName(toolName: string): string { |
| 435 | + const tool = this.availableTools.find(t => t.name === toolName); |
| 436 | + return tool?.display_name || toolName; |
| 437 | + }, |
| 438 | +
|
418 | 439 | // Persona 操作 |
419 | 440 | openCreatePersonaDialog() { |
420 | 441 | this.editingPersona = null; |
|
0 commit comments