已配置模型显示id的bug修复

This commit is contained in:
2026-01-22 14:21:48 +08:00
parent d7fa8583f7
commit 7109bdc9aa
2 changed files with 9 additions and 3 deletions

View File

@@ -275,7 +275,10 @@
const contentText = showLoading ? '<span class="text-gray-400">正在调用模型API...</span>' : '<span class="text-gray-300">模型即将开始生成回答...</span>';
grid.innerHTML = displayModelIds.map((modelId, index) => {
const model = allAvailableModels.find(m => m.id === modelId) || { name: `模型 ${modelId}` };
// 支持 ID 数字或模型名称字符串匹配
const model = allAvailableModels.find(m =>
m.id == modelId || m.id === modelId || m.name === modelId
) || { name: modelId };
const colors = ['bg-blue-100 text-blue-700', 'bg-green-100 text-green-700', 'bg-purple-100 text-purple-700', 'bg-orange-100 text-orange-700'];
const colorClass = colors[index % colors.length];
return `