clupilot/app/resources/views/livewire/pages/sites/show.blade.php

993 lines
67 KiB
PHP

<?php
use App\Models\Site;
use Livewire\Attributes\Layout;
use Livewire\Attributes\Url;
use Livewire\Volt\Component;
new #[Layout('layouts.app')] class extends Component {
public Site $site;
#[Url(as: 'tab')]
public string $tab = 'overview';
public string $activeFile = 'htdocs/wp-config.php';
public bool $logFollow = true;
public string $currentLog = 'access';
/** Set of dir paths currently expanded in file tree. */
public array $openDirs = ['htdocs', 'htdocs/wp-content', 'htdocs/wp-content/themes', 'htdocs/wp-content/themes/storefront-child', 'logs'];
/** vhost / http / tls settings (in-memory for now). */
public string $httpVersion = 'http2'; // http1 | http2 | http3
public bool $hsts = true;
public int $hstsMaxAge = 31536000;
public bool $forceHttps = true;
public bool $brotli = true;
public string $tlsMin = '1.3';
public string $sslProvider = 'letsencrypt'; // letsencrypt | custom | cloudflare
public function mount(Site $site): void
{
$this->site = $site->load(['server', 'certificate', 'crons']);
}
public function setTab(string $t): void { $this->tab = $t; }
public function setActiveFile(string $path): void { $this->activeFile = $path; }
public function setLog(string $type): void { $this->currentLog = $type; }
public function toggleDir(string $path): void
{
if (in_array($path, $this->openDirs, true)) {
$this->openDirs = array_values(array_diff($this->openDirs, [$path]));
} else {
$this->openDirs[] = $path;
}
}
public function toggleMaintenance(): void
{
$this->site->maintenance_mode = ! $this->site->maintenance_mode;
$this->site->save();
}
public function toggleCache(): void { $this->site->cache_enabled = ! $this->site->cache_enabled; $this->site->save(); }
public function toggleCdn(): void { $this->site->cdn_enabled = ! $this->site->cdn_enabled; $this->site->save(); }
/* File tree (nested) — verbatim from templates/akutell/sitedetails.js */
public function getFileTreeProperty(): array
{
return [
[
'name' => 'htdocs', 'type' => 'dir', 'open' => true,
'children' => [
['name' => 'wp-admin', 'type' => 'dir', 'children' => []],
[
'name' => 'wp-content', 'type' => 'dir', 'open' => true,
'children' => [
[
'name' => 'themes', 'type' => 'dir', 'open' => true,
'children' => [
[
'name' => 'storefront-child', 'type' => 'dir', 'open' => true,
'children' => [
['name' => 'functions.php', 'type' => 'file', 'lang' => 'PHP', 'path' => 'htdocs/wp-content/themes/storefront-child/functions.php'],
['name' => 'style.css', 'type' => 'file', 'lang' => 'CSS', 'path' => 'htdocs/wp-content/themes/storefront-child/style.css'],
],
],
],
],
['name' => 'plugins', 'type' => 'dir', 'children' => []],
['name' => 'uploads', 'type' => 'dir', 'children' => []],
],
],
['name' => 'wp-includes', 'type' => 'dir', 'children' => []],
['name' => '.htaccess', 'type' => 'file', 'lang' => 'APACHE', 'path' => 'htdocs/.htaccess'],
['name' => 'index.php', 'type' => 'file', 'lang' => 'PHP', 'path' => 'htdocs/index.php'],
['name' => 'robots.txt', 'type' => 'file', 'lang' => 'TEXT', 'path' => 'htdocs/robots.txt'],
['name' => 'wp-config.php','type' => 'file', 'lang' => 'PHP', 'path' => 'htdocs/wp-config.php'],
],
],
['name' => 'php.ini', 'type' => 'file', 'lang' => 'INI', 'path' => 'php.ini'],
[
'name' => 'logs', 'type' => 'dir', 'open' => true,
'children' => [
['name' => 'access.log', 'type' => 'file', 'lang' => 'LOG', 'path' => 'logs/access.log'],
['name' => 'error.log', 'type' => 'file', 'lang' => 'LOG', 'path' => 'logs/error.log'],
],
],
];
}
/* fileContents from sitedetails.js verbatim */
public function getFileContentsProperty(): array
{
return [
'htdocs/wp-config.php' => <<<'PHP'
<?php
/**
* Basis-Konfiguration für WordPress — shop.bergmann-coffee.com
*/
// ** Datenbank-Einstellungen ** //
define( 'DB_NAME', 'bergmann_prod' );
define( 'DB_USER', 'bergmann_wp' );
define( 'DB_PASSWORD', getenv('WP_DB_PASS') );
define( 'DB_HOST', '127.0.0.1:3306' );
define( 'DB_CHARSET', 'utf8mb4' );
define( 'DB_COLLATE', '' );
$table_prefix = 'wp_bg_';
// ** Speicher & Performance ** //
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
define( 'AUTOSAVE_INTERVAL', 60 );
define( 'WP_POST_REVISIONS', 10 );
define( 'WP_CACHE', true );
// ** Sicherheit ** //
define( 'DISALLOW_FILE_EDIT', true );
define( 'FORCE_SSL_ADMIN', true );
define( 'AUTOMATIC_UPDATER_DISABLED', false );
// ** Debug ** //
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', '/var/www/bergmann/logs/wp-debug.log' );
define( 'WP_DEBUG_DISPLAY', false );
if ( ! defined( 'ABSPATH' ) ) define( 'ABSPATH', __DIR__ . '/' );
require_once ABSPATH . 'wp-settings.php';
PHP,
'htdocs/.htaccess' => <<<'TXT'
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
<IfModule mod_headers.c>
Header set X-Content-Type-Options nosniff
Header set X-Frame-Options SAMEORIGIN
Header set Referrer-Policy strict-origin-when-cross-origin
</IfModule>
TXT,
'htdocs/robots.txt' => <<<'TXT'
User-agent: *
Disallow: /wp-admin/
Disallow: /warenkorb/
Disallow: /checkout/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://shop.bergmann-coffee.com/sitemap_index.xml
TXT,
'htdocs/index.php' => <<<'PHP'
<?php
/** Sets up the WordPress Environment. */
define( 'WP_USE_THEMES', true );
require __DIR__ . '/wp-blog-header.php';
PHP,
'htdocs/wp-content/themes/storefront-child/functions.php' => <<<'PHP'
<?php
// Storefront-Child Funktionen — bergmann-coffee
add_action('wp_enqueue_scripts', function () {
wp_enqueue_style('storefront-style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('storefront-child', get_stylesheet_uri(), ['storefront-style']);
});
add_filter('manage_edit-shop_order_columns', function ($cols) {
$cols['region'] = 'Region';
return $cols;
});
add_filter('woocommerce_checkout_fields', function ($fields) {
unset($fields['billing']['billing_company']);
return $fields;
});
add_filter('heartbeat_settings', fn ($s) => array_merge($s, ['interval' => 60]));
PHP,
'htdocs/wp-content/themes/storefront-child/style.css' => <<<'CSS'
/*
Theme Name: Storefront Child — Bergmann
Template: storefront
*/
:root { --brand: #15a06a; --brand-dark: #0d6c4a; }
.button.alt { background: var(--brand); border-color: var(--brand); }
.button.alt:hover { background: var(--brand-dark); }
CSS,
'php.ini' => <<<'INI'
; bergmann-coffee · php-fpm pool
memory_limit = 256M
max_execution_time = 60
max_input_time = 60
upload_max_filesize = 64M
post_max_size = 64M
date.timezone = Europe/Berlin
opcache.enable = 1
opcache.memory_consumption = 256
opcache.max_accelerated_files = 20000
opcache.validate_timestamps = 0
INI,
'logs/access.log' => <<<'LOG'
192.0.2.41 - - [12/Mai/2026:09:12:04 +0200] "GET /shop/ HTTP/2.0" 200 18421
203.0.113.7 - - [12/Mai/2026:09:12:05 +0200] "GET /wp-json/wc/store/cart HTTP/2.0" 200 842
192.0.2.41 - - [12/Mai/2026:09:12:09 +0200] "POST /?wc-ajax=add_to_cart HTTP/2.0" 200 311
LOG,
'logs/error.log' => "[error] PHP Notice: Undefined index 'shipping_zone' in cart.php:88\n[error] Uncaught TypeError: count(): Argument must be array in class-wc-cart.php:412\n",
];
}
/* Log entries per type (xterm renders these client-side) */
public function getLogDataProperty(): array
{
return [
'access' => [
['09:12:04', 'INFO', '192.0.2.41 "GET /shop/" 200 18421 — 142ms'],
['09:12:05', 'INFO', '203.0.113.7 "GET /wp-json/wc/store/cart" 200 842 — 38ms'],
['09:12:09', 'INFO', '192.0.2.41 "POST /?wc-ajax=add_to_cart" 200 311 — 96ms'],
['09:12:14', 'INFO', '198.51.100.2 "GET /produkt/espresso-blend/" 200 21044 — 158ms'],
['09:12:21', 'WARN', '45.155.* "GET /wp-login.php" 403 — rate-limit'],
['09:12:33', 'INFO', '192.0.2.88 "GET /warenkorb/" 200 9920 — 71ms'],
['09:12:40', 'INFO', 'Googlebot "GET /sitemap_index.xml" 200 4210 — 22ms'],
['09:12:48', 'INFO', '192.0.2.41 "POST /checkout/" 302 0 — 210ms'],
],
'error' => [
['09:05:11', 'WARN', 'PHP Notice: Undefined index "shipping_zone" in cart.php:88'],
['09:07:42', 'ERROR', 'Uncaught TypeError: count(): Argument must be array — class-wc-cart.php:412'],
['09:09:03', 'INFO', 'Cache geleert: object-cache (redis) — 18421 keys'],
['08:58:19', 'WARN', 'Slow query (2,1s): wp_bg_postmeta — SELECT meta_value …'],
],
'php' => [
['09:00:01', 'OK', 'php-fpm pool "bergmann" reloaded — 8 worker'],
['09:03:55', 'INFO', 'OPcache: 4218 scripts cached, 99.2% hit rate'],
['09:08:12', 'WARN', 'Worker 3: memory peak 214M / 256M'],
['09:11:40', 'INFO', 'request /checkout/ — 210ms, mem 41M'],
],
'wp' => [
['09:01:00', 'DEBUG', 'WC_Cart::calculate_totals() — 12 items'],
['09:04:22', 'DEBUG', 'do_action("woocommerce_payment_complete", 48211)'],
['09:06:30', 'WARN', 'Plugin "Smart Coupons" deprecated hook: woocommerce_add_to_cart'],
['09:10:05', 'DEBUG', 'wp_mail() → kunde@example.com — Bestellbestätigung #48211'],
],
];
}
public function getCurrentFileContentProperty(): string
{
return $this->fileContents[$this->activeFile] ?? '';
}
}; ?>
@php
/** Recursive file tree renderer (folder toggle via Livewire). */
if (! function_exists('clu_render_tree')) {
function clu_render_tree(array $items, string $activeFile, array $openDirs, string $base = ''): string {
$out = '';
foreach ($items as $node) {
$isDir = ($node['type'] ?? '') === 'dir';
$myPath = ltrim($base . '/' . $node['name'], '/');
$isOpen = $isDir && in_array($myPath, $openDirs, true);
$isActive = ! $isDir && ($node['path'] ?? null) === $activeFile;
$rowClass = 'clu-tree-item' . ($isDir ? ' dir' : '') . ($isOpen ? ' open' : '') . ($isActive ? ' active' : '');
$click = $isDir
? 'wire:click="toggleDir(\''.addslashes($myPath).'\')"'
: 'wire:click="setActiveFile(\''.addslashes($node['path']).'\')"';
$ico = $isDir
? '<svg class="ti-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg>'
: '<svg class="ti-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/></svg>';
$chev = $isDir
? '<svg class="clu-chev" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 6l6 6-6 6"/></svg>'
: '<span style="width:11px;flex:none;"></span>';
$out .= '<div class="'.$rowClass.'" '.$click.'>'.$chev.$ico.'<span>'.htmlspecialchars($node['name']).'</span></div>';
if ($isDir && ! empty($node['children'])) {
$hidden = $isOpen ? '' : ' collapsed';
$out .= '<div class="clu-tree-children'.$hidden.'">'.clu_render_tree($node['children'], $activeFile, $openDirs, $myPath).'</div>';
}
}
return $out;
}
}
@endphp
<div>
{{-- ── Topbar ── --}}
<div class="clu-topbar">
<x-clu.burger />
<a href="{{ route('sites.index') }}" wire:navigate class="clu-icon-btn" aria-label="Zurück">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 18l-6-6 6-6"/></svg>
</a>
<div class="clu-site-hero">
<div class="clu-favicon" style="background:#15a06a;">{{ mb_strtoupper(mb_substr($site->domain, 0, 1)) }}</div>
<div>
<h1>{{ $site->domain }}</h1>
<div class="sub">
<span>{{ $site->server->name }}</span>
<span>· wp {{ $site->wp_version }}</span>
<span>· php {{ $site->php_version }}</span>
<span>· ssl ✓</span>
</div>
</div>
</div>
<span class="clu-status-chip"><span class="clu-pulse-dot"></span> online</span>
<div class="spacer"></div>
<a href="https://{{ $site->domain }}" target="_blank" rel="noopener" class="clu-ghost-btn">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 3h7v7M21 3l-9 9M19 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5"/></svg>
Besuchen
</a>
<button class="clu-btn-primary" style="height:36px;padding:0 14px;" type="button">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 17l5-5-5-5M13 19h7"/></svg>
WP-Admin
</button>
</div>
{{-- ── Tab bar ── --}}
<div class="clu-dtabs mb-[18px]" role="tablist">
@foreach (['overview' => ['Übersicht', '<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>'], 'wp' => ['WordPress', '<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/>'], 'vhost' => ['vHost', '<path d="M2 12h20M2 6h20M2 18h20"/>'], 'ssl' => ['SSL / TLS', '<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>'], 'access' => ['SSH / FTP', '<path d="M4 17l5-5-5-5M13 19h7"/>'], 'php' => ['PHP / ini', '<path d="M4 7h16M4 12h16M4 17h10"/>'], 'files' => ['Datei-Manager', '<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'], 'cron' => ['Cronjobs', '<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>'], 'logs' => ['Logs', '<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 8h10M7 12h10M7 16h6"/>']] as $key => [$label, $svg])
<button type="button" role="tab"
wire:click="setTab('{{ $key }}')"
class="clu-dtab @if($tab === $key) active @endif">
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9">{!! $svg !!}</svg>
{{ $label }}
@if ($key === 'cron' && $site->crons->count())
<span class="count">{{ $site->crons->count() }}</span>
@endif
</button>
@endforeach
</div>
{{-- ────── OVERVIEW ────── --}}
@if ($tab === 'overview')
<div class="clu-pane">
<div class="grid gap-[14px]" style="grid-template-columns:repeat(auto-fit,minmax(220px,1fr));">
<div class="clu-metric"><div class="clu-metric-row"><span class="clu-metric-label">Besucher / 24h</span></div><div class="clu-metric-value">{{ number_format($site->visitors_24h, 0, ',', '.') }}</div><div class="clu-metric-delta">↑ 9.2% vs. gestern</div></div>
<div class="clu-metric"><div class="clu-metric-row"><span class="clu-metric-label">Speicher</span></div><div class="clu-metric-value">14.2<span class="unit">/40 GB</span></div><div class="clu-metric-delta">36% genutzt</div></div>
<div class="clu-metric success"><div class="clu-metric-row"><span class="clu-metric-label">PageSpeed</span></div><div class="clu-metric-value">{{ $site->pagespeed_score }}<span class="unit">/100</span></div><div class="clu-metric-delta">Core Web Vitals OK</div></div>
<div class="clu-metric @if($site->updates_pending > 0) warning @endif"><div class="clu-metric-row"><span class="clu-metric-label">Updates</span></div><div class="clu-metric-value">{{ $site->updates_pending }}</div><div class="clu-metric-delta @if($site->updates_pending > 0) warn @endif">{{ $site->updates_pending > 0 ? 'verfügbar' : 'aktuell' }}</div></div>
</div>
<div class="grid gap-[14px]" style="grid-template-columns:1fr 1fr;">
<div class="clu-card">
<div class="clu-card-head"><h3>Installation</h3></div>
<div class="clu-card-body" style="display:flex;flex-direction:column;gap:9px;">
<div class="flex justify-between"><span class="text-(--color-muted)">Domain</span><span class="font-mono">{{ $site->domain }}</span></div>
<div class="flex justify-between"><span class="text-(--color-muted)">Server</span><span class="font-mono">{{ $site->server->name }} · {{ $site->server->region }}</span></div>
<div class="flex justify-between"><span class="text-(--color-muted)">WordPress</span><span class="clu-pill @if($site->updates_pending > 0) warning @else success @endif">{{ $site->wp_version }}</span></div>
<div class="flex justify-between"><span class="text-(--color-muted)">PHP</span><span class="clu-pill muted">{{ $site->php_version }}</span></div>
<div class="flex justify-between"><span class="text-(--color-muted)">SSL</span><span class="clu-pill success">Let's Encrypt</span></div>
<div class="flex justify-between"><span class="text-(--color-muted)">DB-Größe</span><span class="font-mono">412 MB</span></div>
<div class="flex justify-between"><span class="text-(--color-muted)">Letztes Deploy</span><span class="font-mono">vor 4h</span></div>
</div>
</div>
<div class="clu-card">
<div class="clu-card-head"><h3>Schnellaktionen</h3></div>
<div class="clu-card-body">
<div class="clu-toggle-row" wire:click="toggleMaintenance" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">Wartungsmodus</div><div class="clu-tr-desc">site für besucher sperren</div></div>
<span class="clu-toggle @if($site->maintenance_mode) on @endif"></span>
</div>
<div class="clu-toggle-row" wire:click="toggleCache" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">Objekt-Cache (Redis)</div><div class="clu-tr-desc">datenbankabfragen zwischenspeichern</div></div>
<span class="clu-toggle @if($site->cache_enabled) on @endif"></span>
</div>
<div class="clu-toggle-row" wire:click="toggleCdn" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">Edge-CDN</div><div class="clu-tr-desc">statische inhalte global cachen</div></div>
<span class="clu-toggle @if($site->cdn_enabled) on @endif"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">HTTPS erzwingen</div><div class="clu-tr-desc">alle anfragen auf ssl umleiten</div></div>
<span class="clu-toggle @if($site->https_enabled) on @endif"></span>
</div>
</div>
</div>
</div>
</div>
@endif
{{-- ────── FILES ────── --}}
@if ($tab === 'files')
<div class="clu-pane">
<div class="clu-section-head">
<h3>Datei-Manager</h3>
<div class="flex gap-[8px]">
<button class="clu-ghost-btn" type="button"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 5v14M5 12h14"/></svg>Neue Datei</button>
<button class="clu-ghost-btn" type="button"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 3v14M5 10l7-7 7 7"/></svg>Upload</button>
</div>
</div>
<div class="clu-fm">
<div class="clu-card clu-tree">
<div class="clu-tree-head">
<span class="path">/var/www/bergmann</span>
<button type="button" class="clu-icon-btn" aria-label="Refresh"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 12a9 9 0 1 0 9-9"/><path d="M3 4v5h5"/></svg></button>
</div>
{!! clu_render_tree($this->fileTree, $activeFile, $openDirs) !!}
</div>
<div class="clu-card clu-editor" wire:key="editor-{{ $activeFile }}">
<div class="clu-editor-head">
<div class="clu-crumb">
{{ implode(' / ', array_slice(explode('/', $activeFile), 0, -1)) }} / <b>{{ basename($activeFile) }}</b>
</div>
<span class="clu-editor-tagline">{{ strtoupper(pathinfo($activeFile, PATHINFO_EXTENSION)) ?: 'TEXT' }}</span>
</div>
<div class="clu-code-wrap">
@php $lines = max(1, substr_count($this->currentFileContent, "\n") + 1); @endphp
<div class="clu-gutter">@for ($i = 1; $i <= $lines; $i++)<div>{{ $i }}</div>@endfor</div>
<textarea class="clu-code-area" spellcheck="false" wire:ignore>{{ $this->currentFileContent }}</textarea>
</div>
<div class="clu-editor-foot">
<span class="text-[12px] font-mono text-(--color-muted)">✓ geladen · {{ $lines }} Zeilen</span>
<div class="flex gap-[8px]">
<button class="clu-ghost-btn" type="button">Verwerfen</button>
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 16px;">Speichern</button>
</div>
</div>
</div>
</div>
</div>
@endif
{{-- ────── CRON ────── --}}
@if ($tab === 'cron')
<div class="clu-pane">
<div class="clu-section-head">
<h3>Cronjobs</h3>
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 14px;">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M12 5v14M5 12h14"/></svg>
Cronjob anlegen
</button>
</div>
<div class="clu-card">
<div class="clu-card-head"><h3>Geplante Aufgaben <span class="clu-pill muted">{{ $site->crons->count() }}</span></h3></div>
<div class="clu-card-body tight" style="overflow-x:auto;">
<table class="clu-table">
<thead><tr><th>Name</th><th>Zeitplan</th><th>Befehl</th><th>Letzter Lauf</th><th>Status</th><th></th></tr></thead>
<tbody>
@forelse ($site->crons as $c)
<tr>
<td class="font-semibold">{{ $c->name }}</td>
<td><span class="clu-pill accent">{{ $c->expression }}</span></td>
<td class="font-mono text-[11.5px] text-(--color-muted)" style="max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{{ $c->command }}</td>
<td class="font-mono">{{ $c->last_run_at?->diffForHumans() ?? '—' }}</td>
<td>
@if ($c->status === 'ok')<span class="clu-health">ok</span>
@elseif ($c->status === 'failing')<span class="clu-health bad">failing</span>
@else<span class="clu-health warn">paused</span>@endif
</td>
<td><div class="clu-row-actions">
<button type="button" title="Run"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="6 4 20 12 6 20 6 4"/></svg></button>
<button type="button" title="Mehr"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="5" cy="12" r="1.5"/><circle cx="12" cy="12" r="1.5"/><circle cx="19" cy="12" r="1.5"/></svg></button>
</div></td>
</tr>
@empty
<tr><td colspan="6" style="text-align:center;padding:30px;color:var(--color-muted);">Noch keine Cronjobs.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
@endif
{{-- ────── LOGS (xterm.js) ────── --}}
@if ($tab === 'logs')
<div class="clu-pane">
<div class="clu-section-head">
<h3>Logs · <span class="text-(--color-muted) text-[12px] font-mono">{{ $currentLog }}.log</span></h3>
<div class="flex items-center gap-[12px]">
<div class="clu-seg">
@foreach (['access', 'error', 'php', 'wp'] as $log)
<button type="button" wire:click="setLog('{{ $log }}')" class="@if($currentLog === $log) active @endif">{{ $log }}</button>
@endforeach
</div>
<label class="clu-switch-line">
<input type="checkbox" wire:model.live="logFollow" />
<span>Live folgen</span>
</label>
</div>
</div>
<div wire:ignore wire:key="xterm-{{ $currentLog }}">
<div class="clu-xterm-host" id="clu-xterm-host" data-log-type="{{ $currentLog }}"></div>
</div>
@push('scripts')
<script>
(function () {
const logData = @json($this->logData);
function initXterm() {
const host = document.getElementById('clu-xterm-host');
if (!host) return;
if (!window.XTerm) { setTimeout(initXterm, 30); return; }
if (host._term) host._term.dispose();
const term = new window.XTerm({
convertEol: true,
cursorBlink: false,
disableStdin: true,
fontFamily: 'JetBrains Mono, ui-monospace, monospace',
fontSize: 12.5,
lineHeight: 1.4,
theme: {
background: 'rgba(0,0,0,0)',
foreground: '#cfd3e6',
cursor: '#5aa9ff',
selectionBackground: 'rgba(99,140,255,0.25)',
},
});
const fit = new window.XTermFit();
term.loadAddon(fit);
term.open(host);
try { fit.fit(); } catch (e) {}
const COLOR = { INFO: '\x1b[38;2;90;169;255m', WARN: '\x1b[38;2;231;185;78m', ERROR: '\x1b[38;2;255;115;115m', OK: '\x1b[38;2;76;214;160m', DEBUG: '\x1b[38;2;169;139;255m', TIME: '\x1b[38;2;107;113;145m', RESET: '\x1b[0m' };
const lines = logData[host.dataset.logType] || [];
lines.forEach(([t, lvl, msg]) => {
term.writeln(`${COLOR.TIME}${t}${COLOR.RESET} ${COLOR[lvl] || ''}${lvl.padEnd(5)}${COLOR.RESET} ${msg}`);
});
host._term = term;
window.addEventListener('resize', () => { try { fit.fit(); } catch (e) {} });
}
initXterm();
document.addEventListener('livewire:navigated', initXterm);
})();
</script>
@endpush
</div>
@endif
{{-- ────── VHOST ────── --}}
@if ($tab === 'vhost')
<div class="clu-pane">
<div class="clu-card">
<div class="clu-card-head">
<h3 class="flex items-center gap-[8px]">
<svg class="clu-hico" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 12h20M2 6h20M2 18h20"/></svg>
Virtual Host
</h3>
<span class="meta">{{ $site->domain }} · nginx</span>
</div>
<div class="clu-card-body">
{{-- HTTP version --}}
<div class="clu-field">
<label>HTTP-Version</label>
<div class="flex gap-[8px]">
@foreach (['http1' => 'HTTP/1.1', 'http2' => 'HTTP/2', 'http3' => 'HTTP/3 (QUIC)'] as $v => $lbl)
<button type="button" wire:click="$set('httpVersion', '{{ $v }}')"
class="clu-ghost-btn"
style="@if($httpVersion === $v) background:var(--color-accent-soft);border-color:var(--color-accent);color:var(--color-accent); @endif">
{{ $lbl }}
</button>
@endforeach
</div>
<span class="clu-tr-desc">HTTP/3 nutzt QUIC über UDP — schneller bei verlustbehafteten Verbindungen.</span>
</div>
<div class="clu-set-grid">
<div class="clu-field">
<label>Server-Name</label>
<div class="clu-input"><input value="{{ $site->domain }}" style="font-family:var(--font-mono);" type="text" /></div>
</div>
<div class="clu-field">
<label>Document Root</label>
<div class="clu-input"><input value="/var/www/bergmann/htdocs" style="font-family:var(--font-mono);" type="text" /></div>
</div>
<div class="clu-field">
<label>client_max_body_size</label>
<div class="clu-input-group"><input value="128" type="text" /><span class="suffix">M</span></div>
</div>
<div class="clu-field">
<label>keepalive_timeout</label>
<div class="clu-input-group"><input value="65" type="text" /><span class="suffix">sek</span></div>
</div>
<div class="clu-field">
<label>worker_connections</label>
<div class="clu-input"><input value="2048" style="font-family:var(--font-mono);" type="text" /></div>
</div>
<div class="clu-field">
<label>access_log</label>
<div class="clu-input"><input value="/var/log/nginx/bergmann.access.log" style="font-family:var(--font-mono);" type="text" /></div>
</div>
</div>
<div style="margin-top:8px;">
<div class="clu-toggle-row" wire:click="$toggle('forceHttps')" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">HTTP → HTTPS Redirect</div><div class="clu-tr-desc">alle :80 anfragen mit 301 auf https umleiten</div></div>
<span class="clu-toggle @if($forceHttps) on @endif"></span>
</div>
<div class="clu-toggle-row" wire:click="$toggle('hsts')" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">HSTS (Strict-Transport-Security)</div><div class="clu-tr-desc">browser merkt sich https-only für {{ number_format($hstsMaxAge / 86400, 0, ',', '.') }} tage</div></div>
<span class="clu-toggle @if($hsts) on @endif"></span>
</div>
<div class="clu-toggle-row" wire:click="$toggle('brotli')" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">Brotli + gzip Kompression</div><div class="clu-tr-desc">text-assets vor auslieferung komprimieren</div></div>
<span class="clu-toggle @if($brotli) on @endif"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">server_tokens off</div><div class="clu-tr-desc">nginx-version aus header entfernen</div></div>
<span class="clu-toggle on"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">HTTP/2 Server Push</div><div class="clu-tr-desc">kritische assets im voraus an client streamen</div></div>
<span class="clu-toggle"></span>
</div>
</div>
</div>
<div class="clu-form-actions">
<button class="clu-ghost-btn" type="button">nginx -t (Syntax-Check)</button>
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 14px;">vHost speichern + reload</button>
</div>
</div>
<div class="grid gap-[14px]" style="grid-template-columns:1fr 1fr;">
<div class="clu-card">
<div class="clu-card-head"><h3>Custom Headers</h3></div>
<div class="clu-card-body" style="display:flex;flex-direction:column;gap:9px;">
<div class="clu-kv"><span class="k">X-Frame-Options</span><span class="v">SAMEORIGIN</span></div>
<div class="clu-kv"><span class="k">X-Content-Type-Options</span><span class="v">nosniff</span></div>
<div class="clu-kv"><span class="k">Referrer-Policy</span><span class="v">strict-origin</span></div>
<div class="clu-kv" style="border-bottom:0;"><span class="k">Permissions-Policy</span><span class="v">camera=(), mic=()</span></div>
</div>
</div>
<div class="clu-card">
<div class="clu-card-head"><h3>Rate Limit</h3><span class="clu-pill success">aktiv</span></div>
<div class="clu-card-body" style="display:flex;flex-direction:column;gap:9px;">
<div class="clu-kv"><span class="k">Zone-Größe</span><span class="v">10 MB</span></div>
<div class="clu-kv"><span class="k">/wp-login.php</span><span class="v">5 req / min</span></div>
<div class="clu-kv"><span class="k">/xmlrpc.php</span><span class="v">geblockt</span></div>
<div class="clu-kv" style="border-bottom:0;"><span class="k">Burst</span><span class="v">20</span></div>
</div>
</div>
</div>
</div>
@endif
{{-- ────── SSL / TLS ────── --}}
@if ($tab === 'ssl')
<div class="clu-pane">
<div class="clu-card">
<div class="clu-card-head">
<h3 class="flex items-center gap-[8px]">
<svg class="clu-hico" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg>
SSL / TLS Zertifikat
</h3>
<span class="clu-pill success">gültig · 54 tage</span>
</div>
<div class="clu-card-body">
<div class="clu-field">
<label>Cert-Provider</label>
<div class="flex gap-[8px] flex-wrap">
@foreach (['letsencrypt' => "Let's Encrypt", 'cloudflare' => 'Cloudflare Origin', 'custom' => 'Custom Upload'] as $v => $lbl)
<button type="button" wire:click="$set('sslProvider', '{{ $v }}')"
class="clu-ghost-btn"
style="@if($sslProvider === $v) background:var(--color-accent-soft);border-color:var(--color-accent);color:var(--color-accent); @endif">
{{ $lbl }}
</button>
@endforeach
</div>
</div>
<div class="clu-set-grid">
<div class="clu-field">
<label>Common Name (CN)</label>
<div class="clu-input"><input value="{{ $site->domain }}" style="font-family:var(--font-mono);" type="text" /></div>
</div>
<div class="clu-field">
<label>Subject Alternative Names (SAN)</label>
<div class="clu-input"><input value="www.{{ $site->domain }}, *.{{ $site->domain }}" style="font-family:var(--font-mono);" type="text" /></div>
</div>
<div class="clu-field">
<label>TLS-Version (min)</label>
<div class="flex gap-[8px]">
@foreach (['1.2' => 'TLS 1.2', '1.3' => 'TLS 1.3'] as $v => $lbl)
<button type="button" wire:click="$set('tlsMin', '{{ $v }}')"
class="clu-ghost-btn"
style="@if($tlsMin === $v) background:var(--color-accent-soft);border-color:var(--color-accent);color:var(--color-accent); @endif">
{{ $lbl }}
</button>
@endforeach
</div>
</div>
<div class="clu-field">
<label>Cipher Suite Profile</label>
<select class="clu-input" style="appearance:auto;font-family:var(--font-mono);">
<option>Mozilla Modern</option>
<option selected>Mozilla Intermediate</option>
<option>Mozilla Old (PCI)</option>
<option>Custom</option>
</select>
</div>
</div>
<div style="margin-top:8px;">
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">OCSP Stapling</div><div class="clu-tr-desc">cert-revocation-status mit response cachen</div></div>
<span class="clu-toggle on"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">Auto-Renewal</div><div class="clu-tr-desc">erneuerung 30 tage vor ablauf</div></div>
<span class="clu-toggle on"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">CAA-Record-Check</div><div class="clu-tr-desc">vor neuausstellung dns-caa prüfen</div></div>
<span class="clu-toggle on"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">Certificate Transparency Log</div><div class="clu-tr-desc">cert in öffentliches ct-log eintragen</div></div>
<span class="clu-toggle on"></span>
</div>
</div>
</div>
<div class="clu-form-actions">
<button class="clu-ghost-btn" type="button">Cert herunterladen</button>
<button class="clu-ghost-btn" type="button">Jetzt erneuern</button>
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 14px;">Speichern + reload</button>
</div>
</div>
<div class="grid gap-[14px]" style="grid-template-columns:1fr 1fr;">
<div class="clu-card">
<div class="clu-card-head"><h3>Cert Details</h3></div>
<div class="clu-card-body" style="display:flex;flex-direction:column;gap:9px;">
<div class="clu-kv"><span class="k">Aussteller</span><span class="v">Let's Encrypt R3</span></div>
<div class="clu-kv"><span class="k">Signatur</span><span class="v">ECDSA P-256</span></div>
<div class="clu-kv"><span class="k">Schlüsselgröße</span><span class="v">256 bit</span></div>
<div class="clu-kv"><span class="k">Ausgestellt am</span><span class="v">2026-03-22</span></div>
<div class="clu-kv"><span class="k">Läuft ab am</span><span class="v" style="color:var(--color-success);">2026-06-20</span></div>
<div class="clu-kv" style="border-bottom:0;"><span class="k">SSL-Labs Rating</span><span class="v" style="color:var(--color-success);">A+</span></div>
</div>
</div>
<div class="clu-card">
<div class="clu-card-head"><h3>Bisherige Zertifikate</h3></div>
<div class="clu-card-body tight">
<table class="clu-table">
<thead><tr><th>Ausgestellt</th><th>Abgelaufen</th><th>Status</th></tr></thead>
<tbody>
<tr><td class="font-mono">2026-03-22</td><td class="font-mono">2026-06-20</td><td><span class="clu-health">aktuell</span></td></tr>
<tr><td class="font-mono">2025-12-21</td><td class="font-mono">2026-03-21</td><td><span class="clu-health warn">ersetzt</span></td></tr>
<tr><td class="font-mono">2025-09-22</td><td class="font-mono">2025-12-21</td><td><span class="clu-health warn">ersetzt</span></td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
@endif
{{-- ────── SSH / FTP ────── --}}
@if ($tab === 'access')
<div class="clu-pane">
{{-- SSH-Users --}}
<div class="clu-card">
<div class="clu-card-head">
<h3 class="flex items-center gap-[8px]">
<svg class="clu-hico" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 17l5-5-5-5M13 19h7"/></svg>
SSH-Benutzer
</h3>
<span class="meta">key-only · password-auth aus</span>
</div>
<div class="clu-card-body tight" style="overflow-x:auto;">
<table class="clu-table">
<thead><tr><th>Username</th><th>Public Key</th><th>Shell</th><th>Letzter Login</th><th>Scope</th><th></th></tr></thead>
<tbody>
<tr><td class="font-semibold">deploy</td><td class="font-mono text-[11px] text-(--color-muted)" style="max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">ssh-ed25519 AAAAC3NzaC1l…7Q deploy@bergmann</td><td class="font-mono">/bin/bash</td><td class="font-mono">vor 14 min</td><td><span class="clu-pill accent">/var/www/bergmann</span></td><td><div class="clu-row-actions"><button type="button" title="Key tauschen"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 12a9 9 0 1 1-3-6.7M21 4v5h-5"/></svg></button><button type="button" title="Löschen"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"/></svg></button></div></td></tr>
<tr><td class="font-semibold">m.weber</td><td class="font-mono text-[11px] text-(--color-muted)" style="max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">ssh-ed25519 AAAAC3NzaC1l…1F m.weber@laptop</td><td class="font-mono">/bin/bash</td><td class="font-mono">heute, 09:42</td><td><span class="clu-pill accent">/var/www/bergmann</span></td><td><div class="clu-row-actions"><button type="button" title="Key tauschen"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 12a9 9 0 1 1-3-6.7M21 4v5h-5"/></svg></button><button type="button" title="Löschen"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"/></svg></button></div></td></tr>
<tr><td class="font-semibold">ci-bot</td><td class="font-mono text-[11px] text-(--color-muted)" style="max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">ssh-rsa AAAAB3NzaC1y…XY github-actions</td><td class="font-mono">/usr/bin/rrsync</td><td class="font-mono">vor 2h</td><td><span class="clu-pill muted">deploy only</span></td><td><div class="clu-row-actions"><button type="button" title="Key tauschen"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 12a9 9 0 1 1-3-6.7M21 4v5h-5"/></svg></button><button type="button" title="Löschen"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"/></svg></button></div></td></tr>
</tbody>
</table>
</div>
<div class="clu-form-actions">
<button class="clu-ghost-btn" type="button">Public Key importieren</button>
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 14px;">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M12 5v14M5 12h14"/></svg>
SSH-Benutzer anlegen
</button>
</div>
</div>
{{-- SFTP / FTP-Users --}}
<div class="clu-card">
<div class="clu-card-head">
<h3>SFTP / FTP-Benutzer</h3>
<span class="meta">chroot · explicit-tls erzwungen</span>
</div>
<div class="clu-card-body tight" style="overflow-x:auto;">
<table class="clu-table">
<thead><tr><th>Username</th><th>Chroot</th><th>Protokoll</th><th>Quota</th><th>Letzter Upload</th><th></th></tr></thead>
<tbody>
<tr><td class="font-semibold">redakteur</td><td class="font-mono">/uploads/2026</td><td><span class="clu-pill success">SFTP</span></td><td class="font-mono">2.4 / 5 GB</td><td class="font-mono">heute, 11:02</td><td><div class="clu-row-actions"><button type="button" title="Passwort"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg></button><button type="button" title="Löschen"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"/></svg></button></div></td></tr>
<tr><td class="font-semibold">backup-puller</td><td class="font-mono">/backups</td><td><span class="clu-pill success">SFTP</span></td><td class="font-mono">128 GB</td><td class="font-mono">heute, 03:00</td><td><div class="clu-row-actions"><button type="button" title="Passwort"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg></button><button type="button" title="Löschen"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"/></svg></button></div></td></tr>
</tbody>
</table>
</div>
<div class="clu-form-actions">
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 14px;">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M12 5v14M5 12h14"/></svg>
SFTP-Benutzer anlegen
</button>
</div>
</div>
{{-- Security policy --}}
<div class="clu-card">
<div class="clu-card-head"><h3>Zugriffs-Policy</h3></div>
<div class="clu-card-body">
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">Password-Auth deaktiviert</div><div class="clu-tr-desc">SSH nur über Public-Key zulassen</div></div>
<span class="clu-toggle on"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">Root-Login verbieten</div><div class="clu-tr-desc">PermitRootLogin no</div></div>
<span class="clu-toggle on"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">fail2ban (3 Versuche → 1h Ban)</div><div class="clu-tr-desc">automatische IP-Sperre nach fehlversuchen</div></div>
<span class="clu-toggle on"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">IP-Allowlist</div><div class="clu-tr-desc">SSH nur aus 10.10.0.0/16 + büro-WAN</div></div>
<span class="clu-toggle"></span>
</div>
<div class="clu-toggle-row" style="cursor:pointer;">
<div class="clu-tr-body"><div class="clu-tr-title">2FA für SSH (Google Authenticator)</div><div class="clu-tr-desc">zusätzlich zum public key</div></div>
<span class="clu-toggle"></span>
</div>
</div>
<div class="clu-form-actions">
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 14px;">Policy speichern</button>
</div>
</div>
</div>
@endif
{{-- ────── WP + PHP (kompakte Hardcoded-Konfig nach Template) ────── --}}
@if ($tab === 'wp')
<div class="clu-pane">
{{-- wp-config.php card --}}
<div class="clu-card">
<div class="clu-card-head">
<h3 class="flex items-center gap-[8px]">
<svg class="clu-hico" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 7h16M4 12h16M4 17h10"/></svg>
wp-config.php
</h3>
<span class="meta">/htdocs/wp-config.php</span>
</div>
<div class="clu-card-body">
<div class="clu-set-grid">
<div class="clu-field"><label>Tabellen-Präfix</label><div class="clu-input"><input value="wp_bg_" style="font-family:var(--font-mono);" type="text" /></div></div>
<div class="clu-field"><label>WP_MEMORY_LIMIT</label><div class="clu-input-group"><input value="256" type="text" /><span class="suffix">MB</span></div></div>
<div class="clu-field"><label>WP_MAX_MEMORY_LIMIT</label><div class="clu-input-group"><input value="512" type="text" /><span class="suffix">MB</span></div></div>
<div class="clu-field"><label>AUTOSAVE_INTERVAL</label><div class="clu-input-group"><input value="60" type="text" /><span class="suffix">sek</span></div></div>
<div class="clu-field"><label>WP_POST_REVISIONS</label><div class="clu-input"><input value="10" style="font-family:var(--font-mono);" type="text" /></div></div>
<div class="clu-field"><label>Sprache (WPLANG)</label><div class="clu-input"><input value="de_DE" style="font-family:var(--font-mono);" type="text" /></div></div>
</div>
<div style="margin-top:8px;">
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">WP_DEBUG</div><div class="clu-tr-desc">debug-modus &amp; fehlerprotokoll</div></div><span class="clu-toggle"></span></div>
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">WP_CACHE</div><div class="clu-tr-desc">persistentes caching aktiv</div></div><span class="clu-toggle on"></span></div>
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">DISALLOW_FILE_EDIT</div><div class="clu-tr-desc">datei-editor im wp-admin sperren</div></div><span class="clu-toggle on"></span></div>
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">AUTOMATIC_UPDATER_DISABLED</div><div class="clu-tr-desc">automatische core-updates deaktiviert</div></div><span class="clu-toggle"></span></div>
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">FORCE_SSL_ADMIN</div><div class="clu-tr-desc">wp-admin nur über https</div></div><span class="clu-toggle on"></span></div>
</div>
</div>
<div class="clu-form-actions">
<button class="clu-ghost-btn" type="button">In Editor öffnen</button>
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 14px;">wp-config speichern</button>
</div>
</div>
{{-- Datenbank + Salts side-by-side --}}
<div class="grid gap-[14px]" style="grid-template-columns:1fr 1fr;">
<div class="clu-card">
<div class="clu-card-head"><h3>Datenbank</h3><span class="clu-pill success">verbunden</span></div>
<div class="clu-card-body">
<div class="clu-field"><label>DB_NAME</label><div class="clu-input"><input value="bergmann_prod" style="font-family:var(--font-mono);" type="text" /></div></div>
<div class="clu-field"><label>DB_USER</label><div class="clu-input"><input value="bergmann_wp" style="font-family:var(--font-mono);" type="text" /></div></div>
<div class="clu-field"><label>DB_HOST</label><div class="clu-input"><input value="127.0.0.1:3306" style="font-family:var(--font-mono);" type="text" /></div></div>
<div class="clu-field"><label>DB_PASSWORD</label><div class="clu-input-group"><input value="************" type="password" /><span class="suffix" style="cursor:pointer;">anzeigen</span></div></div>
</div>
</div>
<div class="clu-card">
<div class="clu-card-head"><h3>Sicherheits-Schlüssel (Salts)</h3></div>
<div class="clu-card-body">
<p class="clu-tr-desc" style="margin:0 0 14px;">AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY &amp; zugehörige Salts. Neu generieren meldet alle Benutzer ab.</p>
<div class="clu-kv"><span class="k">Zuletzt rotiert</span><span class="v">14.03.2026</span></div>
<div class="clu-kv"><span class="k">Schlüssel-Länge</span><span class="v">64 zeichen</span></div>
<div class="clu-kv" style="border-bottom:0;"><span class="k">Status</span><span class="v" style="color:var(--color-success);">stark</span></div>
</div>
<div class="clu-form-actions">
<button class="clu-ghost-btn" type="button" style="color:var(--color-warning);border-color:rgba(194,130,15,0.35);">Salts neu generieren</button>
</div>
</div>
</div>
{{-- Allgemeine WP-Einstellungen --}}
<div class="clu-card">
<div class="clu-card-head"><h3>Allgemeine WordPress-Einstellungen</h3></div>
<div class="clu-card-body">
<div class="clu-set-grid">
<div class="clu-field"><label>Seitentitel</label><div class="clu-input"><input value="Bergmann Coffee Shop" type="text" /></div></div>
<div class="clu-field"><label>Untertitel</label><div class="clu-input"><input value="Rösterei &amp; Onlineshop" type="text" /></div></div>
<div class="clu-field"><label>WordPress-Adresse (URL)</label><div class="clu-input"><input value="https://{{ $site->domain }}" style="font-family:var(--font-mono);" type="text" /></div></div>
<div class="clu-field"><label>Permalink-Struktur</label><div class="clu-input"><input value="/%postname%/" style="font-family:var(--font-mono);" type="text" /></div></div>
</div>
<div style="margin-top:8px;">
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">Suchmaschinen-Sichtbarkeit</div><div class="clu-tr-desc">von google &amp; co. indexieren lassen</div></div><span class="clu-toggle on"></span></div>
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">Registrierung erlauben</div><div class="clu-tr-desc">neue benutzer können sich registrieren</div></div><span class="clu-toggle"></span></div>
</div>
</div>
<div class="clu-form-actions">
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 14px;">Einstellungen speichern</button>
</div>
</div>
</div>
@endif
@if ($tab === 'php')
<div class="clu-pane">
{{-- php.ini main card --}}
<div class="clu-card">
<div class="clu-card-head">
<h3 class="flex items-center gap-[8px]">
<svg class="clu-hico" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 7h16M4 12h16M4 17h10"/></svg>
php.ini
</h3>
<span class="meta">php {{ $site->php_version }} · fpm pool: bergmann</span>
</div>
<div class="clu-card-body">
<div class="clu-set-grid">
<div class="clu-field"><label>memory_limit</label><div class="clu-input-group"><input value="256" type="text" /><span class="suffix">M</span></div></div>
<div class="clu-field"><label>max_execution_time</label><div class="clu-input-group"><input value="120" type="text" /><span class="suffix">sek</span></div></div>
<div class="clu-field"><label>upload_max_filesize</label><div class="clu-input-group"><input value="128" type="text" /><span class="suffix">M</span></div></div>
<div class="clu-field"><label>post_max_size</label><div class="clu-input-group"><input value="128" type="text" /><span class="suffix">M</span></div></div>
<div class="clu-field"><label>max_input_vars</label><div class="clu-input"><input value="3000" style="font-family:var(--font-mono);" type="text" /></div></div>
<div class="clu-field"><label>max_input_time</label><div class="clu-input-group"><input value="120" type="text" /><span class="suffix">sek</span></div></div>
<div class="clu-field"><label>default_charset</label><div class="clu-input"><input value="UTF-8" style="font-family:var(--font-mono);" type="text" /></div></div>
<div class="clu-field"><label>date.timezone</label><div class="clu-input"><input value="Europe/Berlin" style="font-family:var(--font-mono);" type="text" /></div></div>
</div>
<div style="margin-top:8px;">
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">display_errors</div><div class="clu-tr-desc">php-fehler im browser anzeigen (nur dev)</div></div><span class="clu-toggle"></span></div>
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">opcache.enable</div><div class="clu-tr-desc">bytecode-cache aktiv</div></div><span class="clu-toggle on"></span></div>
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">log_errors</div><div class="clu-tr-desc">fehler in error.log schreiben</div></div><span class="clu-toggle on"></span></div>
<div class="clu-toggle-row"><div class="clu-tr-body"><div class="clu-tr-title">allow_url_fopen</div><div class="clu-tr-desc">externe urls als datei öffnen</div></div><span class="clu-toggle on"></span></div>
</div>
</div>
<div class="clu-form-actions">
<button class="clu-ghost-btn" type="button">PHP-FPM neu starten</button>
<button class="clu-btn-primary" type="button" style="height:36px;padding:0 14px;">php.ini speichern</button>
</div>
</div>
{{-- OPcache + Extensions --}}
<div class="grid gap-[14px]" style="grid-template-columns:1fr 1fr;">
<div class="clu-card">
<div class="clu-card-head"><h3>OPcache</h3><span class="clu-pill success">aktiv</span></div>
<div class="clu-card-body">
<div class="clu-kv"><span class="k">Trefferquote</span><span class="v" style="color:var(--color-success);">99,2%</span></div>
<div class="clu-kv"><span class="k">Speicher</span><span class="v">142 / 256 MB</span></div>
<div class="clu-kv"><span class="k">Zwischengesp. Skripte</span><span class="v">4.218</span></div>
<div class="clu-kv" style="border-bottom:0;"><span class="k">opcache.revalidate_freq</span><span class="v">60 s</span></div>
</div>
<div class="clu-form-actions">
<button class="clu-ghost-btn" type="button">OPcache leeren</button>
</div>
</div>
<div class="clu-card">
<div class="clu-card-head"><h3>Aktive Erweiterungen</h3><span class="meta">28 module</span></div>
<div class="clu-card-body">
<div class="flex flex-wrap gap-[8px]">
@foreach (['curl', 'gd', 'imagick', 'intl', 'mbstring', 'mysqli', 'opcache', 'redis', 'soap', 'zip', 'bcmath', 'exif'] as $ext)
<span class="clu-pill muted">{{ $ext }}</span>
@endforeach
<span class="clu-pill accent">+ 16</span>
</div>
</div>
</div>
</div>
</div>
@endif
</div>