@php
// Threshold tone for gauges/bars: >=90 offline, >=75 warning, else online.
$tone = fn (int $v): string => $v >= 90 ? 'offline' : ($v >= 75 ? 'warning' : 'online');
$barColor = ['online' => 'bg-online', 'warning' => 'bg-warning', 'offline' => 'bg-offline'];
$statusLabel = ['online' => 'Online', 'warning' => 'Warnung', 'offline' => 'Offline'][$server->status] ?? ucfirst($server->status);
$specs = $server->specs ?? [];
$cores = $specs['cores'] ?? null;
$ramGb = $specs['ram_gb'] ?? null;
$diskGb = $specs['disk_gb'] ?? null;
$ramUsed = $ramGb !== null ? round((float) $ramGb * $server->mem / 100, 1) : null;
$diskUsed = $diskGb !== null ? (int) round((float) $diskGb * $server->disk / 100) : null;
$specRows = [
['Architektur', $specs['arch'] ?? '—'],
['Kernel', $specs['kernel'] ?? '—'],
['Virtualisierung', $specs['virt'] ?? '—'],
['Kerne', $cores ?? '—'],
['RAM', $ramGb !== null ? $ramGb.' GB' : '—'],
['Disk', $diskGb !== null ? $diskGb.' GB' : '—'],
];
$vitals = [
['label' => 'CPU', 'icon' => 'cpu', 'val' => (int) $server->cpu, 'sub' => ($loadAvg > 0 ? 'Last '.number_format($loadAvg, 2).' · ' : '').($cores ? $cores.' Kerne' : '—')],
['label' => 'RAM', 'icon' => 'activity', 'val' => (int) $server->mem, 'sub' => $ramUsed !== null ? $ramUsed.' / '.$ramGb.' GB' : '—'],
['label' => 'Disk', 'icon' => 'server', 'val' => (int) $server->disk, 'sub' => $diskUsed !== null ? $diskUsed.' / '.$diskGb.' GB' : '—'],
];
@endphp
Zurück zur Flotte
{{-- Hero header --}}
$server->status === 'online',
'border-warning/30 bg-warning/10 text-warning' => $server->status === 'warning',
'border-offline/30 bg-offline/10 text-offline' => $server->status === 'offline',
])>
{{ $server->name }}
{{ $statusLabel }}
{{ $server->hostname }}
·
{{ $server->ip }}
·
{{ $server->os }}
·
Uptime {{ $server->uptime ?: '—' }}
·
zuletzt {{ optional($server->last_seen_at)->diffForHumans() ?? '—' }}
Dateien
@if ($ready && ! $connected)
Keine Live-Verbindung — gezeigt werden die zuletzt gespeicherten Werte. Zugang/Erreichbarkeit prüfen.
@endif
{{-- SSH-Zugang (Credential) --}}
@php
$cred = $server->credential;
$credStatus = $cred ? ($cred->disabled ? 'offline' : 'online') : null;
$credStatusLabel = $cred ? ($cred->disabled ? 'Gesperrt' : 'Aktiv') : null;
$credAuthLabel = $cred ? ($cred->auth_type === 'key' ? 'SSH-Key' : 'Passwort') : null;
@endphp
@if ($cred)
! $cred->disabled,
'border-offline/30 bg-offline/10 text-offline' => $cred->disabled,
])>
{{ $cred->name ?: '—' }}
{{ $credStatusLabel }}
{{ $credAuthLabel }}
{{ $cred->username }}@{{ $server->ip }}
Bearbeiten
{{ $cred->disabled ? 'Entsperren' : 'Sperren' }}
Löschen
@else
Kein Zugang hinterlegt
Ohne SSH-Zugang ist keine Live-Steuerung möglich.
Zugang hinterlegen
@endif
{{-- Vitals: live gauges, full width, dense --}}
@foreach ($vitals as $v)
{{ $v['label'] }}
{{ $v['sub'] }}
@endforeach
@if ($ready)
{{-- Spezifikationen + Sicherheit --}}
@foreach ($specRows as [$key, $val])
- {{ $key }}
- {{ $val }}
@endforeach
@php
// Map each checklist label to its hardening-action key.
$hardenKey = function (string $label): ?string {
return match (true) {
str_contains($label, 'Root-Login') => 'ssh_root',
str_contains($label, 'Passwort-Login') => 'ssh_password',
str_contains($label, 'fail2ban') => 'fail2ban',
str_contains($label, 'Firewall') => 'firewall',
str_contains($label, 'Updates') => 'unattended',
default => null,
};
};
@endphp
@foreach ($hardening as $check)
@php $action = $hardenKey($check['label']); @endphp
$check['status'] === 'online',
'border-warning' => $check['status'] === 'warning',
'border-offline' => $check['status'] === 'offline',
])>
{{ $check['label'] }}
{{ $check['detail'] }}
@if ($check['status'] !== 'online' && $action)
Anwenden
@else
{{ $check['status'] === 'online' ? 'OK' : 'Fehlt' }}
@endif
@endforeach
{{-- Volumes + Netzwerk-Interfaces --}}
@forelse ($volumes as $vol)
@php $vt = $tone((int) $vol['used']); @endphp
{{ $vol['mount'] }}
{{ $vol['fs'] }} · {{ $vol['size'] }}
@empty
Keine Volumes gelesen.
@endforelse
| Name |
IP |
MAC |
RX |
TX |
@foreach ($interfaces as $if)
| {{ $if['name'] }} |
{{ $if['ip'] }} |
{{ $if['mac'] }} |
{{ $if['rx'] }} |
{{ $if['tx'] }} |
@endforeach
{{-- SSH-Schlüssel --}}
Schlüssel hinzufügen
@forelse ($sshKeys as $key)
{{ $key['comment'] }}
{{ $key['type'] }}
{{ $key['fingerprint'] }}
@empty
Keine autorisierten Schlüssel.
@endforelse
@else
{{-- skeletons for the SSH-loaded sections --}}
@foreach (['Spezifikationen', 'Sicherheit'] as $t)
@endforeach
@foreach (['Volumes', 'Netzwerk-Interfaces'] as $t)
@endforeach
@endif