Server: HTML dashboard at /dashboard showing all sites + session history

Browsable at /dashboard — authenticates via ?key=<api_key> once per browser
session (stored in a PHP session cookie). Lists all sites ordered by most-
recently-active, with session counts and in-progress badge. Click any site
to see its full healthcheck history with dates and durations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 09:01:05 +01:00
parent 3d67b94896
commit 9f13d871bf
3 changed files with 257 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
declare(strict_types=1);
use AttHc\Server\Config;
use AttHc\Server\Controllers\Dashboard;
use AttHc\Server\Controllers\Healthchecks;
use AttHc\Server\Controllers\Sites;
use AttHc\Server\Controllers\Steps;
@@ -27,5 +28,6 @@ $router->add('PUT', '/healthchecks/{id}/steps/{step_id}', [Steps::class
$router->add('GET', '/healthchecks/steps/{step_id}', [Steps::class, 'history']);
$router->add('GET', '/step-counts', [Steps::class, 'counts']);
$router->add('GET', '/sites', [Sites::class, 'recent']);
$router->add('GET', '/dashboard', [Dashboard::class, 'index'], requiresAuth: false);
return $router;