no message
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<span>Zeitraum</span>
|
<span>Zeitraum</span>
|
||||||
<select id="range">
|
<select id="range">
|
||||||
<option value="day">Tag</option>
|
<option value="day">Tag</option>
|
||||||
<option value="week">Woche (Mo–So)</option>
|
<option value="week">Woche</option>
|
||||||
<option value="month">Monat</option>
|
<option value="month">Monat</option>
|
||||||
<option value="total">Gesamt</option>
|
<option value="total">Gesamt</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<button id="prev" type="button">◀</button>
|
<button id="prev" type="button">◀</button>
|
||||||
<button id="today" type="button">Heute</button>
|
<button id="today" type="button">Letzter Zeit Punkt</button>
|
||||||
<button id="next" type="button">▶</button>
|
<button id="next" type="button">▶</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -152,13 +152,13 @@
|
|||||||
donutCard({
|
donutCard({
|
||||||
title: 'EVQ',
|
title: 'EVQ',
|
||||||
percent: clamp01(evq / 100) * 100,
|
percent: clamp01(evq / 100) * 100,
|
||||||
subtitle: 'Eigenverbrauch / Produktion',
|
subtitle: 'Eigenverb. / Produktion',
|
||||||
color: '#63B3FF' // blau
|
color: '#63B3FF' // blau
|
||||||
}),
|
}),
|
||||||
donutCard({
|
donutCard({
|
||||||
title: 'Autarkiegrad',
|
title: 'Autarkiegrad',
|
||||||
percent: clamp01(autark / 100) * 100,
|
percent: clamp01(autark / 100) * 100,
|
||||||
subtitle: 'Eigenverbrauch / Verbrauch',
|
subtitle: 'Eigenverb / Verbrauch',
|
||||||
color: '#A855F7' // lila
|
color: '#A855F7' // lila
|
||||||
})
|
})
|
||||||
].join('');
|
].join('');
|
||||||
@@ -194,6 +194,22 @@
|
|||||||
render(data.values || {}, { hasData: data.hasData });
|
render(data.values || {}, { hasData: data.hasData });
|
||||||
};
|
};
|
||||||
|
|
||||||
// initial anstoßen
|
function requestRefreshSoon() {
|
||||||
setTimeout(() => requestAction('Refresh', 1), 200);
|
setTimeout(() => requestAction('Refresh', 1), 150);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1) beim Start
|
||||||
|
requestRefreshSoon();
|
||||||
|
|
||||||
|
// 2) wenn das Tile neu sichtbar wird (z.B. nach Maximieren)
|
||||||
|
document.addEventListener('visibilitychange', () => {
|
||||||
|
if (!document.hidden) requestRefreshSoon();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 3) bei Größenänderung (Maximieren/Responsive)
|
||||||
|
let rsTimer = null;
|
||||||
|
window.addEventListener('resize', () => {
|
||||||
|
clearTimeout(rsTimer);
|
||||||
|
rsTimer = setTimeout(() => requestAction('Refresh', 1), 200);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user