feat: Add public status page with 10-second polling

Implement status.corrosionmgmt.com public status page showcasing all
Corrosion servers that opt-in. Drives platform visibility and attracts
new customers.

Backend:
- Migration 007: status_page_description TEXT column
- models/public.rs: PublicServerStatus, PlatformHealth, StatusPageResponse
- db/public.rs: get_public_servers() with uptime calculations (24h/7d/30d)
- api/public.rs: GET /api/public/status (no auth)
- api/settings.rs: public site config endpoints (auth required)

Frontend:
- StatusPageView.vue: Server grid with live stats, uptime badges, wipe schedules
- Platform health header: total servers, online count, total players
- Auto-refresh every 10 seconds via polling
- Mobile-responsive design
- SettingsView.vue: Public Status tab with opt-in toggle

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell
2026-02-15 14:24:32 -05:00
parent 1f5516bbec
commit dfa605f44f
9 changed files with 954 additions and 8 deletions

View File

@@ -4,6 +4,47 @@ All notable changes to this project will be documented in this file.
## [Unreleased]
### Added (Phase 3 — Public Status Page)
**Backend:**
- Migration 007: Added `status_page_description` TEXT column to `public_site_config`
- Public API models (`models/public.rs`):
- `PublicServerStatus` — Server status with live stats for public display
- `PlatformHealth` — Platform-wide health metrics (total servers, online count, total players, uptime)
- `StatusPageResponse` — Complete status page data structure
- `PublicSiteConfig` — Full public site configuration model
- Public database queries (`db/public.rs`):
- `get_public_servers()` — Retrieves all opted-in servers with current stats, uptime percentages (24h/7d/30d), wipe schedules
- `get_platform_health()` — Calculates platform-wide aggregate metrics
- `calculate_uptime_percentage()` — Uptime calculation from hourly stats
- `format_cron_expression()` — Human-readable wipe schedule formatting
- `get_public_site_config()` / `create_public_site_config()` / `update_public_site_config()` — Config management
- Public API endpoint (`api/public.rs`):
- `GET /api/public/status` — Public status page data (no auth required)
- Settings API (`api/settings.rs`):
- `GET /api/settings/public-site` — Fetch public site config (auth required)
- `PUT /api/settings/public-site` — Update status page opt-in and description (auth required)
**Frontend:**
- `StatusPageView.vue` — Complete public status page with:
- Platform health header (total servers, online now, total players, platform uptime)
- Server grid with status indicators (green/yellow/red), player counts, uptime badges (24h/7d/30d)
- Wipe schedule display with countdown timers
- Server search/filter functionality
- Auto-refresh every 10 seconds via polling
- Mobile-responsive grid layout
- "Powered by Corrosion" footer with panel link
- Settings dashboard integration (`SettingsView.vue`):
- New "Public Status" tab with toggle for `show_on_status_page`
- Text area for `status_page_description`
- Save endpoint integration
**Infrastructure:**
- nginx already configured for `status.corrosionmgmt.com` routing
- Router already configured with `/status` route on both panel and marketing domains
**Purpose:** Public-facing marketing page showcasing all Corrosion servers. Drives platform visibility and attracts new customers ("I want this for my server too").
### Added (Phase 2.2 — Player Retention Analytics)
**Backend:**