feat: Netzwerk-Segmentverwaltung, Dashboard, globale Suche v0.6.0
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
<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">Netzwerk-Dashboard</h2>
|
||||
<div class="flex gap-2">
|
||||
<a href="{{ route('network.segments.create') }}"
|
||||
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">
|
||||
+ Segment anlegen
|
||||
</a>
|
||||
<a href="{{ route('network.import') }}" style="background-color: var(--color-primary)"
|
||||
class="px-4 py-2 text-white text-sm font-medium rounded-md 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">
|
||||
|
||||
{{-- KPI-Karten --}}
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<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">Segmente</p>
|
||||
<p class="mt-1 text-2xl font-bold text-gray-900 dark:text-gray-100">{{ $segments->count() }}</p>
|
||||
</div>
|
||||
<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">Geräte gesamt</p>
|
||||
<p class="mt-1 text-2xl 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-4">
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wider">Aktuell online</p>
|
||||
<p class="mt-1 text-2xl font-bold text-green-600 dark:text-green-400">{{ $onlineDevices }}</p>
|
||||
</div>
|
||||
<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">Offene Ereignisse</p>
|
||||
<p class="mt-1 text-2xl font-bold text-yellow-600 dark:text-yellow-400">{{ $recentEvents->count() }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Globale Suche --}}
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg p-5">
|
||||
<form method="GET" action="{{ route('network.search') }}" class="flex gap-3">
|
||||
<input type="text" name="q" placeholder="IP-Adresse, MAC, Hostname, Bezeichnung über alle Segmente suchen..."
|
||||
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-5 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition whitespace-nowrap">
|
||||
🔍 Suchen
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{-- Segmente --}}
|
||||
<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 flex items-center justify-between">
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100">Netzwerk-Segmente</h3>
|
||||
<a href="{{ route('network.segments.index') }}" class="text-xs text-indigo-600 hover:underline">Alle verwalten →</a>
|
||||
</div>
|
||||
|
||||
@if($segments->isEmpty())
|
||||
<div class="px-5 py-10 text-center">
|
||||
<p class="text-gray-500 dark:text-gray-400 mb-3">Noch keine Segmente definiert.</p>
|
||||
<a href="{{ route('network.segments.create') }}" style="background-color: var(--color-primary)"
|
||||
class="inline-block px-4 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition">
|
||||
Erstes Segment anlegen
|
||||
</a>
|
||||
</div>
|
||||
@else
|
||||
<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">Name</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Subnetz</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">VLAN</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Letzter Scan</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Online / Gesamt</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Scans</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
@foreach($segments as $segment)
|
||||
@php
|
||||
$lastScan = $latestScans->get($segment->id)?->first();
|
||||
@endphp
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700 transition">
|
||||
<td class="px-4 py-3">
|
||||
<span class="inline-block w-2 h-2 rounded-full {{ $segment->active ? 'bg-green-500' : 'bg-gray-300' }}"></span>
|
||||
</td>
|
||||
<td class="px-4 py-3 font-medium text-gray-900 dark:text-gray-100">
|
||||
<a href="{{ route('network.segments.show', $segment) }}" class="hover:text-indigo-600">
|
||||
{{ $segment->name }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-4 py-3 font-mono text-xs text-gray-600 dark:text-gray-400">{{ $segment->subnet }}</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ $segment->vlan_id ? 'VLAN ' . $segment->vlan_id : '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ $lastScan?->created_at->format('d.m.Y H:i') ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right text-xs">
|
||||
@if($lastScan)
|
||||
<span class="text-green-600 font-medium">{{ $lastScan->online_hosts }}</span>
|
||||
<span class="text-gray-400"> / {{ $lastScan->total_hosts }}</span>
|
||||
@else
|
||||
<span class="text-gray-400">—</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ $segment->scans_count }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Undokumentierte Ereignisse --}}
|
||||
@if($recentEvents->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">
|
||||
Undokumentierte Ereignisse
|
||||
<span class="ml-2 bg-yellow-100 text-yellow-800 text-xs px-2 py-0.5 rounded-full">{{ $recentEvents->count() }}</span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
@foreach($recentEvents as $event)
|
||||
<div class="flex items-center justify-between px-5 py-3">
|
||||
<div class="flex items-center space-x-3">
|
||||
<span class="w-2 h-2 rounded-full flex-shrink-0
|
||||
{{ $event->event_color === 'green' ? 'bg-green-500' :
|
||||
($event->event_color === 'blue' ? 'bg-blue-500' :
|
||||
($event->event_color === 'red' ? 'bg-red-500' : 'bg-yellow-500')) }}">
|
||||
</span>
|
||||
<div>
|
||||
<span class="text-sm font-medium text-gray-900 dark:text-gray-100">{{ $event->event_label }}</span>
|
||||
<span class="text-xs text-gray-400 ml-2">
|
||||
<a href="{{ route('network.device', $event->device) }}" class="hover:text-indigo-600">
|
||||
{{ $event->device->display_name }}
|
||||
</a>
|
||||
· {{ $event->created_at->format('d.m.Y H:i') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ route('network.device', $event->device) }}"
|
||||
class="text-xs text-indigo-600 hover:underline">Detail →</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -1,7 +1,7 @@
|
||||
<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>
|
||||
<a href="{{ route('network.dashboard') }}" 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>
|
||||
@@ -23,6 +23,21 @@
|
||||
<form method="POST" action="{{ route('network.import') }}" enctype="multipart/form-data" class="space-y-5">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<x-input-label for="segment_id" value="Netzwerk-Segment (optional)" />
|
||||
<select id="segment_id" name="segment_id"
|
||||
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">
|
||||
<option value="">— Kein Segment —</option>
|
||||
@foreach($segments as $segment)
|
||||
<option value="{{ $segment->id }}"
|
||||
{{ (request('segment') == $segment->id || old('segment_id') == $segment->id) ? 'selected' : '' }}>
|
||||
{{ $segment->name }} ({{ $segment->subnet }}){{ $segment->vlan_id ? ' · VLAN ' . $segment->vlan_id : '' }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<x-input-error :messages="$errors->get('segment_id')" class="mt-2" />
|
||||
</div>
|
||||
|
||||
<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
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200">Globale Suche</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-8">
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-4">
|
||||
|
||||
<form method="GET" action="{{ route('network.search') }}" class="flex gap-3">
|
||||
<input type="text" name="q" value="{{ $q }}"
|
||||
placeholder="IP-Adresse, MAC, Hostname, Bezeichnung..."
|
||||
autofocus
|
||||
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-5 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition">
|
||||
🔍 Suchen
|
||||
</button>
|
||||
@if($q)
|
||||
<a href="{{ route('network.search') }}"
|
||||
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>
|
||||
|
||||
@if($q && strlen($q) < 2)
|
||||
<p class="text-sm text-gray-500">Mindestens 2 Zeichen eingeben.</p>
|
||||
@elseif($q)
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ $devices->total() }} Ergebnis(se) für „{{ $q }}" über alle Segmente
|
||||
</p>
|
||||
|
||||
<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"></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="w-2 h-2 rounded-full inline-block
|
||||
{{ $device->status === 'online' ? 'bg-green-500' : 'bg-red-400' }}"></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-xs text-gray-600 dark:text-gray-400">{{ $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-xs text-gray-600 dark:text-gray-400">{{ $device->mac_vendor ?? '—' }}</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ $device->last_seen_at?->format('d.m.Y H:i') ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<a href="{{ route('network.device', $device) }}"
|
||||
class="text-xs text-indigo-600 hover:underline">Detail →</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>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,65 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('network.segments.index') }}" class="text-gray-500 hover:text-gray-700">Segmente</a>
|
||||
<span class="text-gray-400">/</span>
|
||||
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200">Neues Segment</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">
|
||||
<form method="POST" action="{{ route('network.segments.store') }}" class="space-y-5">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<x-input-label for="name" value="Name *" />
|
||||
<x-text-input id="name" name="name" type="text" class="mt-1 block w-full"
|
||||
value="{{ old('name') }}" placeholder="z.B. Büro, Server-VLAN, Produktion" required />
|
||||
<x-input-error :messages="$errors->get('name')" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-input-label for="subnet" value="Subnetz *" />
|
||||
<x-text-input id="subnet" name="subnet" type="text" class="mt-1 block w-full font-mono"
|
||||
value="{{ old('subnet') }}" placeholder="z.B. 192.168.1.0/24 oder 10.0.0.0/8" required />
|
||||
<x-input-error :messages="$errors->get('subnet')" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-input-label for="vlan_id" value="VLAN-ID (optional)" />
|
||||
<x-text-input id="vlan_id" name="vlan_id" type="number" class="mt-1 block w-full"
|
||||
value="{{ old('vlan_id') }}" placeholder="z.B. 10" min="1" max="4094" />
|
||||
<x-input-error :messages="$errors->get('vlan_id')" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-input-label for="description" value="Beschreibung (optional)" />
|
||||
<textarea id="description" name="description" rows="2"
|
||||
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="Kurze Beschreibung dieses Segments...">{{ old('description') }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="checkbox" id="active" name="active" value="1"
|
||||
{{ old('active', '1') ? 'checked' : '' }}
|
||||
class="rounded border-gray-300 text-indigo-600 focus:ring-indigo-500" />
|
||||
<label for="active" class="text-sm text-gray-700 dark:text-gray-300">Aktiv (automatisch überwachen)</label>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-3">
|
||||
<a href="{{ route('network.segments.index') }}"
|
||||
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 transition">
|
||||
Abbrechen
|
||||
</a>
|
||||
<button type="submit" style="background-color: var(--color-primary)"
|
||||
class="px-5 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition">
|
||||
Segment anlegen
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,64 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('network.segments.index') }}" class="text-gray-500 hover:text-gray-700">Segmente</a>
|
||||
<span class="text-gray-400">/</span>
|
||||
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200">{{ $segment->name }} bearbeiten</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">
|
||||
<form method="POST" action="{{ route('network.segments.update', $segment) }}" class="space-y-5">
|
||||
@csrf @method('PUT')
|
||||
|
||||
<div>
|
||||
<x-input-label for="name" value="Name *" />
|
||||
<x-text-input id="name" name="name" type="text" class="mt-1 block w-full"
|
||||
value="{{ old('name', $segment->name) }}" required />
|
||||
<x-input-error :messages="$errors->get('name')" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-input-label for="subnet" value="Subnetz *" />
|
||||
<x-text-input id="subnet" name="subnet" type="text" class="mt-1 block w-full font-mono"
|
||||
value="{{ old('subnet', $segment->subnet) }}" required />
|
||||
<x-input-error :messages="$errors->get('subnet')" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-input-label for="vlan_id" value="VLAN-ID (optional)" />
|
||||
<x-text-input id="vlan_id" name="vlan_id" type="number" class="mt-1 block w-full"
|
||||
value="{{ old('vlan_id', $segment->vlan_id) }}" min="1" max="4094" />
|
||||
<x-input-error :messages="$errors->get('vlan_id')" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-input-label for="description" value="Beschreibung (optional)" />
|
||||
<textarea id="description" name="description" rows="2"
|
||||
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">{{ old('description', $segment->description) }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="checkbox" id="active" name="active" value="1"
|
||||
{{ old('active', $segment->active) ? 'checked' : '' }}
|
||||
class="rounded border-gray-300 text-indigo-600 focus:ring-indigo-500" />
|
||||
<label for="active" class="text-sm text-gray-700 dark:text-gray-300">Aktiv</label>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-3">
|
||||
<a href="{{ route('network.segments.index') }}"
|
||||
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 transition">
|
||||
Abbrechen
|
||||
</a>
|
||||
<button type="submit" style="background-color: var(--color-primary)"
|
||||
class="px-5 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition">
|
||||
Speichern
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,77 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('network.dashboard') }}" 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">Segmente</h2>
|
||||
</div>
|
||||
<a href="{{ route('network.segments.create') }}" style="background-color: var(--color-primary)"
|
||||
class="px-4 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition">
|
||||
+ Segment anlegen
|
||||
</a>
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-8">
|
||||
<div class="max-w-5xl mx-auto sm:px-6 lg:px-8">
|
||||
|
||||
@if(session('success'))
|
||||
<div class="mb-4 p-4 bg-green-100 text-green-800 rounded-md">{{ session('success') }}</div>
|
||||
@endif
|
||||
|
||||
<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">Aktiv</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Name</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Subnetz</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">VLAN</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Scans</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Beschreibung</th>
|
||||
<th class="px-4 py-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
@forelse($segments as $segment)
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700 transition">
|
||||
<td class="px-4 py-3">
|
||||
<span class="inline-block w-2.5 h-2.5 rounded-full {{ $segment->active ? 'bg-green-500' : 'bg-gray-300' }}"></span>
|
||||
</td>
|
||||
<td class="px-4 py-3 font-medium text-gray-900 dark:text-gray-100">
|
||||
<a href="{{ route('network.segments.show', $segment) }}" class="hover:text-indigo-600">
|
||||
{{ $segment->name }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-4 py-3 font-mono text-xs text-gray-600 dark:text-gray-400">{{ $segment->subnet }}</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ $segment->vlan_id ? 'VLAN ' . $segment->vlan_id : '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">{{ $segment->scans_count }}</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400 max-w-xs truncate">
|
||||
{{ $segment->description ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right space-x-3">
|
||||
<a href="{{ route('network.segments.edit', $segment) }}"
|
||||
class="text-xs text-indigo-600 hover:underline">Bearbeiten</a>
|
||||
<form method="POST" action="{{ route('network.segments.destroy', $segment) }}"
|
||||
class="inline" onsubmit="return confirm('Segment löschen?')">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="text-xs text-red-500 hover:underline">Löschen</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-4 py-10 text-center text-gray-500">
|
||||
Noch keine Segmente. <a href="{{ route('network.segments.create') }}" class="text-indigo-600 hover:underline">Jetzt anlegen</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,115 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('network.segments.index') }}" class="text-gray-500 hover:text-gray-700">Segmente</a>
|
||||
<span class="text-gray-400">/</span>
|
||||
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200">{{ $segment->name }}</h2>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<a href="{{ route('network.import') }}?segment={{ $segment->id }}"
|
||||
style="background-color: var(--color-primary)"
|
||||
class="px-4 py-2 text-white text-sm font-medium rounded-md hover:opacity-90 transition">
|
||||
+ Scan importieren
|
||||
</a>
|
||||
<a href="{{ route('network.segments.edit', $segment) }}"
|
||||
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 transition">
|
||||
Bearbeiten
|
||||
</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">
|
||||
|
||||
{{-- Segment-Info --}}
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<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">Subnetz</p>
|
||||
<p class="mt-1 font-mono font-bold text-gray-900 dark:text-gray-100">{{ $segment->subnet }}</p>
|
||||
</div>
|
||||
<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">VLAN</p>
|
||||
<p class="mt-1 font-bold text-gray-900 dark:text-gray-100">{{ $segment->vlan_id ? 'VLAN ' . $segment->vlan_id : '—' }}</p>
|
||||
</div>
|
||||
<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">Status</p>
|
||||
<p class="mt-1 font-bold {{ $segment->active ? 'text-green-600' : 'text-gray-400' }}">
|
||||
{{ $segment->active ? 'Aktiv' : 'Inaktiv' }}
|
||||
</p>
|
||||
</div>
|
||||
<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">Scans gesamt</p>
|
||||
<p class="mt-1 font-bold text-gray-900 dark:text-gray-100">{{ $scans->total() }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($latestScan)
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
|
||||
<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">Letzter Scan</p>
|
||||
<p class="mt-1 font-bold text-gray-900 dark:text-gray-100">{{ $latestScan->created_at->format('d.m.Y H:i') }}</p>
|
||||
</div>
|
||||
<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">Online / Gesamt</p>
|
||||
<p class="mt-1 font-bold">
|
||||
<span class="text-green-600">{{ $latestScan->online_hosts }}</span>
|
||||
<span class="text-gray-400"> / {{ $latestScan->total_hosts }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<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">Neue Geräte</p>
|
||||
<p class="mt-1 font-bold text-gray-900 dark:text-gray-100">{{ $latestScan->new_devices }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Scan-Historie --}}
|
||||
<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">Scan-Historie</h3>
|
||||
</div>
|
||||
<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">Datum</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Scanner</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Gesamt</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Online</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Neu</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Geändert</th>
|
||||
<th class="px-4 py-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
@forelse($scans as $scan)
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700 transition">
|
||||
<td class="px-4 py-3 text-gray-700 dark:text-gray-300">{{ $scan->created_at->format('d.m.Y H:i') }}</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">{{ $scan->scanner ?? '—' }}</td>
|
||||
<td class="px-4 py-3 text-right text-gray-700 dark:text-gray-300">{{ $scan->total_hosts }}</td>
|
||||
<td class="px-4 py-3 text-right text-green-600 font-medium">{{ $scan->online_hosts }}</td>
|
||||
<td class="px-4 py-3 text-right text-blue-600">{{ $scan->new_devices }}</td>
|
||||
<td class="px-4 py-3 text-right text-yellow-600">{{ $scan->changed_devices }}</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<a href="{{ route('network.scan', $scan) }}"
|
||||
class="text-xs text-indigo-600 hover:underline">Details →</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-4 py-10 text-center text-gray-500">Noch keine Scans für dieses Segment.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
@if($scans->hasPages())
|
||||
<div class="px-4 py-3 border-t border-gray-200 dark:border-gray-700">
|
||||
{{ $scans->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
Reference in New Issue
Block a user