fix(dashboard): deduplicate modal model list via set + normalize API names

- load(): normalize ollama-cloud/* names to short form, deduplicate with Set
- Prevents double entries when cache adds short names alongside API full names
This commit is contained in:
Deploy Bot
2026-05-28 12:50:49 +01:00
parent 56a844440f
commit 897b95072b

View File

@@ -142,7 +142,7 @@ function closeModal(id){$(id).classList.add('hidden');}
async function load(){
let mRes;
try{ mRes=await fetch(`${API_BASE}/api/models`); allAvailableModels=(await mRes.json()).models||[]; }
try{ mRes=await fetch(`${API_BASE}/api/models`); allAvailableModels=[...new Set((await mRes.json()).models.map(modelShort))].sort(); }
catch(e){ allAvailableModels=Object.keys(MODEL_BENCHMARKS); }
try{
const rRes=await fetch(`${API_BASE}/api/real-fit-report`);