Commit 1f1da553 by Delicious233 Committed by GitHub

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.
parent 5e866446
...@@ -79,6 +79,36 @@ function resolveModelProvider(modelName: string): ModelProvider | null { ...@@ -79,6 +79,36 @@ function resolveModelProvider(modelName: string): ModelProvider | null {
if (hasAny(['moonshot-', 'kimi-'])) { if (hasAny(['moonshot-', 'kimi-'])) {
return { icon: 'Moonshot.Color', label: 'Moonshot' } 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-'])) { if (hasAny(['mistral-', 'mixtral-'])) {
return { icon: 'Mistral.Color', label: 'Mistral' } return { icon: 'Mistral.Color', label: 'Mistral' }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment