dashboard - whole redesign and rewrite

This commit is contained in:
2026-09-04 13:15:08 +02:00
parent 87fc43db87
commit 01b4be301f
9 changed files with 273 additions and 99 deletions
@@ -9,7 +9,6 @@ date_default_timezone_set('Europe/Berlin');
require_once __DIR__ . '/util/dashboard_helpers.php';
$resource = (string) ($_GET['resource'] ?? 'content');
$pdo = null;
try {
switch ($resource) {
@@ -29,6 +28,10 @@ try {
case 'outdoor':
$payload = ['outdoor' => dashboard_fetch_outdoor_weather()];
break;
case 'departures_eich':
require_once __DIR__ . '/util/bvg.php';
$payload = dashboard_fetch_departures();
break;
default:
http_response_code(400);
$payload = ['error' => 'Unbekannte Dashboard-Ressource.'];
@@ -39,6 +42,4 @@ try {
http_response_code(502);
error_log('Dashboard data endpoint (' . $resource . '): ' . $exception->getMessage());
echo json_encode(['error' => 'Dashboard-Daten konnten nicht geladen werden.'], JSON_UNESCAPED_UNICODE);
} finally {
$pdo = null;
}