@extends('layouts.atelier') @section('title', 'Agent ' . $agentToken->name) @section('page-title', 'Agent ' . $agentToken->name) @section('topbar-actions') ← Connecteurs @if($agentToken->active) @endif @endsection @section('content') @php $feedUrl = route('admin.agents.feed', $agentToken); $batPct = null; @endphp
{{-- ══ 1. IDENTITÉ ═══════════════════════════════════════════════════════════ --}}
Identité
Nom {{ $agentToken->name }}
Propriétaire {{ $agentToken->owner?->full_name ?? 'Système' }}
Token {{ substr($agentToken->token, 0, 8) }}…{{ substr($agentToken->token, -4) }}
Dernière IP {{ $agentToken->last_ip ?? '—' }}
Statut @if($agentToken->active) Actif @else Révoqué @endif
{{-- ══ 2. PARTAGE ════════════════════════════════════════════════════════════ --}}
Partage
@if($agentToken->sharedWith->isNotEmpty())
Utilisateurs avec accès :
    @foreach($agentToken->sharedWith as $user)
  • {{ $user->full_name }} ({{ $user->pivot->permission }})
    @csrf @method('DELETE')
  • @endforeach
@else
Agent non partagé — seul le propriétaire y a accès.
@endif
@csrf
@csrf
{{-- ══ 3. ACTIVITÉ (live polling) ═══════════════════════════════════════════ --}}
Activité
@include('admin.agent-activity', [ 'online' => $agentToken->isOnline(), 'lastSeenAt' => $agentToken->last_seen_at, 'lastLogAt' => $agentToken->last_log_at, 'inventoryCount' => $connector?->last_inventory ? count($connector->last_inventory) : 0, 'inventorySyncAt' => $connector?->last_sync_at, ])
{{-- ══ 4. LOG AGENT ═════════════════════════════════════════════════════════ --}}
Log agent ({{ is_array($agentToken->last_agent_log) ? count($agentToken->last_agent_log) : 0 }} lignes)
@if(is_array($agentToken->last_agent_log))
@foreach($agentToken->last_agent_log as $line){{ $line }}
@endforeach
@else—
@endif
{{-- ══ 5. LOG ESL-WORKING ═══════════════════════════════════════════════════ --}}
Log ESL-Working ({{ is_array($agentToken->last_eslworking_log) ? count($agentToken->last_eslworking_log) : 0 }} lignes)
@if(is_array($agentToken->last_eslworking_log))
@foreach($agentToken->last_eslworking_log as $line){{ $line }}
@endforeach
@else—
@endif
@endsection @section('scripts') @endsection