@extends('admin.layouts.app')
@section('title', __('admin.sync.show_title') . ' #' . $run->id . ' — ' . __('admin.brand.name'))
@section('page_title', __('admin.sync.show_title'))
@php
$dash = '—';
$fmt = function ($ts) use ($dash) {
if (!$ts) return $dash;
return \Illuminate\Support\Carbon::parse($ts)->format('Y-m-d H:i:s');
};
$rel = function ($ts) use ($dash) {
if (!$ts) return $dash;
return \Illuminate\Support\Carbon::parse($ts)->diffForHumans();
};
$stats = $run->stats ?? [];
$errors = $run->error_messages ?? [];
$statusColors = [
'pending' => '#92400e',
'running' => '#1e40af',
'succeeded' => '#166534',
'partial' => '#9a3412',
'failed' => '#991b1b',
];
$statusBg = [
'pending' => '#fef3c7',
'running' => '#dbeafe',
'succeeded' => '#dcfce7',
'partial' => '#fed7aa',
'failed' => '#fee2e2',
];
@endphp
{{-- Alpine.js is already loaded by admin.layouts.app — loading it again
would double-bind every directive on this page. --}}
@push('styles')
@endpush
@section('content')
{{ __('admin.sync.fields.processed') }}
isActive()) x-text="liveStats.items_processed" @endif>{{ number_format($run->items_processed) }}
{{ __('admin.sync.fields.upserted') }}
isActive()) x-text="liveStats.items_upserted" @endif>{{ number_format($run->items_upserted) }}
{{ __('admin.sync.fields.errored') }}
isActive()) x-text="liveStats.items_errored" @endif> {{ number_format($run->items_errored) }}
{{ __('admin.sync.fields.duration') }}
@if ($run->durationSeconds() !== null) {{ $run->durationSeconds() }}s @else {{ $dash }} @endif
{{ str_replace('_', ' ', $k) }}
{{ number_format($stats[$k]) }}
{{ json_encode($stats, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}