fix(web): 移除 AIModelStatus 假綠燈 — Gemini/NVIDIA 不應 assumed up
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled

根因: /api/v1/health 的 components 只有 api/database/redis/ollama/openclaw
     d.components.gemini 永遠 undefined → healthy: true 是硬編碼假數據

修復: 改為只有 components 有對應 key 才更新狀態
     無 health 資料時保持 false(unknown),不顯示假綠燈

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-09 18:51:14 +08:00
parent a4d6b3f3e6
commit a2a98452ad

View File

@@ -34,8 +34,10 @@ export function AIModelStatus() {
setModels(prev => prev.map(m => {
if (m.name.includes('OpenClaw') && d.components.openclaw) return { ...m, healthy: d.components.openclaw.status === 'up' }
if (m.name.includes('Ollama') && d.components.ollama) return { ...m, healthy: d.components.ollama.status === 'up' }
if (m.name.includes('Gemini')) return { ...m, healthy: true } // cloud assumed up
if (m.name.includes('NVIDIA')) return { ...m, healthy: true }
// 2026-04-09 Claude Sonnet 4.6: 移除假數據 — /api/v1/health 無 gemini/nvidia component
// cloud 模型狀態未知,保持 false不顯示假綠燈
if (m.name.includes('Gemini') && d.components.gemini) return { ...m, healthy: d.components.gemini.status === 'up' }
if (m.name.includes('NVIDIA') && d.components.nvidia) return { ...m, healthy: d.components.nvidia.status === 'up' }
return m
}))
})