module_fn('pi_control', 'table', $name); $assets = app()->assets(); if ($assets) { $assets->addStyle('/module/pi_control/asset?file=pi_control.css'); } $notice = null; $error = null; if ($_SERVER['REQUEST_METHOD'] === 'POST') { require_admin(); $label = trim((string)($_POST['label'] ?? '')); $command = trim((string)($_POST['command'] ?? '')); $adminOnly = !empty($_POST['admin_only']) ? 1 : 0; $timeoutSec = (int)($_POST['timeout_sec'] ?? 0); if ($label === '' || $command === '') { $error = 'Bitte Label und Command angeben.'; } else { $stmt = $pdo->prepare( 'INSERT INTO ' . $table('commands') . ' (label, command, admin_only, timeout_sec) VALUES (:label, :command, :admin_only, :timeout_sec)' ); $stmt->execute([ 'label' => $label, 'command' => $command, 'admin_only' => $adminOnly, 'timeout_sec' => $timeoutSec > 0 ? $timeoutSec : null, ]); $notice = 'Befehl gespeichert.'; } } $commands = $pdo->query('SELECT * FROM ' . $table('commands') . ' ORDER BY id DESC')->fetchAll(PDO::FETCH_ASSOC); ?>
Pi Control

Befehle

Verwalte vordefinierte SSH-Befehle.

Neuer Befehl
Vorhandene Befehle
Label Command Timeout Admin
Keine Befehle vorhanden.