diff --git a/server/src/wled_controller/static/js/features/dashboard.js b/server/src/wled_controller/static/js/features/dashboard.js index 29a212b..64b397f 100644 --- a/server/src/wled_controller/static/js/features/dashboard.js +++ b/server/src/wled_controller/static/js/features/dashboard.js @@ -295,10 +295,11 @@ export async function loadDashboard(forceFullRender = false) { if (!container) { set_dashboardLoading(false); return; } try { - const [targetsResp, profilesResp, devicesResp] = await Promise.all([ + const [targetsResp, profilesResp, devicesResp, cssResp] = await Promise.all([ fetchWithAuth('/picture-targets'), fetchWithAuth('/profiles').catch(() => null), fetchWithAuth('/devices').catch(() => null), + fetchWithAuth('/color-strip-sources').catch(() => null), ]); const targetsData = await targetsResp.json(); @@ -308,6 +309,9 @@ export async function loadDashboard(forceFullRender = false) { const devicesData = devicesResp && devicesResp.ok ? await devicesResp.json() : { devices: [] }; const devicesMap = {}; for (const d of (devicesData.devices || [])) { devicesMap[d.id] = d; } + const cssData = cssResp && cssResp.ok ? await cssResp.json() : { sources: [] }; + const cssSourceMap = {}; + for (const s of (cssData.sources || [])) { cssSourceMap[s.id] = s; } // Build dynamic HTML (targets, profiles) let dynamicHtml = ''; @@ -367,7 +371,7 @@ export async function loadDashboard(forceFullRender = false) { if (running.length > 0) { runningIds = running.map(t => t.id); const stopAllBtn = ``; - const runningItems = running.map(target => renderDashboardTarget(target, true, devicesMap)).join(''); + const runningItems = running.map(target => renderDashboardTarget(target, true, devicesMap, cssSourceMap)).join(''); targetsInner += `