chore: add TUI screenshots via VHS with realistic seed data
Screenshots capture 4 views: monitors dashboard (hero), detail panel, alerts tab, and logs tab. Seed data uses homelab-themed monitors with a SQL backfill for rich sparkline history, state changes, and log entries. Also fixes latencySparkline to color DOWN checks red instead of green — previously failed checks with 0ms latency rendered as green bars.
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# VHS screenshot setup: seed monitors, backfill history, start server.
|
||||
set -e
|
||||
DB="${1:?usage: setup.sh <db-path>}"
|
||||
|
||||
rm -f "$DB" "$DB-shm" "$DB-wal"
|
||||
|
||||
echo "==> Seeding monitors and alerts..."
|
||||
UPTOP_DB_DSN="$DB" ./uptop apply -f vhs/seed.yaml 2>&1
|
||||
|
||||
echo "==> Backfilling check history..."
|
||||
BACKFILL_OUT=$(go run ./vhs/backfill/ "$DB")
|
||||
echo "$BACKFILL_OUT"
|
||||
|
||||
PUSH_TOKEN=$(echo "$BACKFILL_OUT" | grep '^PUSH_TOKEN=' | cut -d= -f2)
|
||||
if [ -n "$PUSH_TOKEN" ]; then
|
||||
echo "==> Sending push heartbeat in 15s (background)..."
|
||||
(sleep 15 && curl -s "http://localhost:18099/api/push" -H "Authorization: Bearer $PUSH_TOKEN" > /dev/null 2>&1) &
|
||||
fi
|
||||
|
||||
echo "==> Starting uptop server..."
|
||||
exec env \
|
||||
UPTOP_DB_DSN="$DB" \
|
||||
UPTOP_PORT=23299 \
|
||||
UPTOP_HTTP_PORT=18099 \
|
||||
UPTOP_ALLOW_PRIVATE_TARGETS=true \
|
||||
./uptop serve 2>/dev/null
|
||||
Reference in New Issue
Block a user