feat: Netzwerk-Modul v0.5.0 – Import, Geräte-Tracking, Ereignislog

This commit is contained in:
2026-06-29 15:18:49 +02:00
parent eb57be730b
commit 402537805d
21 changed files with 1269 additions and 7 deletions
+186
View File
@@ -0,0 +1,186 @@
<x-app-layout>
<x-slot name="header">
<div class="flex items-center space-x-2">
<a href="{{ route('network.devices') }}" class="text-gray-500 hover:text-gray-700">Geräte</a>
<span class="text-gray-400">/</span>
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200">{{ $device->display_name }}</h2>
</div>
</x-slot>
<div class="py-8">
<div class="max-w-5xl mx-auto sm:px-6 lg:px-8 space-y-6">
@if(session('success'))
<div class="p-4 bg-green-100 text-green-800 rounded-md">{{ session('success') }}</div>
@endif
{{-- Stammdaten --}}
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg p-6">
<div class="flex items-start justify-between mb-4">
<div>
<div class="flex items-center space-x-2 mb-1">
<span class="w-3 h-3 rounded-full {{ $device->status === 'online' ? 'bg-green-500' : 'bg-red-400' }}"></span>
<span class="text-lg font-bold text-gray-900 dark:text-gray-100">{{ $device->display_name }}</span>
</div>
<p class="text-sm text-gray-500 dark:text-gray-400">
Erstmals gesehen: {{ $device->first_seen_at?->format('d.m.Y H:i') }}
· Zuletzt: {{ $device->last_seen_at?->format('d.m.Y H:i') }}
</p>
</div>
</div>
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 text-sm">
<div>
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wider">IP-Adresse</p>
<p class="mt-1 font-mono font-semibold text-gray-900 dark:text-gray-100">{{ $device->current_ip ?? '—' }}</p>
</div>
<div>
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wider">MAC-Adresse</p>
<p class="mt-1 font-mono font-semibold text-gray-900 dark:text-gray-100">{{ $device->mac_address }}</p>
</div>
<div>
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wider">Hersteller</p>
<p class="mt-1 text-gray-900 dark:text-gray-100">{{ $device->mac_vendor ?? '—' }}</p>
</div>
<div>
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wider">Hostname</p>
<p class="mt-1 text-gray-900 dark:text-gray-100">{{ $device->hostname ?? '—' }}</p>
</div>
<div>
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wider">NetBIOS</p>
<p class="mt-1 text-gray-900 dark:text-gray-100">{{ $device->netbios_name ?? '—' }}</p>
</div>
<div>
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wider">Offene Ports</p>
<p class="mt-1 text-gray-900 dark:text-gray-100">{{ $device->ports ?? '—' }}</p>
</div>
</div>
</div>
{{-- Bezeichnung & Notiz --}}
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg p-6">
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-4">Bezeichnung & Notizen</h3>
<form method="POST" action="{{ route('network.device.update', $device) }}" class="space-y-4">
@csrf
@method('PUT')
<div>
<x-input-label for="label" value="Bezeichnung (eigener Name)" />
<x-text-input id="label" name="label" type="text" class="mt-1 block w-full"
value="{{ old('label', $device->label) }}"
placeholder="z.B. NAS-Server, Drucker Büro, ..." />
</div>
<div>
<x-input-label for="notes" value="Notizen" />
<textarea id="notes" name="notes" rows="3"
class="mt-1 block w-full border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 rounded-md shadow-sm text-sm focus:ring-indigo-500 focus:border-indigo-500"
placeholder="Interne Notizen zu diesem Gerät...">{{ old('notes', $device->notes) }}</textarea>
</div>
<div class="flex justify-end">
<button type="submit" style="background-color: var(--color-primary)"
class="px-4 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition">
Speichern
</button>
</div>
</form>
</div>
{{-- Manuelle Notiz --}}
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg p-6">
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-4">Manuelle Notiz hinzufügen</h3>
<form method="POST" action="{{ route('network.device.note', $device) }}" class="flex gap-3">
@csrf
<input type="text" name="description" required
placeholder="Änderung, Beobachtung, Aufgabe..."
class="flex-1 border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 rounded-md shadow-sm text-sm focus:ring-indigo-500 focus:border-indigo-500" />
<button type="submit" style="background-color: var(--color-primary)"
class="px-4 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition whitespace-nowrap">
+ Notiz
</button>
</form>
</div>
{{-- IP-Verlauf --}}
@if($ipHistory->count() > 0)
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg overflow-hidden">
<div class="px-5 py-4 border-b border-gray-200 dark:border-gray-700">
<h3 class="font-semibold text-gray-900 dark:text-gray-100">IP-Verlauf</h3>
</div>
<table class="min-w-full divide-y divide-gray-100 dark:divide-gray-700 text-sm">
<thead class="bg-gray-50 dark:bg-gray-700">
<tr>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Datum</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">IP</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Status</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Ping</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
@foreach($ipHistory as $h)
<tr>
<td class="px-4 py-2 text-gray-500 dark:text-gray-400">{{ $h->created_at->format('d.m.Y H:i') }}</td>
<td class="px-4 py-2 font-mono text-gray-900 dark:text-gray-100">{{ $h->ip_address }}</td>
<td class="px-4 py-2">
<span class="text-xs {{ $h->status === 'online' ? 'text-green-600' : 'text-gray-400' }}">{{ $h->status }}</span>
</td>
<td class="px-4 py-2 text-gray-500 dark:text-gray-400">{{ $h->ping_ms ? $h->ping_ms . ' ms' : '—' }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
{{-- Ereignis-Protokoll --}}
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg overflow-hidden">
<div class="px-5 py-4 border-b border-gray-200 dark:border-gray-700">
<h3 class="font-semibold text-gray-900 dark:text-gray-100">Ereignis-Protokoll</h3>
</div>
<div class="divide-y divide-gray-100 dark:divide-gray-700">
@forelse($device->events as $event)
<div class="flex items-start justify-between px-5 py-3">
<div class="flex items-start space-x-3">
<span class="mt-1 w-2 h-2 rounded-full flex-shrink-0
{{ $event->event_color === 'blue' ? 'bg-blue-500' :
($event->event_color === 'yellow' ? 'bg-yellow-500' :
($event->event_color === 'green' ? 'bg-green-500' :
($event->event_color === 'red' ? 'bg-red-500' :
($event->event_color === 'purple' ? 'bg-purple-500' : 'bg-gray-400')))) }}">
</span>
<div>
<div class="flex items-center space-x-2">
<span class="text-sm font-medium text-gray-900 dark:text-gray-100">{{ $event->event_label }}</span>
@if($event->old_value && $event->new_value)
<span class="text-xs text-gray-400">
{{ $event->old_value }} {{ $event->new_value }}
</span>
@endif
</div>
<p class="text-xs text-gray-500 dark:text-gray-400">
{{ $event->description }}
· {{ $event->created_at->format('d.m.Y H:i') }}
@if($event->documented)
· <span class="text-green-600"> dokumentiert</span>
@if($event->documentedBy) von {{ $event->documentedBy->name }} @endif
@endif
</p>
</div>
</div>
@if(!$event->documented)
<form method="POST" action="{{ route('network.document', $event) }}" class="ml-4 flex-shrink-0">
@csrf
<button type="submit"
class="text-xs px-3 py-1 rounded border border-green-300 text-green-700 hover:bg-green-50 transition">
Bestätigen
</button>
</form>
@endif
</div>
@empty
<p class="px-5 py-8 text-center text-sm text-gray-500">Keine Ereignisse vorhanden.</p>
@endforelse
</div>
</div>
</div>
</div>
</x-app-layout>
+105
View File
@@ -0,0 +1,105 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Alle Geräte</h2>
</x-slot>
<div class="py-8">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
{{-- Filter --}}
<form method="GET" action="{{ route('network.devices') }}" class="flex gap-3 mb-4">
<input type="text" name="search" value="{{ request('search') }}"
placeholder="IP, MAC, Hostname, Hersteller..."
class="flex-1 border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 rounded-md shadow-sm text-sm focus:ring-indigo-500 focus:border-indigo-500" />
<select name="status"
class="border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 rounded-md shadow-sm text-sm">
<option value="">Alle Status</option>
<option value="online" {{ request('status') === 'online' ? 'selected' : '' }}>Online</option>
<option value="offline" {{ request('status') === 'offline' ? 'selected' : '' }}>Offline</option>
</select>
<button type="submit" style="background-color: var(--color-primary)"
class="px-4 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition">
Suchen
</button>
@if(request()->hasAny(['search', 'status']))
<a href="{{ route('network.devices') }}"
class="px-4 py-2 text-sm font-medium rounded-md border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition">
Zurücksetzen
</a>
@endif
</form>
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg overflow-hidden">
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 text-sm">
<thead class="bg-gray-50 dark:bg-gray-700">
<tr>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Status</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">IP-Adresse</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">MAC-Adresse</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Hostname / Bezeichnung</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Hersteller</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Zuletzt gesehen</th>
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Ereignisse</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
@forelse($devices as $device)
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700 transition">
<td class="px-4 py-3">
<span class="inline-flex items-center">
<span class="w-2 h-2 rounded-full mr-2
{{ $device->status === 'online' ? 'bg-green-500' : 'bg-red-400' }}">
</span>
<span class="text-xs {{ $device->status === 'online' ? 'text-green-700 dark:text-green-400' : 'text-gray-500 dark:text-gray-400' }}">
{{ $device->status }}
</span>
</span>
</td>
<td class="px-4 py-3 font-mono text-gray-900 dark:text-gray-100 font-medium">
{{ $device->current_ip }}
</td>
<td class="px-4 py-3 font-mono text-gray-600 dark:text-gray-400 text-xs">
{{ $device->mac_address }}
</td>
<td class="px-4 py-3 text-gray-900 dark:text-gray-100">
@if($device->label)
<span class="font-medium">{{ $device->label }}</span>
<span class="text-gray-400 text-xs ml-1">({{ $device->hostname }})</span>
@else
{{ $device->hostname ?? '—' }}
@endif
</td>
<td class="px-4 py-3 text-gray-600 dark:text-gray-400 text-xs">
{{ $device->mac_vendor ?? '—' }}
</td>
<td class="px-4 py-3 text-gray-500 dark:text-gray-400 text-xs">
{{ $device->last_seen_at?->format('d.m.Y H:i') ?? '—' }}
</td>
<td class="px-4 py-3 text-right">
@php $undoc = $device->events->where('documented', false)->count(); @endphp
<a href="{{ route('network.device', $device) }}"
class="text-indigo-600 hover:text-indigo-800 text-xs">
Detail
@if($undoc > 0)
<span class="ml-1 bg-yellow-100 text-yellow-800 text-xs px-1.5 py-0.5 rounded-full">{{ $undoc }}</span>
@endif
</a>
</td>
</tr>
@empty
<tr>
<td colspan="7" class="px-4 py-10 text-center text-gray-500">Keine Geräte gefunden.</td>
</tr>
@endforelse
</tbody>
</table>
@if($devices->hasPages())
<div class="px-4 py-3 border-t border-gray-200 dark:border-gray-700">
{{ $devices->links() }}
</div>
@endif
</div>
</div>
</div>
</x-app-layout>
+46
View File
@@ -0,0 +1,46 @@
<x-app-layout>
<x-slot name="header">
<div class="flex items-center space-x-2">
<a href="{{ route('network.index') }}" class="text-gray-500 hover:text-gray-700">Netzwerk</a>
<span class="text-gray-400">/</span>
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200">Scan importieren</h2>
</div>
</x-slot>
<div class="py-8">
<div class="max-w-xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg p-6">
@if(session('success'))
<div class="mb-4 p-4 bg-green-100 text-green-800 rounded-md">{{ session('success') }}</div>
@endif
<p class="text-sm text-gray-600 dark:text-gray-400 mb-6">
Importiere den Textexport von <strong>Angry IP Scanner</strong>.<br>
Exportformat: <code class="bg-gray-100 dark:bg-gray-700 px-1 rounded">Datei Speichern als Komma-getrennte Textdatei (.txt)</code>
</p>
<form method="POST" action="{{ route('network.import') }}" enctype="multipart/form-data" class="space-y-5">
@csrf
<div>
<x-input-label for="scan_file" value="Angry IP Scanner Export (.txt)" />
<input id="scan_file" name="scan_file" type="file" accept=".txt,.csv" required
class="mt-1 block w-full text-sm text-gray-500
file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0
file:text-sm file:font-medium file:bg-indigo-50 file:text-indigo-700
hover:file:bg-indigo-100 dark:file:bg-indigo-900 dark:file:text-indigo-300" />
<x-input-error :messages="$errors->get('scan_file')" class="mt-2" />
</div>
<div class="flex justify-end">
<button type="submit" style="background-color: var(--color-primary)"
class="px-6 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition">
Import starten
</button>
</div>
</form>
</div>
</div>
</div>
</x-app-layout>
+121
View File
@@ -0,0 +1,121 @@
<x-app-layout>
<x-slot name="header">
<div class="flex items-center justify-between">
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Netzwerk-Übersicht</h2>
<div class="flex space-x-2">
<a href="{{ route('network.devices') }}"
class="px-3 py-2 text-sm font-medium rounded-md border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition">
Alle Geräte
</a>
<a href="{{ route('network.import') }}"
style="background-color: var(--color-primary)"
class="px-3 py-2 text-sm font-medium rounded-md text-white hover:opacity-90 transition">
+ Scan importieren
</a>
</div>
</div>
</x-slot>
<div class="py-8">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
@if(session('success'))
<div class="p-4 bg-green-100 text-green-800 rounded-md">{{ session('success') }}</div>
@endif
{{-- KPI-Karten --}}
<div class="grid grid-cols-2 lg:grid-cols-4 gap-4">
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm p-5">
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Geräte gesamt</p>
<p class="mt-1 text-3xl font-bold text-gray-900 dark:text-gray-100">{{ $totalDevices }}</p>
</div>
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm p-5">
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Aktuell online</p>
<p class="mt-1 text-3xl font-bold text-green-600">{{ $onlineDevices }}</p>
</div>
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm p-5">
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Scans gesamt</p>
<p class="mt-1 text-3xl font-bold text-gray-900 dark:text-gray-100">{{ $scans->count() }}</p>
</div>
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm p-5">
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Undokumentierte Ereignisse</p>
<p class="mt-1 text-3xl font-bold text-yellow-600">{{ $recentEvents->count() }}</p>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
{{-- Letzte Scans --}}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm overflow-hidden">
<div class="px-5 py-4 border-b border-gray-200 dark:border-gray-700">
<h3 class="font-semibold text-gray-900 dark:text-gray-100">Letzte Scans</h3>
</div>
<div class="divide-y divide-gray-100 dark:divide-gray-700">
@forelse($scans as $scan)
<a href="{{ route('network.scan', $scan) }}"
class="flex items-center justify-between px-5 py-3 hover:bg-gray-50 dark:hover:bg-gray-700 transition">
<div>
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">{{ $scan->subnet }}</p>
<p class="text-xs text-gray-500 dark:text-gray-400">{{ $scan->created_at->format('d.m.Y H:i') }} · {{ $scan->scanner }}</p>
</div>
<div class="text-right">
<span class="text-sm font-semibold text-green-600">{{ $scan->online_hosts }} online</span>
@if($scan->new_devices > 0)
<span class="ml-2 text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded-full">{{ $scan->new_devices }} neu</span>
@endif
</div>
</a>
@empty
<p class="px-5 py-8 text-center text-sm text-gray-500">Noch keine Scans vorhanden.</p>
@endforelse
</div>
</div>
{{-- Undokumentierte Ereignisse --}}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm overflow-hidden">
<div class="px-5 py-4 border-b border-gray-200 dark:border-gray-700">
<h3 class="font-semibold text-gray-900 dark:text-gray-100">Undokumentierte Ereignisse</h3>
</div>
<div class="divide-y divide-gray-100 dark:divide-gray-700">
@forelse($recentEvents as $event)
<div class="flex items-start justify-between px-5 py-3">
<div class="flex items-start space-x-3">
<span class="mt-0.5 inline-block w-2 h-2 rounded-full flex-shrink-0
{{ $event->event_color === 'blue' ? 'bg-blue-500' :
($event->event_color === 'yellow' ? 'bg-yellow-500' :
($event->event_color === 'green' ? 'bg-green-500' :
($event->event_color === 'red' ? 'bg-red-500' : 'bg-gray-500'))) }}">
</span>
<div>
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">
{{ $event->event_label }}
@if($event->device)
<a href="{{ route('network.device', $event->device) }}"
class="text-indigo-600 hover:underline">
{{ $event->device->display_name }}
</a>
@endif
</p>
<p class="text-xs text-gray-500 dark:text-gray-400">
{{ $event->description }}
· {{ $event->created_at->diffForHumans() }}
</p>
</div>
</div>
<form method="POST" action="{{ route('network.document', $event) }}" class="ml-3 flex-shrink-0">
@csrf
<button type="submit"
class="text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition">
OK
</button>
</form>
</div>
@empty
<p class="px-5 py-8 text-center text-sm text-green-600">Alle Ereignisse dokumentiert.</p>
@endforelse
</div>
</div>
</div>
</div>
</div>
</x-app-layout>
+64
View File
@@ -0,0 +1,64 @@
<x-app-layout>
<x-slot name="header">
<div class="flex items-center space-x-2">
<a href="{{ route('network.index') }}" class="text-gray-500 hover:text-gray-700">Netzwerk</a>
<span class="text-gray-400">/</span>
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200">Scan {{ $scan->created_at->format('d.m.Y H:i') }}</h2>
</div>
</x-slot>
<div class="py-8">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
{{-- Scan-Info --}}
<div class="grid grid-cols-2 md:grid-cols-5 gap-4">
@foreach(['Subnetz' => $scan->subnet, 'Quelle' => $scan->scanner, 'Gesamt' => $scan->total_hosts, 'Online' => $scan->online_hosts, 'Neue Geräte' => $scan->new_devices] as $label => $val)
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm p-4">
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wider">{{ $label }}</p>
<p class="mt-1 text-xl font-bold text-gray-900 dark:text-gray-100">{{ $val }}</p>
</div>
@endforeach
</div>
{{-- Host-Tabelle --}}
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg overflow-hidden">
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 text-sm">
<thead class="bg-gray-50 dark:bg-gray-700">
<tr>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Status</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">IP-Adresse</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">MAC-Adresse</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Hostname</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Hersteller</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Ping</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Ports</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
@foreach($hosts as $host)
<tr class="{{ $host->status === 'online' ? '' : 'opacity-50' }} hover:bg-gray-50 dark:hover:bg-gray-700 transition">
<td class="px-4 py-2">
<span class="w-2 h-2 rounded-full inline-block {{ $host->status === 'online' ? 'bg-green-500' : 'bg-gray-300' }}"></span>
</td>
<td class="px-4 py-2 font-mono font-medium text-gray-900 dark:text-gray-100">
@if($host->device)
<a href="{{ route('network.device', $host->device) }}" class="text-indigo-600 hover:underline">
{{ $host->ip_address }}
</a>
@else
{{ $host->ip_address }}
@endif
</td>
<td class="px-4 py-2 font-mono text-xs text-gray-600 dark:text-gray-400">{{ $host->mac_address ?? '—' }}</td>
<td class="px-4 py-2 text-gray-700 dark:text-gray-300">{{ $host->hostname ?? '—' }}</td>
<td class="px-4 py-2 text-xs text-gray-600 dark:text-gray-400">{{ $host->mac_vendor ?? '—' }}</td>
<td class="px-4 py-2 text-xs text-gray-600 dark:text-gray-400">{{ $host->ping_ms ? $host->ping_ms . ' ms' : '—' }}</td>
<td class="px-4 py-2 text-xs text-gray-600 dark:text-gray-400 max-w-xs truncate">{{ $host->ports ?? '—' }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</x-app-layout>