rebuild to module
This commit is contained in:
@@ -1,22 +1,34 @@
|
||||
<?php
|
||||
use App\Database;
|
||||
use App\Repository\KeaHostRepository;
|
||||
$modules = modules()->all();
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="pill">Core</div>
|
||||
<h1 style="margin-top:.75rem;">Nexus Basis-System</h1>
|
||||
<p class="muted">Aktive Module verwalten und neue Module initialisieren.</p>
|
||||
|
||||
global $appConfig;
|
||||
<div style="margin-top:1rem;">
|
||||
<a class="nav-link" href="/modules">Module verwalten</a>
|
||||
</div>
|
||||
|
||||
$pdo = Database::createPdo($appConfig);
|
||||
$hosts = [];
|
||||
$error = null;
|
||||
|
||||
if ($pdo) {
|
||||
try {
|
||||
$repo = new KeaHostRepository($pdo);
|
||||
$hosts = $repo->findAll(50);
|
||||
} catch (\Exception $e) {
|
||||
$error = "Datenbankfehler: " . $e->getMessage();
|
||||
}
|
||||
} else {
|
||||
$error = "Datenbankverbindung ist nicht konfiguriert oder deaktiviert.";
|
||||
}
|
||||
|
||||
tpl('kea_dashboard', 'landing', compact('hosts', 'error'));
|
||||
<div style="margin-top:1.5rem;" class="grid">
|
||||
<?php foreach ($modules as $module): ?>
|
||||
<div class="card" style="background:var(--panel-2);">
|
||||
<div style="display:flex; align-items:center; justify-content:space-between; gap:12px;">
|
||||
<div>
|
||||
<strong><?= e($module['title']) ?></strong>
|
||||
<div class="muted" style="font-size:.85rem;"><?= e($module['description'] ?? '') ?></div>
|
||||
</div>
|
||||
<?php if (!empty($module['enabled'])): ?>
|
||||
<span class="pill" style="border-color:var(--accent-2); color:var(--accent-2);">aktiv</span>
|
||||
<?php else: ?>
|
||||
<span class="pill">inaktiv</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div style="margin-top:.75rem; display:flex; gap:10px; flex-wrap:wrap;">
|
||||
<a class="nav-link" href="/module/<?= e($module['name']) ?>">Öffnen</a>
|
||||
<a class="nav-link" href="/modules/setup/<?= e($module['name']) ?>">Setup</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user