diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-07-24 20:06:17 +0100 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-07-24 20:06:17 +0100 |
| commit | eb719a5416391521d536980e974f97b7ac8b78e3 (patch) | |
| tree | 50867dedfe62c5d0e429e71d2000eeeba74cba05 /174bg/database/volumes/pocketbase/pb_hooks/views/stats.html | |
| parent | 5cae0bed9d2504f1c644ee6f3a27e570f9ceeb03 (diff) | |
| download | unnamed-group-eb719a5416391521d536980e974f97b7ac8b78e3.tar unnamed-group-eb719a5416391521d536980e974f97b7ac8b78e3.tar.gz unnamed-group-eb719a5416391521d536980e974f97b7ac8b78e3.tar.bz2 unnamed-group-eb719a5416391521d536980e974f97b7ac8b78e3.tar.xz unnamed-group-eb719a5416391521d536980e974f97b7ac8b78e3.zip | |
stats page
Diffstat (limited to '174bg/database/volumes/pocketbase/pb_hooks/views/stats.html')
| -rw-r--r-- | 174bg/database/volumes/pocketbase/pb_hooks/views/stats.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/174bg/database/volumes/pocketbase/pb_hooks/views/stats.html b/174bg/database/volumes/pocketbase/pb_hooks/views/stats.html new file mode 100644 index 0000000..b59c1a7 --- /dev/null +++ b/174bg/database/volumes/pocketbase/pb_hooks/views/stats.html @@ -0,0 +1,25 @@ +{{define "title"}} + stats +{{end}} + +{{define "body"}} + <p id="timeDifference">Time Difference: {{.timeDifference}}</p> + <p id="withinThreshold">Within Threshold: {{.withinThreshold}}</p> + + <script> + window.addEventListener("load", () => { + setInterval(fetchStats, 100); + }); + + async function fetchStats() { + let heartbeat = await fetch("/api/heartbeat"); + heartbeat = await heartbeat.json(); + + const timeDifference = heartbeat.timeDifference; + const withinThreshold = heartbeat.withinThreshold; + + document.getElementById("timeDifference").textContent = `Time Difference: ${timeDifference}`; + document.getElementById("withinThreshold").textContent = `Within Threshold: ${withinThreshold}`; + } + </script> +{{end}}
\ No newline at end of file |
