feat: Enhance agent settings navigation and error handling in UI components

- Introduced a new method to handle navigation to agent settings, improving code organization and reusability.
- Updated tooltip content in the agent mode button to include a link for quick access to agent settings.
- Enhanced error handling in the KnowledgeBase component to provide actionable links for VLM configuration errors.
- Added initial section handling in the KnowledgeBaseEditorModal for improved user experience during knowledge base editing.
This commit is contained in:
wizardchen
2025-11-07 16:40:53 +08:00
parent d387fd672f
commit f30720f99b
10 changed files with 133 additions and 48 deletions
@@ -119,10 +119,13 @@ import { MessagePlugin } from 'tdesign-vue-next'
import { createKnowledgeBase, getKnowledgeBaseById, listKnowledgeFiles, updateKnowledgeBase } from '@/api/knowledge-base'
import { updateKBConfig, type KBModelConfigRequest } from '@/api/initialization'
import { listModels } from '@/api/model'
import { useUIStore } from '@/stores/ui'
import KBModelConfig from './settings/KBModelConfig.vue'
import KBChunkingSettings from './settings/KBChunkingSettings.vue'
import KBAdvancedSettings from './settings/KBAdvancedSettings.vue'
const uiStore = useUIStore()
// Props
const props = defineProps<{
visible: boolean
@@ -506,6 +509,11 @@ watch(() => props.visible, async (newVal) => {
// 打开弹窗时,先重置状态
resetState()
// 检查是否有初始 section,如果有则跳转
if (uiStore.kbEditorInitialSection) {
currentSection.value = uiStore.kbEditorInitialSection
}
// 加载模型列表
await loadAllModels()
@@ -521,6 +529,7 @@ watch(() => props.visible, async (newVal) => {
// 关闭弹窗时,延迟重置状态(等待动画结束)
setTimeout(() => {
resetState()
currentSection.value = 'basic' // 重置为默认 section
}, 300)
}
})