more documentation and last 24h chart

This commit is contained in:
2026-01-28 08:42:20 +11:00
parent 2127a44872
commit 940af3680f
3 changed files with 75 additions and 27 deletions

View File

@@ -109,6 +109,13 @@ function computeRange(range, tz) {
axisEnd = end;
break;
}
case "24h-last": {
end = now;
start = new Date(now.getTime() - 24 * 60 * 60 * 1000);
axisStart = start;
axisEnd = end;
break;
}
case "72h": {
end = startOfDay(now, tz);
start = new Date(end.getTime() - 72 * 60 * 60 * 1000);
@@ -249,16 +256,6 @@ function renderDashboard(data) {
updateText("live-supercap", "--");
}
const forecastUrl = document.getElementById("forecast-url");
if (forecastUrl) {
if (data.open_meteo_url) {
forecastUrl.href = data.open_meteo_url;
forecastUrl.textContent = data.open_meteo_url;
} else {
forecastUrl.textContent = "--";
}
}
const obs = data.observations || [];
const forecastAll = (data.forecast && data.forecast.points) || [];

View File

@@ -19,6 +19,7 @@
<div class="controls">
<div class="segmented" role="group" aria-label="time range">
<button class="btn" data-range="6h">6h</button>
<button class="btn" data-range="24h-last">Last 24h</button>
<button class="btn active" data-range="24h">24h</button>
<button class="btn" data-range="72h">72h</button>
<button class="btn" data-range="7d">7d</button>
@@ -88,12 +89,6 @@
<div class="callout-title">Forecast Summary</div>
<div class="callout-body" id="forecast-summary">--</div>
</div>
<div class="callout">
<div class="callout-title">Forecast Request</div>
<div class="callout-body">
<a id="forecast-url" class="mono" href="#" target="_blank" rel="noreferrer">--</a>
</div>
</div>
</div>
</section>