add home link
This commit is contained in:
@@ -243,6 +243,18 @@ function updateText(id, text) {
|
||||
if (el) el.textContent = text;
|
||||
}
|
||||
|
||||
function updateSiteMeta(site, model, tzLabel) {
|
||||
const home = document.getElementById("site-home");
|
||||
const suffix = document.getElementById("site-meta-suffix");
|
||||
if (home) {
|
||||
home.textContent = site || "--";
|
||||
home.setAttribute("href", "/");
|
||||
}
|
||||
if (suffix) {
|
||||
suffix.textContent = ` | model ${model || "--"} | ${tzLabel}`;
|
||||
}
|
||||
}
|
||||
|
||||
function upsertChart(id, config) {
|
||||
const ctx = document.getElementById(id);
|
||||
if (!ctx) return;
|
||||
@@ -302,7 +314,7 @@ function baseOptions(range) {
|
||||
function renderDashboard(data) {
|
||||
const latest = data.latest;
|
||||
const tzLabel = state.tz === "utc" ? "UTC" : "Local";
|
||||
updateText("site-meta", `${data.site} | model ${data.model} | ${tzLabel}`);
|
||||
updateSiteMeta(data.site, data.model, tzLabel);
|
||||
updateText("last-updated", `updated ${formatDateTime(data.generated_at)}`);
|
||||
const forecastMeta = data.forecast && data.forecast.points && data.forecast.points.length
|
||||
? `forecast retrieved ${formatDateTime(data.forecast.retrieved_at)}`
|
||||
|
||||
Reference in New Issue
Block a user