mirror of
https://github.com/horizon-rust/horizon-site.git
synced 2026-12-03 19:12:41 +07:00
[PR #30] [MERGED] Players page (/stats): the live count, its history and the official server's #32
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
horizon-rust/horizon-site#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/horizon-rust/horizon-site/pull/30
Author: @ludovic111
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111
Base:
main← Head:feat/stats-page📝 Commits (1)
490e981Players page (/stats): the live count, its history and the official server's📊 Changes
10 files changed (+559 additions, -13 deletions)
View changed files
📝
Caddyfile(+2 -1)📝
build.mjs(+7 -5)📝
src/index.html(+2 -2)📝
src/main.js(+3 -3)📝
src/privacy.html(+2 -2)➕
src/stats-page.js(+171 -0)➕
src/stats.html(+95 -0)➕
src/stats.js(+180 -0)➕
src/stats.test.mjs(+76 -0)📝
src/style.css(+21 -0)📄 Description
Ludovic asked (2026-10-31) for a live, shareable view of how many play Horizon and its peaks over time, plus the official server's players. This is the site half; the data comes from the telemetry server changes in horizon-rust/horizon#5217 (exact count, history,
GET /v1/live/history) and #5235 (the official server's series). Merge this after both are deployed on Railway, or the charts say "The history isn't available right now".The page (
/stats, "Players" in the footers)GET /v1/live, refreshed every minute), today's peak (the reader's day, to the minute), the all-time peak with its date, and how many have a world open to LAN or friends.aria-pressedbuttons, as on Releases). Inline SVG drawn bysrc/stats.js, no library or CDN: one y axis from 0, the highest count per point as an area (--chart-1) and the average as a dashed line (--chart-2), the staff charts' validated colours for both themes. A tooltip follows the pointer; the chart is focusable and the arrow keys/Home/End move the cursor (announced in a live region). A "Table" disclosure lists every point. Gaps where the server wasn't recording break the line. The chart is drawn at its own width, so the axis text stays readable on a phone./stats; Privacy says the count is exact and what the server writes down each minute (totals only)./statsis in the Caddyfile (rewrite,no-cache) and the sitemap. No new origin:telemetry.playhorizon.devwas already in the CSP.Checks
node --test src/ scripts/: 71 pass (newsrc/stats.test.mjs: number format, axis top, gaps, the SVG stays in its frame, the table, local-hour ticks, today's peak, the platform split, titles).node build.mjs: builds.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.