@extends('layouts.atelier')
@section('title', 'Connecteurs ESL')
@section('page-title', 'Connecteurs & Agents')
@section('content')
{{-- ═══════════════════════════════════════════════════════════════
AGENTS LOCAUX
═══════════════════════════════════════════════════════════════ --}}
Agents locaux
{{-- ── Formulaire création ── --}}
{{-- ── Liste agents ── --}}
@forelse($agents as $agent)
{{-- En-tête --}}
Propriétaire : {{ $agent->owner?->full_name ?? 'Système' }}
@if($agent->isOnline())
· En ligne
@else
· Hors ligne
@endif
{{-- Connecteurs par marque --}}
@php $brands = ['hanshow' => 'Hanshow', 'vusion' => 'SES-imagotag', 'pricer' => 'Pricer']; @endphp
@foreach($brands as $brandKey => $brandLabel)
@php $conn = $agent->eslConnectors->firstWhere('brand', $brandKey); @endphp
@if($conn)
{{-- Résumé --}}
{{ $brandLabel }}
⚙
@php
$invCount = $conn->esl_count ?? 0;
$syncAgo = $conn->last_sync_at ? $conn->last_sync_at->diffForHumans() : null;
@endphp
{{ $invCount }}
ESL{{ $invCount > 1 ? 's' : '' }}
@if($invCount > 0)
✓
@else
⚪
@endif
@if($syncAgo)
Sync : {{ $syncAgo }}
@else
Jamais synchronisé
@endif
@if($invCount > 0)
Voir l'inventaire →
@endif
{{-- Config (caché) --}}
@else
{{-- Pas de connecteur — bouton créer --}}
{{ $brandLabel }}
—
@endif
@endforeach
{{-- Pied --}}
Dernier contact :
{{ $agent->last_seen_at ? $agent->last_seen_at->diffForHumans() : 'Jamais' }}
@if($agent->last_ip)
· IP : {{ $agent->last_ip }}
@endif
Voir fiche agent →
@empty
Aucun agent configuré. Créez un token pour votre agent local.
@endforelse
@endsection