From 1f1da5536b38a2e0d9faafb8c46e1609c6f23fe9 Mon Sep 17 00:00:00 2001 From: Delicious233 <2991573049@qq.com> Date: Sun, 21 Jun 2026 12:07:31 +0800 Subject: [PATCH] fix(usage-logs): show provider icons for CN models (align with classic frontend) (#5631) resolveModelProvider in model-badge.tsx only covered mainstream providers (OpenAI/Claude/Gemini/Grok/DeepSeek/Qwen/Doubao/Moonshot/Mistral/Meta/Cohere). Models from Zhipu (glm-), MiniMax, Xiaomi MiMo, Baidu (ernie), iFlyTek (spark), Tencent (hunyuan), Baichuan, InternLM, StepFun, and Yi rendered as grey dots instead of their brand icons in the usage logs table. Add keyword mappings for these providers, aligning coverage with the classic frontend's getModelCategories. Icons resolved via @lobehub/icons. --- .../usage-logs/components/model-badge.tsx | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/web/default/src/features/usage-logs/components/model-badge.tsx b/web/default/src/features/usage-logs/components/model-badge.tsx index 7ef3df97..40f50c46 100644 --- a/web/default/src/features/usage-logs/components/model-badge.tsx +++ b/web/default/src/features/usage-logs/components/model-badge.tsx @@ -79,6 +79,36 @@ function resolveModelProvider(modelName: string): ModelProvider | null { if (hasAny(['moonshot-', 'kimi-'])) { return { icon: 'Moonshot.Color', label: 'Moonshot' } } + if (hasAny(['minimax', 'abab'])) { + return { icon: 'Minimax.Color', label: 'MiniMax' } + } + if (hasAny(['glm-', 'chatglm', 'cogview', 'cogvideo'])) { + return { icon: 'Zhipu.Color', label: 'Zhipu' } + } + if (hasAny(['mimo-'])) { + return { icon: 'XiaomiMiMo', label: 'MiMo' } + } + if (hasAny(['ernie'])) { + return { icon: 'Wenxin.Color', label: 'Baidu' } + } + if (hasAny(['spark'])) { + return { icon: 'Spark.Color', label: 'iFlyTek' } + } + if (hasAny(['hunyuan'])) { + return { icon: 'Hunyuan.Color', label: 'Tencent' } + } + if (hasAny(['baichuan'])) { + return { icon: 'Baichuan.Color', label: 'Baichuan' } + } + if (hasAny(['internlm'])) { + return { icon: 'InternLM.Color', label: 'InternLM' } + } + if (hasAny(['step-'])) { + return { icon: 'StepFun.Color', label: 'StepFun' } + } + if (hasAny(['yi-'])) { + return { icon: 'Yi.Color', label: 'Yi' } + } if (hasAny(['mistral-', 'mixtral-'])) { return { icon: 'Mistral.Color', label: 'Mistral' } }