rebuild to module
This commit is contained in:
22
modules/kea/pages/index.php
Normal file
22
modules/kea/pages/index.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
use App\Repository\KeaHostRepository;
|
||||
|
||||
$module = modules()->get('kea');
|
||||
$fallback = $module['db_defaults'] ?? [];
|
||||
|
||||
$pdo = modules()->modulePdo('kea', $fallback);
|
||||
$hosts = [];
|
||||
$error = null;
|
||||
|
||||
if ($pdo) {
|
||||
try {
|
||||
$repo = new KeaHostRepository($pdo);
|
||||
$hosts = $repo->findAll(50);
|
||||
} catch (\Exception $e) {
|
||||
$error = "Datenbankfehler: " . $e->getMessage();
|
||||
}
|
||||
} else {
|
||||
$error = "Modul nicht konfiguriert. Bitte Setup ausführen.";
|
||||
}
|
||||
|
||||
module_tpl('kea', 'dashboard', compact('hosts', 'error'));
|
||||
Reference in New Issue
Block a user