@extends('layouts.atelier') @section('title', 'Inventaire ESL') @section('page-title', 'Inventaire ESL') @php $brand = $brand ?? 'hanshow'; @endphp @section('topbar-actions') @if(isset($connector) && $connector) @if($brand === 'hanshow') AP : {{ $connector->eslworking_url }} @else Serveur : {{ $connector->apiproxy_url ?? $connector->eslworking_url }} @endif @endif @endsection @section('content') {{-- Agent actif --}} @if($activeAgent)
Agent : {{ $activeAgent->name }}
@endif {{-- Tabs marque --}}
Hanshow SES-imagotag
{{-- Sélecteur connecteur (uniquement si > 1) --}} @if(isset($connectors) && (is_array($connectors) ? count($connectors) : $connectors->count()) > 1)
@endif {{-- Erreur --}} @if(!empty($error))
{{ $error }}
@endif @php $isPaginator = $esls instanceof \Illuminate\Contracts\Pagination\Paginator; @endphp @if(!empty($esls)) {{-- Barre de contrôles --}}
{{-- Filtres rapides --}}
@if($brand === 'hanshow') @endif
{{-- Compteur + bouton reset --}} 0 sélectionnée(s)
{{-- Tableau --}}
@if($brand === 'hanshow') @else @endif @foreach($esls as $esl) @php $isOnline = ($esl['status'] ?? '') === 'online'; $lastHbIso = null; if ($brand === 'hanshow') { $batPct = isset($esl['battery']) ? \App\Services\ESL\LabelInfo::rawToPercent((int)$esl['battery']) : null; $lastHbMs = isset($esl['last_hb_time']) ? (int)$esl['last_hb_time'] : null; $lastHbIso = $lastHbMs ? \Carbon\Carbon::createFromTimestampMs($lastHbMs)->toIso8601String() : null; } else { $batPct = null; // Vusion PowerStatus est du texte (OK/UNKNOWN/LOW), pas un pourcentage $lastTs = isset($esl['last_contact']) ? strtotime($esl['last_contact']) : null; $lastHbIso = $lastTs ? date('c', $lastTs) : null; } @endphp @if($brand === 'hanshow') @else @endif @endforeach
ID étiquette Statut BatterieTemplate Succès Échecs Dernier contact Temp.Firmware Type RSSI Dernier contact Dernière tâcheActions
{{ $esl['esl_id'] }} @if($isOnline) online @else offline @endif @include('partials.battery-icon', ['pct' => $batPct]) @php $isReset = str_starts_with($esl['template'] ?? '', 'RESET_'); @endphp @if($isReset) RESET @else Autre @endif {{ $esl['success_rate'] ?? '—' }} {{ $esl['failed_times'] ?? 0 }} @if($lastHbIso) {{ \Carbon\Carbon::createFromTimestampMs((int)$esl['last_hb_time'])->diffForHumans() }} @else — @endif @if(isset($esl['temperature']) && $esl['temperature'] > 0) {{ $esl['temperature'] }}°C @else — @endif {{ $esl['firmware'] ?? '—' }} {{ $esl['screen_size'] ?? '—' }} {{ $esl['rssi'] ?? '—' }} @if($lastHbIso) {{ \Carbon\Carbon::parse($esl['last_contact'])->diffForHumans() }} @else — @endif @php $taskStatus = $esl['last_task_status'] ?? ''; @endphp @if($taskStatus === 'SUCCESSFUL') {{ $esl['last_task_type'] ?? 'OK' }} @elseif($taskStatus === 'FAILED') Échec @else @endif @if($brand === 'hanshow')
@else @endif
@if($isPaginator && $esls->hasPages())
{{ $esls->links() }}
@endif @elseif(empty($error))
Aucune étiquette enregistrée.
@endif @endsection