@extends('layouts.admin') @section('title', 'AIR Jobs') @section('header', 'AIR Processing Jobs') @section('content') @if(isset($apiError))

API Estair indisponible

{{ $apiError }}

@endif @if(!empty($stats))
Total
{{ number_format($stats['total'] ?? 0) }}
Termines
{{ number_format($stats['by_status']['completed'] ?? 0) }}
Echecs
{{ number_format($stats['by_status']['failed'] ?? 0) }}
En cours
{{ number_format( ($stats['by_status']['parsing'] ?? 0) + ($stats['by_status']['converting'] ?? 0) + ($stats['by_status']['inserting'] ?? 0) ) }}
@if(!empty($stats['performance']))

Performance moyenne

Parse
{{ number_format(($stats['performance']['avg_parse_duration_ms'] ?? 0) / 1000, 2) }}s
Convert
{{ number_format(($stats['performance']['avg_convert_duration_ms'] ?? 0) / 1000, 2) }}s
Insert
{{ number_format(($stats['performance']['avg_insert_duration_ms'] ?? 0) / 1000, 2) }}s
@endif @endif
@forelse($jobs as $job) @php $status = $job['status'] ?? 'UNKNOWN'; $statusClass = match($status) { 'COMPLETED' => 'bg-green-100 text-green-800', 'PENDING' => 'bg-yellow-100 text-yellow-800', 'PARSING', 'CONVERTING', 'INSERTING' => 'bg-blue-100 text-blue-800', 'PARSED', 'CONVERTED' => 'bg-indigo-100 text-indigo-800', 'PARSE_FAILED', 'CONVERT_FAILED', 'INSERT_FAILED' => 'bg-red-100 text-red-800', 'CANCELLED' => 'bg-gray-100 text-gray-800', 'QUARANTINE' => 'bg-red-100 text-red-800', default => 'bg-gray-100 text-gray-800', }; $statusLabel = match($status) { 'PENDING' => 'En attente', 'PARSING' => 'Parsing...', 'PARSED' => 'Parse', 'PARSE_FAILED' => 'Echec Parse', 'CONVERTING' => 'Conversion...', 'CONVERTED' => 'Converti', 'CONVERT_FAILED' => 'Echec Convert', 'INSERTING' => 'Insertion...', 'COMPLETED' => 'Termine', 'INSERT_FAILED' => 'Echec Insert', 'CANCELLED' => 'Annule', 'QUARANTINE' => 'Quarantaine', default => $status, }; @endphp @empty @endforelse
Fichier Type Statut Progression Duree Insertions Date Actions
{{ $job['file_name'] ?? '-' }} {{ $job['file_type'] ?? '-' }} {{ $statusLabel }} {{ $job['progress_percentage'] ?? 0 }}% @if(isset($job['durations']['total_ms']) && $job['durations']['total_ms']) {{ number_format($job['durations']['total_ms'] / 1000, 2) }}s @else - @endif {{ number_format($job['insertions']['total'] ?? 0) }} {{ isset($job['created_at']) ? date('d/m/Y H:i', strtotime($job['created_at'])) : '-' }}
@if($job['retry']['can_retry'] ?? false)
@csrf
@endif
{{ isset($apiError) ? 'API indisponible' : 'Aucun job AIR trouve' }}
@if(!empty($pagination) && ($pagination['total'] ?? 0) > ($pagination['per_page'] ?? 20)) @php $currentPage = $pagination['current_page'] ?? 1; $lastPage = ceil(($pagination['total'] ?? 0) / ($pagination['per_page'] ?? 20)); @endphp
{{ number_format($pagination['total'] ?? 0) }} resultat(s)
@if($currentPage > 1) @endif @for($i = max(1, $currentPage - 2); $i <= min($lastPage, $currentPage + 2); $i++) {{ $i }} @endfor @if($currentPage < $lastPage) @endif
@endif
@endsection