fix: match installed by manifest_id only, add manifest_id field
This commit is contained in:
@@ -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>'; }
|
||||
|
||||
Reference in New Issue
Block a user