more documentation and last 24h chart
This commit is contained in:
@@ -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) || [];
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user