@php $servers = $panoramica['servers'] ?? []; $nomiServer = array_column($servers, 'name', 'hostname'); $onlinePerServer = $this->onlinePerServer; $onlineTotale = count($onlineUsers); $onlineSconosciuti = $onlineTotale - array_sum(array_intersect_key($onlinePerServer, $nomiServer)); $ideale = (float) ($panoramica['carico_ideale_percentuale'] ?? 0); $percento = fn (float|int $valore): string => number_format((float) $valore, 0, ',', '.') . '%'; $piuCarico = collect($servers)->sortByDesc('quota_carico')->first(); $sbilanciato = ($panoramica['sbilanciamento'] ?? 0) > 10; $senzaDati = collect($servers)->sum('richieste_7g') === 0; $passaFiltro = fn (?string $server): bool => match ($filtroServer) { '' => true, '__sconosciuto__' => $server === null || !isset($nomiServer[$server]), default => $server === $filtroServer, }; $onlineFiltrati = array_filter($onlineUsers, fn (array $utente): bool => $passaFiltro($utente['current_server'])); $topFiltrati = array_filter($panoramica['top_utenti'] ?? [], fn (array $utente): bool => $passaFiltro($utente['server_effettivo'])); @endphp
Online in totale: {{ $onlineTotale }}. Senza restrizione di server: {{ $panoramica['senza_restrizione']['totale'] }} utenti, {{ $panoramica['senza_restrizione']['attivi_7g'] }} attivi negli ultimi 7 giorni. @if($onlineSconosciuti > 0) Online su server sconosciuto: {{ $onlineSconosciuti }}. @endif
{{-- 3. Andamento: i dati si aggiornano al reload della pagina --}}Nessuno spostamento suggerito.
@else| Utente | Richieste 7 giorni | Da → a | @can('edit-users')Azione | @endcan
|---|---|---|---|
|
{{ $mossa['name'] }} {{ $mossa['email'] }} |
{{ number_format($mossa['richieste'], 0, ',', '.') }} | {{ $nomiServer[$mossa['da']] ?? $mossa['da'] }} → {{ $nomiServer[$mossa['a']] ?? $mossa['a'] }} | @can('edit-users')@endcan |
Nessun utente online.
@else| Utente | Su quale server è | Server assegnato | IP | Ultima attività | Azioni |
|---|---|---|---|---|---|
|
{{ $utente['name'] }} {{ $utente['email'] }} |
{{ $utente['current_server_name'] ?? 'Sconosciuto' }} | {{ $utente['server_name'] }} @if($utente['fuori_posto']) fuori posto @endif | {{ $utente['ip_address'] }} |
{{ $utente['last_activity']->diffForHumans() }} {{ $utente['last_activity']->format('H:i:s') }} |
Nessun utente da mostrare.
@else| Utente | Richieste | Server effettivo | Server assegnato |
|---|---|---|---|
|
{{ $utente['name'] }} {{ $utente['email'] }} |
{{ number_format($utente['richieste'], 0, ',', '.') }} | {{ $nomiServer[$utente['server_effettivo']] ?? $utente['server_effettivo'] ?? 'Sconosciuto' }} | @can('edit-users') @else {{ $utente['assigned_server'] === null ? 'Nessuna restrizione' : ($nomiServer[$utente['assigned_server']] ?? $utente['assigned_server']) }} @endcan |
Aggiornamento automatico ogni {{ $refreshInterval }} secondi