fix: match installed by manifest_id only, add manifest_id field

This commit is contained in:
2026-07-27 08:54:52 +08:00
parent ae4bffd79f
commit 76d9cc3975
2 changed files with 3 additions and 3 deletions
+2 -3
View File
@@ -36,12 +36,11 @@ const PageMarket = {
const items = data.items || [];
let localIds = [];
let localNames = [];
try { const lr = await fetch('/api/dashboards?category=all'); const ld = await lr.json(); if (Array.isArray(ld)) { localIds = ld.map(d => d.id); localNames = ld.map(d => d.name); } } catch(e) {}
try { const lr = await fetch('/api/dashboards?category=all'); const ld = await lr.json(); if (Array.isArray(ld)) localIds = ld.map(d => d.id); } catch(e) {}
if (!items.length) { grid.innerHTML = this._emptyHtml(isScene ? '暂无场景' : '暂无仪表盘'); return; }
grid.innerHTML = items.map(d => {
const installed = localIds.includes(d.name || d.id) || localNames.includes(d.name);
const installed = localIds.includes(d.manifest_id || d.name || d.id);
return this._cardHtml(d, isScene, installed);
}).join('');
} catch (e) { grid.innerHTML = '<div style="text-align:center;padding:40px;color:var(--danger);">加载失败</div>'; }