diff --git a/changelogs/v3.5.13.md b/changelogs/v3.5.13.md index 1a674f1f8..25411fccc 100644 --- a/changelogs/v3.5.13.md +++ b/changelogs/v3.5.13.md @@ -4,3 +4,4 @@ 2. 修复:修复 WebUI Chat 接口的未授权访问安全漏洞、插件 README 可能存在的 XSS 注入漏洞 3. 优化:优化 Vec DB 在 indexing 过程时的数据库事务处理 4. 修复:WebUI 下,插件市场的推荐卡片无法点击帮助文档的问题 +5. 新增:知识库 diff --git a/dashboard/src/views/ProviderPage.vue b/dashboard/src/views/ProviderPage.vue index 55c61f70f..5c6bd2f39 100644 --- a/dashboard/src/views/ProviderPage.vue +++ b/dashboard/src/views/ProviderPage.vue @@ -307,6 +307,28 @@ export default { // 添加提供商类型分类 activeProviderTypeTab: 'all', + + // 兼容旧版本(< v3.5.11)的 mapping,用于映射到对应的提供商能力类型 + oldVersionProviderTypeMapping: { + "openai_chat_completion": "chat_completion", + "anthropic_chat_completion": "chat_completion", + "googlegenai_chat_completion": "chat_completion", + "zhipu_chat_completion": "chat_completion", + "llm_tuner": "chat_completion", + "dify": "chat_completion", + "dashscope": "chat_completion", + "openai_whisper_api": "speech_to_text", + "openai_whisper_selfhost": "speech_to_text", + "sensevoice_stt_selfhost": "speech_to_text", + "openai_tts_api": "text_to_speech", + "edge_tts": "text_to_speech", + "gsvi_tts_api": "text_to_speech", + "fishaudio_tts_api": "text_to_speech", + "dashscope_tts": "text_to_speech", + "azure_tts": "text_to_speech", + "minimax_tts_api": "text_to_speech", + "volcengine_tts": "text_to_speech", + } } }, @@ -317,8 +339,16 @@ export default { return this.config_data.provider || []; } - return this.config_data.provider.filter(provider => - provider.provider_type === this.activeProviderTypeTab); + return this.config_data.provider.filter(provider => { + // 如果provider.provider_type已经存在,直接使用它 + if (provider.provider_type) { + return provider.provider_type === this.activeProviderTypeTab; + } + + // 否则使用映射关系 + const mappedType = this.oldVersionProviderTypeMapping[provider.type]; + return mappedType === this.activeProviderTypeTab; + }); } },