asdasd
This commit is contained in:
@@ -8,6 +8,7 @@ $error = null;
|
||||
$terminalNotice = null;
|
||||
$terminalError = null;
|
||||
$terminalUrl = null;
|
||||
$terminalToken = null;
|
||||
|
||||
$settings = modules()->settings('pi_control');
|
||||
$ttydUrl = trim((string)($settings['ttyd_url'] ?? '/ttyd'));
|
||||
@@ -36,6 +37,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
: "DATETIME('now', '+{$tokenTtl} minutes')";
|
||||
|
||||
$token = bin2hex(random_bytes(24));
|
||||
$terminalToken = $token;
|
||||
$stmt = $pdo->prepare(
|
||||
'INSERT INTO ' . $table('sessions') . ' (token, host_id, provider, created_by, expires_at)
|
||||
VALUES (:token, :host_id, :provider, :created_by, ' . $expiresSql . ')'
|
||||
@@ -146,6 +148,11 @@ $runs = $pdo->query('SELECT * FROM ' . $table('runs') . ' ORDER BY id DESC LIMIT
|
||||
<strong>Aktive Konsole</strong>
|
||||
<a class="nav-link" href="<?= e($terminalUrl) ?>" target="_blank" rel="noopener">In neuem Tab öffnen</a>
|
||||
</div>
|
||||
<?php if ($terminalToken): ?>
|
||||
<div class="muted" style="margin-top:.5rem;">
|
||||
Token: <code><?= e($terminalToken) ?></code>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div style="margin-top:.75rem; border-radius:12px; overflow:hidden; border:1px solid var(--line); background:#0b0f17;">
|
||||
<iframe src="<?= e($terminalUrl) ?>" title="Pi Konsole" style="width:100%; height:520px; border:0;"></iframe>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user