From c66fe05d0af04b73e2d95bdfbdebca806cd98d3d Mon Sep 17 00:00:00 2001 From: dwot <68145+dwot@users.noreply.github.com> Date: Tue, 7 Jan 2025 20:38:16 -0500 Subject: [PATCH] Fix scan link --- web/templates/pages/index.html | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/web/templates/pages/index.html b/web/templates/pages/index.html index f00a1d6..466e888 100644 --- a/web/templates/pages/index.html +++ b/web/templates/pages/index.html @@ -32,12 +32,7 @@ - -
- -
- - +

{{ .lcl.plants_overview }}

@@ -95,12 +90,14 @@

{{ .lcl.plants_overview }}

document.addEventListener("DOMContentLoaded", async () => { const sensorsOverview = document.getElementById("sensorsOverview"); + // Define titles for each group const groupTitles = { Other: {{ .lcl.title_group_other }}, ACIP: {{ .lcl.title_group_acip }}, Soil: {{ .lcl.title_group_soil }} }; + // Create spinner element const spinner = document.createElement("div"); spinner.classList.add("spinner-border", "text-primary"); spinner.setAttribute("role", "status"); @@ -257,6 +254,18 @@

${zone}

zoneContainer.appendChild(cardRow); sensorsOverview.appendChild(zoneContainer); }); + + // Add click event to sensor rows + console.time("Add Click Events"); + document.querySelectorAll(".sensor-row").forEach((row) => { + row.addEventListener("click", () => { + const sensorId = row.getAttribute("data-id"); + if (sensorId) { + window.location.href = `/graph/${sensorId}`; + } + }); + }); + } catch (error) { console.error("Error fetching data:", error); }