From 93bc684e8c5c4795b244096b752f2b9991b1b824 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sat, 31 May 2025 11:00:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=97=A7=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=8F=90=E4=BE=9B=E5=95=86=E7=B1=BB=E5=9E=8B=E6=98=A0?= =?UTF-8?q?=E5=B0=84=E4=BB=A5=E5=85=BC=E5=AE=B9=E6=80=A7=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelogs/v3.5.13.md | 1 + dashboard/src/views/ProviderPage.vue | 34 ++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) 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; + }); } },