v0.9.0: no-MAC device tracking, IP-change dashboard, extended search
This commit is contained in:
@@ -6,14 +6,37 @@
|
||||
<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">
|
||||
<div class="flex gap-2 items-center">
|
||||
{{-- Auto-Refresh Indikator --}}
|
||||
<span id="refresh-indicator" class="text-xs text-gray-400 dark:text-gray-500 hidden">
|
||||
↻ wird aktualisiert...
|
||||
</span>
|
||||
|
||||
{{-- Jetzt scannen --}}
|
||||
@if($segment->active)
|
||||
<form method="POST" action="{{ route('network.segments.scan', $segment) }}">
|
||||
@csrf
|
||||
<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">
|
||||
▶ Jetzt scannen
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
<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
|
||||
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">
|
||||
⬆ Import
|
||||
</a>
|
||||
<a href="{{ route('network.segments.export.xlsx', $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 dark:hover:bg-gray-700 transition">
|
||||
📊 Excel
|
||||
</a>
|
||||
<a href="{{ route('network.segments.export.pdf', $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 dark:hover:bg-gray-700 transition">
|
||||
📄 PDF
|
||||
</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">
|
||||
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">
|
||||
Bearbeiten
|
||||
</a>
|
||||
</div>
|
||||
@@ -39,6 +62,12 @@
|
||||
{{ $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">Auto-Scan</p>
|
||||
<p class="mt-1 font-bold text-gray-900 dark:text-gray-100 text-sm">
|
||||
{{ $segment->scan_interval_label }}
|
||||
</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>
|
||||
@@ -70,6 +99,7 @@
|
||||
<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>
|
||||
<div data-scan-count="{{ $scans->total() }}"></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>
|
||||
@@ -112,4 +142,33 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(session('success') && str_contains(session('success'), 'gestartet'))
|
||||
{{-- Auto-Refresh nach "Jetzt scannen": alle 10s prüfen ob neuer Scan vorliegt --}}
|
||||
<script>
|
||||
(function() {
|
||||
const currentScanCount = {{ $scans->total() }};
|
||||
const indicator = document.getElementById('refresh-indicator');
|
||||
let checks = 0;
|
||||
|
||||
const interval = setInterval(function() {
|
||||
if (++checks > 18) { clearInterval(interval); return; } // max 3 Min
|
||||
if (indicator) indicator.classList.remove('hidden');
|
||||
|
||||
fetch(window.location.href, { headers: { 'X-Requested-With': 'XMLHttpRequest' } })
|
||||
.then(r => r.text())
|
||||
.then(html => {
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(html, 'text/html');
|
||||
const newCount = parseInt(doc.querySelector('[data-scan-count]')?.dataset?.scanCount || '0');
|
||||
if (newCount > currentScanCount) {
|
||||
clearInterval(interval);
|
||||
window.location.reload();
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}, 10000);
|
||||
})();
|
||||
</script>
|
||||
@endif
|
||||
</x-app-layout>
|
||||
|
||||
Reference in New Issue
Block a user