Files
nexus/modules/pi_control/pages/index.php
Lars Gebhardt-Kusche d6f09326f4
All checks were successful
Deploy / deploy-staging (push) Successful in 6s
Deploy / deploy-production (push) Has been skipped
dsfdsf
2026-04-24 23:54:04 +02:00

42 lines
1.9 KiB
PHP

<?php
$pdo = module_fn('pi_control', 'pdo');
module_fn('pi_control', 'ensure_schema');
$table = fn(string $name) => module_fn('pi_control', 'table', $name);
$hostCount = (int)$pdo->query('SELECT COUNT(*) FROM ' . $table('hosts'))->fetchColumn();
$cmdCount = (int)$pdo->query('SELECT COUNT(*) FROM ' . $table('commands'))->fetchColumn();
$runCount = (int)$pdo->query('SELECT COUNT(*) FROM ' . $table('runs'))->fetchColumn();
?>
<?= module_shell_header('pi_control', [
'title' => 'Raspberry Pi Steuerung',
]) ?>
<div class="module-flow">
<section class="module-box">
<div class="module-box-head">
<div>
<h2 class="module-box-title">Raspberry Pi Steuerung</h2>
<p>SSH Hosts verwalten, Befehle definieren und Aktionen ausführen.</p>
</div>
</div>
</section>
<div class="module-box-grid module-box-grid--stats">
<div class="module-box-soft">
<strong>Hosts</strong>
<div class="muted" style="margin-top:.35rem;">Registriert: <?= e((string)$hostCount) ?></div>
<div style="margin-top:.75rem;"><a class="module-button module-button--secondary module-button--small" href="/module/pi_control/hosts">Hosts verwalten</a></div>
</div>
<div class="module-box-soft">
<strong>Befehle</strong>
<div class="muted" style="margin-top:.35rem;">Presets: <?= e((string)$cmdCount) ?></div>
<div style="margin-top:.75rem;"><a class="module-button module-button--secondary module-button--small" href="/module/pi_control/commands">Befehle verwalten</a></div>
</div>
<div class="module-box-soft">
<strong>Konsole</strong>
<div class="muted" style="margin-top:.35rem;">Runs: <?= e((string)$runCount) ?></div>
<div style="margin-top:.75rem;"><a class="module-button module-button--secondary module-button--small" href="/module/pi_control/console">Konsole öffnen</a></div>
</div>
</div>
</div>
<?= module_shell_footer() ?>