no message
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<span>Zeitraum</span>
|
||||
<select id="range">
|
||||
<option value="day">Tag</option>
|
||||
<option value="week">Woche (Mo–So)</option>
|
||||
<option value="week">Woche</option>
|
||||
<option value="month">Monat</option>
|
||||
<option value="total">Gesamt</option>
|
||||
</select>
|
||||
@@ -18,7 +18,7 @@
|
||||
</label>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -152,13 +152,13 @@
|
||||
donutCard({
|
||||
title: 'EVQ',
|
||||
percent: clamp01(evq / 100) * 100,
|
||||
subtitle: 'Eigenverbrauch / Produktion',
|
||||
subtitle: 'Eigenverb. / Produktion',
|
||||
color: '#63B3FF' // blau
|
||||
}),
|
||||
donutCard({
|
||||
title: 'Autarkiegrad',
|
||||
percent: clamp01(autark / 100) * 100,
|
||||
subtitle: 'Eigenverbrauch / Verbrauch',
|
||||
subtitle: 'Eigenverb / Verbrauch',
|
||||
color: '#A855F7' // lila
|
||||
})
|
||||
].join('');
|
||||
@@ -194,6 +194,22 @@
|
||||
render(data.values || {}, { hasData: data.hasData });
|
||||
};
|
||||
|
||||
// initial anstoßen
|
||||
setTimeout(() => requestAction('Refresh', 1), 200);
|
||||
function requestRefreshSoon() {
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user