From 8688167da6bc81c9aa841cfeecc55ca3e11f88d0 Mon Sep 17 00:00:00 2001 From: blaerf Date: Mon, 17 Nov 2025 06:36:08 +0100 Subject: [PATCH] =?UTF-8?q?SNMP=20Teil=20hinzugef=C3=BCgt=20und=20router?= =?UTF-8?q?=20angepasst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/index.php b/public/index.php index c8d556a..f9b853e 100644 --- a/public/index.php +++ b/public/index.php @@ -46,6 +46,7 @@ if (file_exists($configPath) === false) { $config = require $configPath; use App\Controllers\AuthController; +use App\Controllers\DashboardController; // Hilfsfunktion für geschützte Routen function requireLogin(array $config): void @@ -67,6 +68,9 @@ $route = $_GET['route'] ?? 'login'; // Neue Instanz der Klasse AuthController erstellen (wird bei Bedarf über den Autoloader geladen). $authController = new AuthController($config); +// Neue Instanz der Klasse DashboardController erstellen (wird bei Bedarf über den Autoloader geladen). +$dashboardController = new DashboardController($config); + // Anhand des Routing-Ziels (route) entscheiden, welcher Code ausgeführt wird. switch ($route) { case 'login': @@ -87,10 +91,7 @@ switch ($route) { case 'dashboard': requireLogin($config); - // Später: DashboardController aufrufen - echo '

Dashboard (Platzhalter)

'; - echo '

Hier kommt später dein SNMP/Server-Status hin.

'; - echo '

Logout

'; + $dashboardController->show(); break; default: