Conversation
…st Now
Five UI surfaces wired up against data the agent + monitor were already
collecting but never showing:
1. Agent metrics card (Machines page expanded row)
New /api/machines/{id}/agent-status proxies the agent's /status through
the rathole back-channel. The expanded row renders load avg, memory %,
disk %, agent uptime, hostname, kernel — fetched on demand only when
the row is open, so collapsed rows have zero cost.
2. Health-check sparkline + uptime %
monitor.go now writes a HealthCheck row per probe (subject="tunnel:<id>")
alongside its existing tunnel.Status update. The new
db.GetHealthSummary aggregates {uptime_percent, recent[]} for the
24-hour rolling window in one query. Frontend Sparkline renders the
recent[] as 30 emerald/red squares, right-aligned newest-first.
3. Per-tunnel uptime % column
New "Uptime" column on the Tunnels page shows colored % (green ≥99,
amber ≥95, red below) + the sparkline + "last checked" relative time.
Synthesized SSH/agent rows reuse the parent machine's "machine:<id>"
subject — they share lifecycle, no point recording separately.
4. Last-seen / last-checked timestamps
Machines page swaps the absolute toLocaleString last_seen for
relativeTime ("2m ago"). Tunnel cells show the same. Hover for the
exact timestamp via title attribute.
5. Test now button
Per-machine button in the health panel calls the existing
POST /machines/{id}/health/check endpoint and invalidates
machine-health + agent-status caches so the new data renders
immediately, instead of waiting for the next 60s health poll.
Helpers landed in frontend/src/lib/time.ts (relativeTime, formatBytes,
formatDuration). New components: Sparkline, MachineHealthPanel,
TunnelHealthCell. No new tables — everything builds on HealthCheck rows.
The previous cell stacked percentage / sparkline / last-checked across three rows, doubling the height of every tunnel row. Visually noisy once you have more than a few tunnels. Now: just the colored percentage in the table cell. Hover (native title attribute) reveals the full breakdown — uptime %, ok/total, last-checked relative + absolute, latest error if any. Survives the table wrapper's overflow-hidden which would clip a custom popover. The fuller sparkline view stays on the per-machine health panel (Machines page expanded row) where vertical space isn't constrained.
|
Unit tests run: 275 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolves #12
Changes Made
Testing
Screenshots (if applicable)