Tidy the dashboard and setup pages, add one-click API keys
Test and publish / test (push) Successful in 20s
Test and publish / publish (push) Has been cancelled

Both pages share style.css and a top bar with Dashboard and Setup tabs.
The dashboard gains summary tiles, card sections and friendly kind names.
The setup page puts each collector in a collapsible section with its own
Generate key button, which picks a free name, copies the key and fills
it into that collector's steps. Command blocks get Copy buttons.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 21:32:57 +01:00
co-authored by Claude Opus 5.5
parent e6a93be15c
commit 13602272fc
6 changed files with 337 additions and 169 deletions
+2 -2
View File
@@ -81,7 +81,7 @@ tracker goal rm --id 2
The dashboard (`/`) and the setup page (`/setup`) have no login of their own. As in job-tracker, the tracker borrows the main site's session. It forwards the browser's cookies to the site backend's `GET /auth/validate-admin` and treats a 2xx as admin (`internal/auth`). A visitor who isn't signed in is sent to the site's `/admin/login?redirect=/tracker/`, which returns them afterwards. A "yes" is cached for 30 seconds per cookie, so signing out takes up to 30 seconds to reach the tracker. If the backend refreshes an expired token, its new cookies are passed back to the browser.
Signed in, the dashboard shows every device's data without asking for a key. The setup page has step-by-step instructions for each collector, with your server URL filled in. It also lists devices and creates and revokes their API keys, so you don't need `docker exec` for keys.
Signed in, the dashboard shows every device's data without asking for a key. The setup page has step-by-step instructions for each collector, with your server URL filled in. It also lists devices and creates and revokes their API keys, so you don't need `docker exec` for keys. Each collector's section has a **Generate key** button that names the device (for example `firefox`, or `hyprland-2` if that's taken), copies the key to the clipboard and fills it into that collector's steps.
Collectors never use the site login. Each one sends its own bearer key.
@@ -104,7 +104,7 @@ Collectors never use the site login. Each one sends its own bearer key.
| GET, POST | `/api/v1/devices` | admin | list devices; create one with `{"name","kind"}`, which returns its key once |
| DELETE | `/api/v1/devices/{name}` | admin | revoke a device's key |
| GET | `/`, `/setup` | admin | dashboard and setup pages |
| GET | `/tracker.user.js`, `/healthz`, `/readyz` | none | the browser userscript holds no secrets |
| GET | `/tracker.user.js`, `/style.css`, `/healthz`, `/readyz` | none | the browser userscript holds no secrets |
The event batch format is shared by all `*/events` endpoints. A batch holds at most 1000 events.