fix: add crosslink from weather CSS card to weather source entity
Some checks failed
Lint & Test / test (push) Failing after 29s

This commit is contained in:
2026-03-24 18:58:29 +03:00
parent ef33935188
commit a62e2f474d

View File

@@ -1083,9 +1083,13 @@ const CSS_CARD_RENDERERS: Record<string, CardPropsRenderer> = {
weather: (source, { clockBadge }) => { weather: (source, { clockBadge }) => {
const speedVal = (source.speed ?? 1.0).toFixed(1); const speedVal = (source.speed ?? 1.0).toFixed(1);
const tempInfl = (source.temperature_influence ?? 0.5).toFixed(1); const tempInfl = (source.temperature_influence ?? 0.5).toFixed(1);
const wsName = (_cachedWeatherSources || []).find((w: any) => w.id === source.weather_source_id)?.name || '—'; const ws = (_cachedWeatherSources || []).find((w: any) => w.id === source.weather_source_id);
const wsName = ws?.name || '—';
const wsLink = ws
? ` stream-card-link" onclick="event.stopPropagation(); navigateToCard('streams','weather','weather-sources','data-id','${source.weather_source_id}')`
: '';
return ` return `
<span class="stream-card-prop">${getColorStripIcon('weather')} ${escapeHtml(wsName)}</span> <span class="stream-card-prop${wsLink}" title="${t('color_strip.weather.source')}">${ICON_LINK_SOURCE} ${escapeHtml(wsName)}</span>
<span class="stream-card-prop">⏩ ${speedVal}x</span> <span class="stream-card-prop">⏩ ${speedVal}x</span>
<span class="stream-card-prop">🌡 ${tempInfl}</span> <span class="stream-card-prop">🌡 ${tempInfl}</span>
${clockBadge} ${clockBadge}