v0.9.0: no-MAC device tracking, IP-change dashboard, extended search

This commit is contained in:
2026-07-02 20:37:57 +02:00
parent 9fa20af87a
commit 85118c5bcc
23 changed files with 1703 additions and 48 deletions
+97 -4
View File
@@ -1,9 +1,25 @@
<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 class="flex items-center justify-between">
<div class="flex items-center space-x-2">
@if($scan->segment)
<a href="{{ route('network.segments.show', $scan->segment) }}" class="text-gray-500 hover:text-gray-700">{{ $scan->segment->name }}</a>
<span class="text-gray-400">/</span>
@endif
<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>
@if($scan->segment)
<div class="flex gap-2">
<a href="{{ route('network.segments.export.xlsx', $scan->segment) }}"
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">
📊 Excel
</a>
<a href="{{ route('network.segments.export.pdf', $scan->segment) }}"
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">
📄 PDF
</a>
</div>
@endif
</div>
</x-slot>
@@ -32,6 +48,7 @@
<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>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Bemerkung</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
@@ -54,6 +71,25 @@
<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>
<td class="px-4 py-2 min-w-48">
@if($scan->segment_id)
<div class="note-cell" data-ip="{{ $host->ip_address }}">
<span class="note-display text-xs text-gray-600 dark:text-gray-400 cursor-pointer hover:text-indigo-600 italic"
title="Klicken zum Bearbeiten">
{{ $notes[$host->ip_address] ?? '+ Bemerkung' }}
</span>
<div class="note-form hidden flex gap-1 items-center">
<input type="text" maxlength="500"
class="note-input flex-1 text-xs border border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 rounded px-2 py-1 focus:ring-indigo-500 focus:border-indigo-500"
value="{{ $notes[$host->ip_address] ?? '' }}" />
<button class="note-save text-xs px-2 py-1 rounded text-white" style="background-color: var(--color-primary)"></button>
<button class="note-cancel text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-400"></button>
</div>
</div>
@else
<span class="text-xs text-gray-300"></span>
@endif
</td>
</tr>
@endforeach
</tbody>
@@ -61,4 +97,61 @@
</div>
</div>
</div>
@if($scan->segment_id)
<script>
(function() {
const saveUrl = '{{ route('network.segments.ip-notes', $scan->segment_id) }}';
const csrfToken = '{{ csrf_token() }}';
document.querySelectorAll('.note-cell').forEach(function(cell) {
const ip = cell.dataset.ip;
const display = cell.querySelector('.note-display');
const form = cell.querySelector('.note-form');
const input = cell.querySelector('.note-input');
const save = cell.querySelector('.note-save');
const cancel = cell.querySelector('.note-cancel');
display.addEventListener('click', function() {
display.classList.add('hidden');
form.classList.remove('hidden');
input.focus();
});
cancel.addEventListener('click', function() {
form.classList.add('hidden');
display.classList.remove('hidden');
});
save.addEventListener('click', function() {
fetch(saveUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': csrfToken,
'Accept': 'application/json',
},
body: JSON.stringify({ ip_address: ip, note: input.value }),
})
.then(r => r.json())
.then(function(data) {
if (data.ok) {
display.textContent = input.value || '+ Bemerkung';
form.classList.add('hidden');
display.classList.remove('hidden');
}
})
.catch(function() {
alert('Fehler beim Speichern.');
});
});
input.addEventListener('keydown', function(e) {
if (e.key === 'Enter') save.click();
if (e.key === 'Escape') cancel.click();
});
});
})();
</script>
@endif
</x-app-layout>