Files
Network-MGMT/resources/views/network/search.blade.php
T

91 lines
5.6 KiB
PHP

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