asdasd
This commit is contained in:
@@ -485,15 +485,6 @@ function sendToActiveConsole(array $host, string $command, bool $strictHostKey):
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="card form-card" style="background:var(--panel-2);">
|
||||
<strong>Konsole Tabs</strong>
|
||||
<div class="console-tabs" data-console-tabs>
|
||||
<div class="console-tab-bar" data-console-tab-bar></div>
|
||||
<div class="console-tab-panels" data-console-tab-panels></div>
|
||||
</div>
|
||||
<p class="muted" style="margin-top:.5rem;">Mehrere Konsolen bleiben hier parallel offen.</p>
|
||||
</div>
|
||||
|
||||
<div class="modal" data-queue-modal aria-hidden="true">
|
||||
<div class="modal-card">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -11,6 +11,27 @@ if ($assets) {
|
||||
$notice = null;
|
||||
$error = null;
|
||||
|
||||
if (isset($_GET['status_json'])) {
|
||||
require_admin();
|
||||
$id = (int)($_GET['id'] ?? 0);
|
||||
$stmt = $pdo->prepare('SELECT * FROM ' . $table('hosts') . ' WHERE id = :id LIMIT 1');
|
||||
$stmt->execute(['id' => $id]);
|
||||
$host = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (!$host) {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode(['ok' => false, 'error' => 'not_found']);
|
||||
exit;
|
||||
}
|
||||
$settings = modules()->settings('pi_control');
|
||||
$strictHostKey = !empty($settings['terminal_strict_hostkey']);
|
||||
$reachable = hostReachable((string)($host['host'] ?? ''), (int)($host['port'] ?? 22));
|
||||
$authOk = $reachable ? hostAuthOk($host, $strictHostKey) : false;
|
||||
$status = !$reachable ? 'down' : ($authOk ? 'ok' : 'auth');
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode(['ok' => true, 'status' => $status]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
require_admin();
|
||||
$deleteId = (int)($_POST['delete_id'] ?? 0);
|
||||
@@ -223,12 +244,6 @@ function hostAuthOk(array $host, bool $strictHostKey): bool
|
||||
<?php else: ?>
|
||||
<div class="host-grid" style="margin-top:.75rem;">
|
||||
<?php foreach ($hosts as $h): ?>
|
||||
<?php
|
||||
$portVal = (int)($h['port'] ?? 22);
|
||||
$reachable = hostReachable((string)($h['host'] ?? ''), $portVal);
|
||||
$authOk = $reachable ? hostAuthOk($h, $strictHostKey) : false;
|
||||
$statusClass = !$reachable ? 'status-down' : ($authOk ? 'status-ok' : 'status-auth');
|
||||
?>
|
||||
<div class="host-card"
|
||||
data-host-id="<?= e((string)$h['id']) ?>"
|
||||
data-name="<?= e((string)($h['name'] ?? '')) ?>"
|
||||
@@ -244,7 +259,7 @@ function hostAuthOk(array $host, bool $strictHostKey): bool
|
||||
<div class="host-card-body">
|
||||
<div class="host-card-header">
|
||||
<div class="host-card-title">
|
||||
<span class="status-dot <?= $statusClass ?>"></span>
|
||||
<span class="status-dot status-auth" data-host-status></span>
|
||||
<strong><?= e((string)($h['name'] ?? '')) ?></strong>
|
||||
</div>
|
||||
<details class="action-menu">
|
||||
|
||||
Reference in New Issue
Block a user