@extends('layouts.master') @section('title', 'Hotspots') @section('main-content') @use('Illuminate\Support\Facades\Storage')
Hotspots Cadastrados
@if(request('search')) @endif
@forelse($hotspots as $index => $hotspot) @empty @endforelse
# Serial Marca Modelo Franquia Cliente Situação Última Atividade IP VPN * Ações
{{ ($hotspots->currentPage() - 1) * $hotspots->perPage() + $index + 1 }} {{ $hotspot->serial }} @if($hotspot->status == 1) @endif {{ $hotspot->marca }} {{ $hotspot->modelo }} @if($hotspot->franquia) {{ $hotspot->franquia->name }} @else Não definida @endif @if($hotspot->cliente) {{ $hotspot->cliente->name }} @else Não definido @endif @php $situacaoConfig = [ 'estoque' => ['icon' => '📦', 'text' => 'Estoque', 'class' => 'secondary'], 'em_transito' => ['icon' => '🚚', 'text' => 'Em Trânsito', 'class' => 'info'], 'aguardando_instalacao' => ['icon' => '⏳', 'text' => 'Aguardando', 'class' => 'warning'], 'instalado' => ['icon' => '✅', 'text' => 'Instalado', 'class' => 'success'], 'manutencao' => ['icon' => '🔧', 'text' => 'Manutenção', 'class' => 'warning'], 'desativado' => ['icon' => '❌', 'text' => 'Desativado', 'class' => 'danger'], ]; $currentSituacao = $hotspot->situacao ?? 'instalado'; @endphp @if($hotspot->last_activity_at) {{ $hotspot->last_activity_at->format('d/m/Y H:i') }} @else Sem registro @endif @if($hotspot->vpn_ip) {{ $hotspot->vpn_ip }} @else Não configurado @endif @if($hotspot->last_activity_at) @php $diffInHours = $hotspot->last_activity_at->diffInHours(now()); // Definir classe e ícone baseado no tempo $statusClass = match(true) { $diffInHours < 1 => 'success', // < 1h - Verde $diffInHours < 24 => 'info', // < 24h - Azul $diffInHours < 72 => 'warning', // < 72h - Laranja default => 'danger' // > 72h - Vermelho }; $statusText = match(true) { $diffInHours < 1 => 'Ativo agora', $diffInHours < 24 => 'Ativo hoje', $diffInHours < 72 => 'Atenção', default => 'Inativo' }; @endphp @else @endif @if($hotspot->status == 0) @else @endif
Nenhum hotspot encontrado.
@if ($hotspots->hasPages()) @endif
@endsection @push('styles') @endpush @push('scripts') @endpush