Files

78 lines
5.0 KiB
PHP

<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>