feat(ux): detail-page redesign, settings page, key generation, scrollable services
Round of UX work from user feedback (browser-verified per R12 — all routes 200, zero console errors). - Server-Details redesign (/frontend-design): hero header band (status-tinted server glyph + name + meta strip + actions), a full-width row of dense vital cards (ring + label + absolute used/total) instead of 3 donuts floating in a height-stretched panel, hardening checklist with status-colored accent borders, and a clear section hierarchy (vitals → specs+security → volumes+net → keys). - New user Settings page (/einstellungen): profile (name/email), password change (current-password gated), 2FA status + enable link / disable (confirm + audit). Sidebar "Konto" nav group + clickable user block. - SSH key generation: "Neues Paar generieren" in the add-key modal makes an ed25519 keypair (phpseclib) — public key installed on save, private shown once. - Services list is height-capped + scrollable so the Journal below is reachable. - <x-btn> now also renders <a> (href) for link-buttons. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>feat/v1-foundation
parent
5134fe740b
commit
0a7fc4780c
|
|
@ -7,6 +7,7 @@ use App\Models\Server;
|
|||
use App\Services\FleetService;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use LivewireUI\Modal\ModalComponent;
|
||||
use phpseclib3\Crypt\EC;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
|
|
@ -19,6 +20,8 @@ class AddSshKey extends ModalComponent
|
|||
|
||||
public string $publicKey = '';
|
||||
|
||||
public ?string $generatedPrivate = null;
|
||||
|
||||
public ?string $error = null;
|
||||
|
||||
public function mount(int $serverId): void
|
||||
|
|
@ -31,6 +34,16 @@ class AddSshKey extends ModalComponent
|
|||
return 'lg';
|
||||
}
|
||||
|
||||
/** Generate a fresh ed25519 keypair: the public key is installed on save,
|
||||
* the private key is shown once for the operator to store. */
|
||||
public function generate(): void
|
||||
{
|
||||
$this->error = null;
|
||||
$key = EC::createKey('ed25519');
|
||||
$this->publicKey = $key->getPublicKey()->toString('OpenSSH', ['comment' => 'clusev-key']);
|
||||
$this->generatedPrivate = (string) $key->toString('OpenSSH');
|
||||
}
|
||||
|
||||
public function save(FleetService $fleet): void
|
||||
{
|
||||
$this->error = null;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ class Show extends Component
|
|||
|
||||
public bool $ready = false;
|
||||
|
||||
public float $loadAvg = 0;
|
||||
|
||||
public array $volumes = [];
|
||||
|
||||
public array $interfaces = [];
|
||||
|
|
@ -71,6 +73,7 @@ class Show extends Component
|
|||
$this->interfaces = $snap['interfaces'];
|
||||
$this->hardening = $snap['hardening'];
|
||||
$this->sshKeys = $snap['sshKeys'];
|
||||
$this->loadAvg = (float) ($snap['metrics']['load'] ?? 0);
|
||||
$this->connected = true;
|
||||
} catch (Throwable) {
|
||||
$this->connected = false;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Settings;
|
||||
|
||||
use App\Models\AuditEvent;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Validation\Rules\Password;
|
||||
use Livewire\Attributes\Layout;
|
||||
use Livewire\Attributes\On;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[Layout('layouts.app')]
|
||||
#[Title('Einstellungen — Clusev')]
|
||||
class Index extends Component
|
||||
{
|
||||
public string $name = '';
|
||||
|
||||
public string $email = '';
|
||||
|
||||
public string $current_password = '';
|
||||
|
||||
public string $password = '';
|
||||
|
||||
public string $password_confirmation = '';
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->name = Auth::user()->name;
|
||||
$this->email = Auth::user()->email;
|
||||
}
|
||||
|
||||
public function updateProfile(): void
|
||||
{
|
||||
$data = $this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'email', 'max:255', Rule::unique('users', 'email')->ignore(Auth::id())],
|
||||
]);
|
||||
|
||||
Auth::user()->update($data);
|
||||
$this->audit('profile.update', $data['email']);
|
||||
$this->dispatch('notify', message: 'Profil gespeichert.');
|
||||
}
|
||||
|
||||
public function updatePassword(): void
|
||||
{
|
||||
$this->validate([
|
||||
'current_password' => ['required', 'current_password'],
|
||||
'password' => ['required', 'confirmed', Password::min(10)],
|
||||
]);
|
||||
|
||||
Auth::user()->update(['password' => $this->password, 'must_change_password' => false]);
|
||||
$this->reset('current_password', 'password', 'password_confirmation');
|
||||
$this->audit('password.change', Auth::user()->email);
|
||||
$this->dispatch('notify', message: 'Passwort geändert.');
|
||||
}
|
||||
|
||||
public function confirmDisableTwoFactor(): void
|
||||
{
|
||||
$this->dispatch('openModal',
|
||||
component: 'modals.confirm-action',
|
||||
arguments: [
|
||||
'heading' => '2FA deaktivieren',
|
||||
'body' => 'Die Zwei-Faktor-Authentifizierung wird entfernt. Dein Konto ist dann nur noch per Passwort geschützt.',
|
||||
'confirmLabel' => 'Deaktivieren',
|
||||
'danger' => true,
|
||||
'icon' => 'shield',
|
||||
'auditAction' => 'two_factor.disable',
|
||||
'auditTarget' => Auth::user()->email,
|
||||
'event' => 'twoFactorDisabled',
|
||||
'notify' => '2FA deaktiviert.',
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
#[On('twoFactorDisabled')]
|
||||
public function disableTwoFactor(): void
|
||||
{
|
||||
Auth::user()->forceFill([
|
||||
'two_factor_secret' => null,
|
||||
'two_factor_confirmed_at' => null,
|
||||
])->save();
|
||||
}
|
||||
|
||||
private function audit(string $action, string $target): void
|
||||
{
|
||||
AuditEvent::create([
|
||||
'user_id' => Auth::id(),
|
||||
'actor' => Auth::user()->name,
|
||||
'action' => $action,
|
||||
'target' => $target,
|
||||
'ip' => request()->ip(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.settings.index', [
|
||||
'twoFactorEnabled' => Auth::user()->hasTwoFactorEnabled(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
@props(['variant' => 'secondary', 'icon' => false])
|
||||
@props(['variant' => 'secondary', 'icon' => false, 'href' => null])
|
||||
@php
|
||||
// One button style for the whole app — compact, consistent (R10).
|
||||
$variants = [
|
||||
|
|
@ -14,4 +14,8 @@
|
|||
.'disabled:opacity-50 disabled:pointer-events-none '
|
||||
.$shape.' '.($variants[$variant] ?? $variants['secondary']);
|
||||
@endphp
|
||||
<button {{ $attributes->merge(['type' => 'button', 'class' => $classes]) }}>{{ $slot }}</button>
|
||||
@if ($href)
|
||||
<a href="{{ $href }}" {{ $attributes->merge(['class' => $classes]) }}>{{ $slot }}</a>
|
||||
@else
|
||||
<button {{ $attributes->merge(['type' => 'button', 'class' => $classes]) }}>{{ $slot }}</button>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
'power' => '<path d="M12 2v10"/><path d="M18.36 6.64a9 9 0 1 1-12.73 0"/>',
|
||||
'rotate' => '<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/>',
|
||||
'trash' => '<path d="M3 6h18"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><path d="M10 11v6"/><path d="M14 11v6"/>',
|
||||
'settings' => '<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>',
|
||||
];
|
||||
@endphp
|
||||
<svg {{ $attributes->merge(['class' => $class]) }} viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
|
|
|
|||
|
|
@ -29,17 +29,22 @@
|
|||
<x-nav-item icon="cpu" href="/services" :active="request()->is('services*')">Dienste</x-nav-item>
|
||||
<x-nav-item icon="folder" href="/files" :active="request()->is('files*')">Dateien</x-nav-item>
|
||||
<x-nav-item icon="audit" href="/audit" :active="request()->is('audit*')">Audit-Log</x-nav-item>
|
||||
|
||||
<p class="px-3 pb-1 pt-3 font-mono text-[10px] uppercase tracking-widest text-ink-4">Konto</p>
|
||||
<x-nav-item icon="settings" href="/einstellungen" :active="request()->is('einstellungen*')">Einstellungen</x-nav-item>
|
||||
</nav>
|
||||
|
||||
{{-- User --}}
|
||||
@php($u = auth()->user())
|
||||
<div class="shrink-0 border-t border-line p-3">
|
||||
<div class="flex items-center gap-2.5 rounded-md px-2 py-1.5">
|
||||
<span class="grid h-8 w-8 shrink-0 place-items-center rounded-full bg-raised font-mono text-xs text-ink-2">{{ strtoupper(substr($u?->name ?? 'U', 0, 2)) }}</span>
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block truncate text-sm text-ink">{{ $u?->name ?? '—' }}</span>
|
||||
<span class="block truncate font-mono text-[11px] {{ $u?->hasTwoFactorEnabled() ? 'text-online' : 'text-ink-3' }}">{{ $u?->hasTwoFactorEnabled() ? '2FA aktiv' : '2FA aus' }}</span>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<a href="{{ route('settings') }}" wire:navigate class="flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-raised">
|
||||
<span class="grid h-8 w-8 shrink-0 place-items-center rounded-full bg-raised font-mono text-xs text-ink-2">{{ strtoupper(substr($u?->name ?? 'U', 0, 2)) }}</span>
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block truncate text-sm text-ink">{{ $u?->name ?? '—' }}</span>
|
||||
<span class="block truncate font-mono text-[11px] {{ $u?->hasTwoFactorEnabled() ? 'text-online' : 'text-ink-3' }}">{{ $u?->hasTwoFactorEnabled() ? '2FA aktiv' : '2FA aus' }}</span>
|
||||
</span>
|
||||
</a>
|
||||
<form method="POST" action="{{ route('logout') }}" class="shrink-0">
|
||||
@csrf
|
||||
<button type="submit" class="grid min-h-11 min-w-11 place-items-center rounded-md text-ink-3 hover:bg-raised hover:text-ink" aria-label="Abmelden">
|
||||
|
|
|
|||
|
|
@ -10,12 +10,30 @@
|
|||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="mb-1.5 flex items-center justify-between">
|
||||
<label class="font-mono text-[11px] uppercase tracking-wider text-ink-3">Öffentlicher Schlüssel</label>
|
||||
<button type="button" wire:click="generate" wire:target="generate" wire:loading.attr="disabled" class="font-mono text-[11px] text-accent-text transition-colors hover:text-accent disabled:opacity-50">
|
||||
<span wire:loading.remove wire:target="generate">Neues Paar generieren</span>
|
||||
<span wire:loading wire:target="generate">generiere…</span>
|
||||
</button>
|
||||
</div>
|
||||
<textarea
|
||||
wire:model="publicKey"
|
||||
rows="4"
|
||||
placeholder="ssh-ed25519 AAAA… kommentar"
|
||||
rows="3"
|
||||
placeholder="ssh-ed25519 AAAA… kommentar — oder oben generieren"
|
||||
class="w-full rounded-md border border-line bg-inset px-3 py-2.5 font-mono text-xs text-ink placeholder:text-ink-4 focus:border-accent/40 focus:outline-none"
|
||||
></textarea>
|
||||
|
||||
@if ($generatedPrivate)
|
||||
<div class="mt-3 rounded-md border border-warning/30 bg-warning/10 p-3">
|
||||
<p class="flex items-center gap-1.5 font-mono text-[11px] text-warning">
|
||||
<x-icon name="alert" class="h-3.5 w-3.5 shrink-0" />Privater Schlüssel — erscheint nur jetzt, sicher speichern.
|
||||
</p>
|
||||
<textarea readonly rows="4" x-on:click="$el.select()"
|
||||
class="mt-2 w-full rounded-md border border-line bg-void px-3 py-2 font-mono text-[10px] leading-relaxed text-ink-2 focus:outline-none">{{ $generatedPrivate }}</textarea>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($error)
|
||||
<p class="mt-2 flex items-center gap-1.5 font-mono text-[11px] text-offline">
|
||||
<x-icon name="alert" class="h-3.5 w-3.5 shrink-0" />{{ $error }}
|
||||
|
|
|
|||
|
|
@ -1,170 +1,199 @@
|
|||
@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 = [
|
||||
['Kerne', $specs['cores'] ?? '—'],
|
||||
['RAM', isset($specs['ram_gb']) ? $specs['ram_gb'].' GB' : '—'],
|
||||
['Disk', isset($specs['disk_gb']) ? $specs['disk_gb'].' GB' : '—'],
|
||||
['Architektur', $specs['arch'] ?? '—'],
|
||||
['Kernel', $specs['kernel'] ?? '—'],
|
||||
['Virtualisierung', $specs['virt'] ?? '—'],
|
||||
['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
|
||||
|
||||
<div class="space-y-4" wire:poll.10s="pollMetrics" wire:init="load">
|
||||
{{-- Header --}}
|
||||
<div class="space-y-3">
|
||||
<a href="{{ route('servers.index') }}"
|
||||
class="inline-flex min-h-11 items-center gap-1.5 font-mono text-[11px] uppercase tracking-[0.2em] text-ink-3 hover:text-ink-2">
|
||||
<x-icon name="switcher" class="h-3.5 w-3.5 rotate-90" />
|
||||
Zurück zur Flotte
|
||||
</a>
|
||||
<div class="space-y-5" wire:poll.10s="pollMetrics" wire:init="load">
|
||||
<a href="{{ route('servers.index') }}"
|
||||
class="inline-flex min-h-11 items-center gap-1.5 font-mono text-[11px] uppercase tracking-[0.2em] text-ink-3 hover:text-ink-2">
|
||||
<x-icon name="switcher" class="h-3.5 w-3.5 rotate-90" />
|
||||
Zurück zur Flotte
|
||||
</a>
|
||||
|
||||
<div class="flex flex-wrap items-end justify-between gap-3">
|
||||
{{-- Hero header --}}
|
||||
<div class="flex flex-wrap items-center justify-between gap-4 rounded-xl border border-line bg-surface p-5 shadow-panel">
|
||||
<div class="flex min-w-0 items-center gap-4">
|
||||
<span @class([
|
||||
'grid h-12 w-12 shrink-0 place-items-center rounded-lg border',
|
||||
'border-online/30 bg-online/10 text-online' => $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',
|
||||
])>
|
||||
<x-icon name="server" class="h-6 w-6" />
|
||||
</span>
|
||||
<div class="min-w-0">
|
||||
<p class="font-mono text-[11px] uppercase tracking-[0.2em] text-accent-text">Server</p>
|
||||
<h2 class="mt-0.5 truncate font-display text-xl font-semibold text-ink sm:text-2xl">{{ $server->name }}</h2>
|
||||
<p class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[11px] text-ink-3">
|
||||
<div class="flex flex-wrap items-center gap-2.5">
|
||||
<h2 class="truncate font-display text-2xl font-semibold text-ink">{{ $server->name }}</h2>
|
||||
<x-status-pill :status="$server->status">{{ $statusLabel }}</x-status-pill>
|
||||
</div>
|
||||
<p class="mt-1.5 flex flex-wrap items-center gap-x-2.5 gap-y-1 font-mono text-[11px] text-ink-3">
|
||||
<span class="text-ink-2">{{ $server->hostname }}</span>
|
||||
<span class="text-ink-4">·</span>
|
||||
<span>{{ $server->ip }}</span>
|
||||
<span class="text-ink-4">·</span>
|
||||
<span>{{ $server->os }}</span>
|
||||
<span class="text-ink-4">·</span>
|
||||
<span>Uptime {{ $server->uptime }}</span>
|
||||
<span>Uptime {{ $server->uptime ?: '—' }}</span>
|
||||
<span class="text-ink-4">·</span>
|
||||
<span>zuletzt gesehen {{ optional($server->last_seen_at)->diffForHumans() ?? '—' }}</span>
|
||||
<span>zuletzt {{ optional($server->last_seen_at)->diffForHumans() ?? '—' }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex shrink-0 items-center gap-2">
|
||||
<x-btn variant="secondary" wire:click="$dispatch('openModal', { component: 'modals.edit-credential', arguments: { serverId: {{ $server->id }} } })">
|
||||
<x-icon name="shield" class="h-3.5 w-3.5" /> Zugang
|
||||
</x-btn>
|
||||
<x-btn variant="secondary" wire:click="openFiles">
|
||||
<x-icon name="folder" class="h-3.5 w-3.5" /> Dateien
|
||||
</x-btn>
|
||||
<x-status-pill :status="$server->status">{{ $statusLabel }}</x-status-pill>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex shrink-0 items-center gap-2">
|
||||
<x-btn variant="secondary" wire:click="$dispatch('openModal', { component: 'modals.edit-credential', arguments: { serverId: {{ $server->id }} } })">
|
||||
<x-icon name="shield" class="h-3.5 w-3.5" /> Zugang
|
||||
</x-btn>
|
||||
<x-btn variant="secondary" wire:click="openFiles">
|
||||
<x-icon name="folder" class="h-3.5 w-3.5" /> Dateien
|
||||
</x-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($ready && ! $connected)
|
||||
<div class="flex items-center gap-2.5 rounded-md border border-warning/25 bg-warning/10 px-4 py-3">
|
||||
<div class="flex items-center gap-2.5 rounded-lg border border-warning/25 bg-warning/10 px-4 py-3">
|
||||
<x-icon name="alert" class="h-4 w-4 shrink-0 text-warning" />
|
||||
<p class="text-sm text-ink-2">Keine Live-Verbindung — gezeigt werden die zuletzt gespeicherten Werte. Credential/Erreichbarkeit prüfen.</p>
|
||||
<p class="text-sm text-ink-2">Keine Live-Verbindung — gezeigt werden die zuletzt gespeicherten Werte. Zugang/Erreichbarkeit prüfen.</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Auslastung + Spezifikationen --}}
|
||||
<div class="grid grid-cols-1 gap-3 lg:grid-cols-2">
|
||||
<x-panel title="Auslastung" subtitle="Live · 10s">
|
||||
<div class="grid grid-cols-3 gap-4 py-3">
|
||||
<x-ring :value="$server->cpu" label="CPU" size="lg" :tone="$tone($server->cpu)" />
|
||||
<x-ring :value="$server->mem" label="RAM" size="lg" :tone="$tone($server->mem)" />
|
||||
<x-ring :value="$server->disk" label="Disk" size="lg" :tone="$tone($server->disk)" />
|
||||
{{-- Vitals: live gauges, full width, dense --}}
|
||||
<div class="grid grid-cols-1 gap-3 sm:grid-cols-3">
|
||||
@foreach ($vitals as $v)
|
||||
<div class="flex items-center gap-4 rounded-xl border border-line bg-surface p-4 shadow-panel">
|
||||
<x-ring :value="$v['val']" size="lg" :tone="$tone($v['val'])" />
|
||||
<div class="min-w-0">
|
||||
<p class="flex items-center gap-1.5 font-mono text-xs uppercase tracking-[0.2em] text-accent-text">
|
||||
<x-icon :name="$v['icon']" class="h-3.5 w-3.5" />{{ $v['label'] }}
|
||||
</p>
|
||||
<p class="mt-2 font-mono text-[11px] leading-relaxed text-ink-4">{{ $v['sub'] }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</x-panel>
|
||||
|
||||
<x-panel title="Spezifikationen" subtitle="Hardware-Profil" :padded="false">
|
||||
<dl class="divide-y divide-line">
|
||||
@foreach ($specRows as [$key, $val])
|
||||
<div class="flex items-center justify-between gap-3 px-4 py-2.5 sm:px-5">
|
||||
<dt class="text-sm text-ink-2">{{ $key }}</dt>
|
||||
<dd class="truncate font-mono text-sm text-ink">{{ $val }}</dd>
|
||||
</div>
|
||||
@endforeach
|
||||
</dl>
|
||||
</x-panel>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@if ($ready)
|
||||
{{-- Volumes + Netzwerk-Interfaces --}}
|
||||
<div class="grid grid-cols-1 gap-3 lg:grid-cols-2">
|
||||
<x-panel title="Volumes" :subtitle="count($volumes) . ' Mountpoints'" :padded="false">
|
||||
<div class="divide-y divide-line">
|
||||
@foreach ($volumes as $vol)
|
||||
@php $vt = $tone((int) $vol['used']); @endphp
|
||||
<div class="px-4 py-3 sm:px-5">
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<p class="truncate font-mono text-sm text-ink">{{ $vol['mount'] }}</p>
|
||||
<p class="shrink-0 font-mono text-[11px] text-ink-3">
|
||||
<span class="text-ink-2">{{ $vol['fs'] }}</span> · {{ $vol['size'] }}
|
||||
</p>
|
||||
{{-- Spezifikationen + Sicherheit --}}
|
||||
<div class="grid grid-cols-1 gap-3 lg:grid-cols-2">
|
||||
<x-panel title="Spezifikationen" subtitle="Hardware-Profil" :padded="false">
|
||||
<dl class="divide-y divide-line">
|
||||
@foreach ($specRows as [$key, $val])
|
||||
<div class="flex items-center justify-between gap-3 px-4 py-2.5 sm:px-5">
|
||||
<dt class="text-sm text-ink-2">{{ $key }}</dt>
|
||||
<dd class="truncate font-mono text-sm text-ink">{{ $val }}</dd>
|
||||
</div>
|
||||
<div class="mt-2 flex items-center gap-3">
|
||||
<div class="h-1.5 flex-1 overflow-hidden rounded-full bg-inset">
|
||||
<div class="h-full rounded-full {{ $barColor[$vt] }}" style="width: {{ $vol['used'] }}%"></div>
|
||||
@endforeach
|
||||
</dl>
|
||||
</x-panel>
|
||||
|
||||
<x-panel title="Sicherheit" subtitle="Hardening-Checkliste" :padded="false">
|
||||
<div class="divide-y divide-line">
|
||||
@foreach ($hardening as $check)
|
||||
<div @class([
|
||||
'flex items-center gap-3 border-l-2 px-4 py-3 sm:px-5',
|
||||
'border-online' => $check['status'] === 'online',
|
||||
'border-warning' => $check['status'] === 'warning',
|
||||
'border-offline' => $check['status'] === 'offline',
|
||||
])>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="truncate text-sm text-ink">{{ $check['label'] }}</p>
|
||||
<p class="truncate font-mono text-[11px] text-ink-3">{{ $check['detail'] }}</p>
|
||||
</div>
|
||||
<span class="tabular w-10 shrink-0 text-right font-mono text-[11px] text-ink-2">{{ $vol['used'] }}%</span>
|
||||
<x-status-pill :status="$check['status']" class="shrink-0">
|
||||
{{ $check['status'] === 'online' ? 'OK' : 'Fehlt' }}
|
||||
</x-status-pill>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</x-panel>
|
||||
@endforeach
|
||||
</div>
|
||||
</x-panel>
|
||||
</div>
|
||||
|
||||
<x-panel title="Netzwerk-Interfaces" :subtitle="count($interfaces) . ' Schnittstellen'" :padded="false">
|
||||
{{-- Dense table on desktop; horizontal scroll keeps columns aligned on small screens (R7) --}}
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full min-w-[34rem] text-left">
|
||||
<thead>
|
||||
<tr class="border-b border-line font-mono text-[10px] uppercase tracking-wider text-ink-4">
|
||||
<th class="px-4 py-2 font-medium sm:px-5">Name</th>
|
||||
<th class="px-4 py-2 font-medium">IP</th>
|
||||
<th class="px-4 py-2 font-medium">MAC</th>
|
||||
<th class="px-4 py-2 text-right font-medium">RX</th>
|
||||
<th class="px-4 py-2 pr-4 text-right font-medium sm:pr-5">TX</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-line">
|
||||
@foreach ($interfaces as $if)
|
||||
<tr class="font-mono text-[11px] text-ink-2">
|
||||
<td class="px-4 py-2.5 text-ink sm:px-5">{{ $if['name'] }}</td>
|
||||
<td class="px-4 py-2.5">{{ $if['ip'] }}</td>
|
||||
<td class="px-4 py-2.5">{{ $if['mac'] }}</td>
|
||||
<td class="tabular px-4 py-2.5 text-right">{{ $if['rx'] }}</td>
|
||||
<td class="tabular px-4 py-2.5 pr-4 text-right sm:pr-5">{{ $if['tx'] }}</td>
|
||||
{{-- Volumes + Netzwerk-Interfaces --}}
|
||||
<div class="grid grid-cols-1 gap-3 lg:grid-cols-2">
|
||||
<x-panel title="Volumes" :subtitle="count($volumes) . ' Mountpoints'" :padded="false">
|
||||
<div class="divide-y divide-line">
|
||||
@forelse ($volumes as $vol)
|
||||
@php $vt = $tone((int) $vol['used']); @endphp
|
||||
<div class="px-4 py-3 sm:px-5">
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<p class="truncate font-mono text-sm text-ink">{{ $vol['mount'] }}</p>
|
||||
<p class="shrink-0 font-mono text-[11px] text-ink-3">
|
||||
<span class="text-ink-2">{{ $vol['fs'] }}</span> · {{ $vol['size'] }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-2 flex items-center gap-3">
|
||||
<div class="h-1.5 flex-1 overflow-hidden rounded-full bg-inset">
|
||||
<div class="h-full rounded-full {{ $barColor[$vt] }}" style="width: {{ $vol['used'] }}%"></div>
|
||||
</div>
|
||||
<span class="tabular w-10 shrink-0 text-right font-mono text-[11px] text-ink-2">{{ $vol['used'] }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<p class="px-5 py-8 text-center font-mono text-[11px] text-ink-3">Keine Volumes gelesen.</p>
|
||||
@endforelse
|
||||
</div>
|
||||
</x-panel>
|
||||
|
||||
<x-panel title="Netzwerk-Interfaces" :subtitle="count($interfaces) . ' Schnittstellen'" :padded="false">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full min-w-[34rem] text-left">
|
||||
<thead>
|
||||
<tr class="border-b border-line font-mono text-[10px] uppercase tracking-wider text-ink-4">
|
||||
<th class="px-4 py-2 font-medium sm:px-5">Name</th>
|
||||
<th class="px-4 py-2 font-medium">IP</th>
|
||||
<th class="px-4 py-2 font-medium">MAC</th>
|
||||
<th class="px-4 py-2 text-right font-medium">RX</th>
|
||||
<th class="px-4 py-2 pr-4 text-right font-medium sm:pr-5">TX</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</x-panel>
|
||||
</div>
|
||||
|
||||
{{-- Sicherheit (Hardening) + SSH-Schlüssel --}}
|
||||
<div class="grid grid-cols-1 gap-3 lg:grid-cols-2">
|
||||
<x-panel title="Sicherheit (Hardening)" subtitle="Checkliste" :padded="false">
|
||||
<div class="divide-y divide-line">
|
||||
@foreach ($hardening as $check)
|
||||
<div class="flex items-center gap-3 px-4 py-3 sm:px-5">
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="truncate text-sm text-ink">{{ $check['label'] }}</p>
|
||||
<p class="truncate font-mono text-[11px] text-ink-3">{{ $check['detail'] }}</p>
|
||||
</div>
|
||||
<x-status-pill :status="$check['status']" class="shrink-0">
|
||||
{{ $check['status'] === 'online' ? 'OK' : 'Fehlt' }}
|
||||
</x-status-pill>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</x-panel>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-line">
|
||||
@foreach ($interfaces as $if)
|
||||
<tr class="font-mono text-[11px] text-ink-2">
|
||||
<td class="px-4 py-2.5 text-ink sm:px-5">{{ $if['name'] }}</td>
|
||||
<td class="px-4 py-2.5">{{ $if['ip'] }}</td>
|
||||
<td class="px-4 py-2.5">{{ $if['mac'] }}</td>
|
||||
<td class="tabular px-4 py-2.5 text-right">{{ $if['rx'] }}</td>
|
||||
<td class="tabular px-4 py-2.5 pr-4 text-right sm:pr-5">{{ $if['tx'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</x-panel>
|
||||
</div>
|
||||
|
||||
{{-- SSH-Schlüssel --}}
|
||||
<x-panel title="SSH-Schlüssel" :subtitle="count($sshKeys) . ' autorisiert'" :padded="false">
|
||||
<x-slot:actions>
|
||||
{{-- R5: wire to wire-elements/modal --}}
|
||||
<x-btn variant="accent" wire:click="$dispatch('openModal', { component: 'modals.add-ssh-key', arguments: { serverId: {{ $server->id }} } })">
|
||||
<x-icon name="plus" class="h-3.5 w-3.5" />
|
||||
Schlüssel hinzufügen
|
||||
<x-icon name="plus" class="h-3.5 w-3.5" /> Schlüssel hinzufügen
|
||||
</x-btn>
|
||||
</x-slot:actions>
|
||||
<div class="divide-y divide-line">
|
||||
@foreach ($sshKeys as $key)
|
||||
@forelse ($sshKeys as $key)
|
||||
<div class="flex items-center gap-3 px-4 py-3 sm:px-5">
|
||||
<span class="grid h-7 w-7 shrink-0 place-items-center rounded-sm bg-raised text-ink-3">
|
||||
<x-icon name="shield" class="h-3.5 w-3.5" />
|
||||
|
|
@ -176,31 +205,37 @@
|
|||
</div>
|
||||
<p class="truncate font-mono text-[11px] text-ink-3">{{ $key['fingerprint'] }}</p>
|
||||
</div>
|
||||
{{-- R5: destructive → wire-elements/modal confirm + audit --}}
|
||||
<x-btn variant="ghost-danger" icon wire:click="confirmKeyRemoval(@js($key['fingerprint']), @js($key['comment']))" title="Schlüssel entfernen">
|
||||
<x-icon name="trash" class="h-3.5 w-3.5" />
|
||||
</x-btn>
|
||||
</div>
|
||||
@endforeach
|
||||
@empty
|
||||
<p class="px-5 py-8 text-center font-mono text-[11px] text-ink-3">Keine autorisierten Schlüssel.</p>
|
||||
@endforelse
|
||||
</div>
|
||||
</x-panel>
|
||||
</div>
|
||||
@else
|
||||
{{-- skeletons for the SSH-loaded sections --}}
|
||||
<div class="grid grid-cols-1 gap-3 lg:grid-cols-2">
|
||||
<x-panel title="Volumes" subtitle="lädt…">
|
||||
<div class="space-y-3"><x-skeleton class="h-3 w-full" /><x-skeleton class="h-3 w-2/3" /><x-skeleton class="h-3 w-5/6" /></div>
|
||||
</x-panel>
|
||||
<x-panel title="Netzwerk-Interfaces" subtitle="lädt…">
|
||||
<div class="space-y-3"><x-skeleton class="h-3 w-full" /><x-skeleton class="h-3 w-3/4" /><x-skeleton class="h-3 w-5/6" /></div>
|
||||
</x-panel>
|
||||
@foreach (['Spezifikationen', 'Sicherheit'] as $t)
|
||||
<x-panel :title="$t" subtitle="lädt…" :padded="false">
|
||||
<div class="space-y-3 p-4 sm:p-5">
|
||||
<x-skeleton class="h-3 w-full" /><x-skeleton class="h-3 w-2/3" /><x-skeleton class="h-3 w-5/6" /><x-skeleton class="h-3 w-1/2" />
|
||||
</div>
|
||||
</x-panel>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-3 lg:grid-cols-2">
|
||||
<x-panel title="Sicherheit (Hardening)" subtitle="lädt…">
|
||||
<div class="space-y-3"><x-skeleton class="h-3 w-full" /><x-skeleton class="h-3 w-2/3" /><x-skeleton class="h-3 w-5/6" /></div>
|
||||
</x-panel>
|
||||
<x-panel title="SSH-Schlüssel" subtitle="lädt…">
|
||||
<div class="space-y-3"><x-skeleton class="h-3 w-full" /><x-skeleton class="h-3 w-3/4" /></div>
|
||||
</x-panel>
|
||||
@foreach (['Volumes', 'Netzwerk-Interfaces'] as $t)
|
||||
<x-panel :title="$t" subtitle="lädt…" :padded="false">
|
||||
<div class="space-y-3 p-4 sm:p-5">
|
||||
<x-skeleton class="h-3 w-full" /><x-skeleton class="h-3 w-3/4" /><x-skeleton class="h-3 w-5/6" />
|
||||
</div>
|
||||
</x-panel>
|
||||
@endforeach
|
||||
</div>
|
||||
<x-panel title="SSH-Schlüssel" subtitle="lädt…" :padded="false">
|
||||
<div class="space-y-3 p-4 sm:p-5"><x-skeleton class="h-3 w-2/3" /><x-skeleton class="h-3 w-1/2" /></div>
|
||||
</x-panel>
|
||||
@endif
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</label>
|
||||
</x-slot:actions>
|
||||
|
||||
<div class="divide-y divide-line">
|
||||
<div class="max-h-[32rem] divide-y divide-line overflow-y-auto">
|
||||
@if (! $ready)
|
||||
@for ($i = 0; $i < 7; $i++)
|
||||
<div class="flex items-center gap-3 px-4 py-3.5 sm:px-5">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,83 @@
|
|||
@php
|
||||
$field = 'h-9 w-full rounded-md border border-line bg-inset px-3 font-sans text-sm text-ink placeholder:text-ink-4 focus:border-accent/40 focus:outline-none';
|
||||
$label = 'mb-1 block font-mono text-[11px] uppercase tracking-wider text-ink-3';
|
||||
$err = 'mt-1 flex items-center gap-1.5 font-mono text-[11px] text-offline';
|
||||
@endphp
|
||||
|
||||
<div class="mx-auto max-w-3xl space-y-5">
|
||||
{{-- Header --}}
|
||||
<div>
|
||||
<p class="font-mono text-[11px] uppercase tracking-[0.2em] text-accent-text">Konto</p>
|
||||
<h2 class="mt-0.5 font-display text-xl font-semibold text-ink sm:text-2xl">Einstellungen</h2>
|
||||
</div>
|
||||
|
||||
{{-- Profil --}}
|
||||
<x-panel title="Profil" subtitle="Name und E-Mail">
|
||||
<form wire:submit="updateProfile" class="space-y-4">
|
||||
<div>
|
||||
<label class="{{ $label }}">Name</label>
|
||||
<input wire:model="name" type="text" class="{{ $field }}" />
|
||||
@error('name') <p class="{{ $err }}"><x-icon name="alert" class="h-3.5 w-3.5 shrink-0" />{{ $message }}</p> @enderror
|
||||
</div>
|
||||
<div>
|
||||
<label class="{{ $label }}">E-Mail</label>
|
||||
<input wire:model="email" type="email" class="{{ $field }} font-mono" />
|
||||
@error('email') <p class="{{ $err }}"><x-icon name="alert" class="h-3.5 w-3.5 shrink-0" />{{ $message }}</p> @enderror
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<x-btn variant="primary" type="submit" wire:target="updateProfile" wire:loading.attr="disabled">
|
||||
<svg wire:loading wire:target="updateProfile" class="h-3.5 w-3.5 animate-spin" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" aria-hidden="true"><path d="M21 12a9 9 0 1 1-6.219-8.56" stroke-linecap="round" /></svg>
|
||||
Speichern
|
||||
</x-btn>
|
||||
</div>
|
||||
</form>
|
||||
</x-panel>
|
||||
|
||||
{{-- Passwort --}}
|
||||
<x-panel title="Passwort" subtitle="Mindestens 10 Zeichen">
|
||||
<form wire:submit="updatePassword" class="space-y-4">
|
||||
<div>
|
||||
<label class="{{ $label }}">Aktuelles Passwort</label>
|
||||
<input wire:model="current_password" type="password" autocomplete="current-password" class="{{ $field }} font-mono" />
|
||||
@error('current_password') <p class="{{ $err }}"><x-icon name="alert" class="h-3.5 w-3.5 shrink-0" />{{ $message }}</p> @enderror
|
||||
</div>
|
||||
<div class="grid gap-4 sm:grid-cols-2">
|
||||
<div>
|
||||
<label class="{{ $label }}">Neues Passwort</label>
|
||||
<input wire:model="password" type="password" autocomplete="new-password" class="{{ $field }} font-mono" />
|
||||
@error('password') <p class="{{ $err }}"><x-icon name="alert" class="h-3.5 w-3.5 shrink-0" />{{ $message }}</p> @enderror
|
||||
</div>
|
||||
<div>
|
||||
<label class="{{ $label }}">Wiederholen</label>
|
||||
<input wire:model="password_confirmation" type="password" autocomplete="new-password" class="{{ $field }} font-mono" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<x-btn variant="primary" type="submit" wire:target="updatePassword" wire:loading.attr="disabled">
|
||||
<svg wire:loading wire:target="updatePassword" class="h-3.5 w-3.5 animate-spin" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" aria-hidden="true"><path d="M21 12a9 9 0 1 1-6.219-8.56" stroke-linecap="round" /></svg>
|
||||
Passwort ändern
|
||||
</x-btn>
|
||||
</div>
|
||||
</form>
|
||||
</x-panel>
|
||||
|
||||
{{-- 2FA --}}
|
||||
<x-panel title="Zwei-Faktor-Authentifizierung" subtitle="TOTP (Authenticator-App)">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div class="flex items-center gap-3">
|
||||
<x-status-dot :status="$twoFactorEnabled ? 'online' : 'offline'" />
|
||||
<div>
|
||||
<p class="text-sm text-ink">{{ $twoFactorEnabled ? '2FA ist aktiv' : '2FA ist nicht eingerichtet' }}</p>
|
||||
<p class="font-mono text-[11px] text-ink-3">{{ $twoFactorEnabled ? 'Der Login erfordert einen TOTP-Code.' : 'Empfohlen — schützt den Login mit einem zweiten Faktor.' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@if ($twoFactorEnabled)
|
||||
<x-btn variant="ghost-danger" wire:click="confirmDisableTwoFactor">Deaktivieren</x-btn>
|
||||
@else
|
||||
<x-btn variant="accent" :href="route('two-factor.setup')" wire:navigate>
|
||||
<x-icon name="shield" class="h-3.5 w-3.5" /> Einrichten
|
||||
</x-btn>
|
||||
@endif
|
||||
</div>
|
||||
</x-panel>
|
||||
</div>
|
||||
|
|
@ -7,6 +7,7 @@ use App\Livewire\Dashboard;
|
|||
use App\Livewire\Files;
|
||||
use App\Livewire\Servers;
|
||||
use App\Livewire\Services;
|
||||
use App\Livewire\Settings;
|
||||
use Illuminate\Support\Facades\Auth as AuthFacade;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
|
|
@ -38,5 +39,7 @@ Route::middleware('auth')->group(function () {
|
|||
Route::get('/services', Services\Index::class)->name('services.index');
|
||||
Route::get('/files', Files\Index::class)->name('files.index');
|
||||
Route::get('/audit', Audit\Index::class)->name('audit.index');
|
||||
|
||||
Route::get('/einstellungen', Settings\Index::class)->name('settings');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue