@extends('layouts.admin') @section('title', __('admin.live.title')) @section('content')

{{ __('admin.live.title') }}

{{ __('admin.live.subtitle') }}

@csrf
{{ __('admin.live.fresh') }}{{ $counts['fresh'] }}
{{ __('admin.live.stale') }}{{ $counts['stale'] }}
{{ __('admin.live.expired') }}{{ $counts['expired'] }}
{{ __('admin.live.unavailable') }}{{ $counts['unavailable'] }}

{{ __('admin.live_sync.title') }}

{{ __('admin.live_sync.help') }}

@if($syncProviders->isEmpty())
{{ __('admin.live_sync.no_providers') }}
@else
@foreach($syncProviders as $provider) @php($lastRun = $provider->live_sync_last_run) @endforeach
{{ __('admin.providers.title') }} {{ __('admin.labels.connector') }} {{ __('admin.live_sync.interval') }} {{ __('admin.live_sync.readiness') }} {{ __('admin.live_sync.last_sync') }} {{ __('admin.live_sync.next_sync') }}
{{ $provider->name }} {{ __('admin.options.connector.'.$provider->connector_key) }} {{ $provider->live_sync_interval }} s @if(!$provider->live_sync_supported) {{ __('admin.live_sync.unsupported') }} @elseif($lastRun?->status === 'running') {{ __('admin.live_sync.running') }} @elseif($provider->live_sync_due) {{ __('admin.live_sync.due') }} @else {{ __('admin.live_sync.scheduled') }} @endif @if($lastRun) {{ __('admin.options.connector_run_status.'.$lastRun->status) }} {{ $lastRun->started_at?->format('d/m/Y H:i:s') }} @else — @endif @if(!$provider->live_sync_supported) — @elseif($provider->live_sync_due) {{ __('admin.live_sync.now') }} @else {{ $provider->live_sync_next_due_at?->format('d/m/Y H:i:s') ?? '—' }} @endif
@endif
{{ __('admin.live_sync.worker_help') }} php artisan schedule:work php artisan queue:work --queue=live,default

{{ __('admin.live.current_states') }}

{{ __('admin.live.current_states_help') }}

@if($states->isEmpty())
{{ __('admin.live.empty') }}
@else
@foreach($states as $state) @endforeach
{{ __('admin.labels.attraction') }} {{ __('admin.labels.park') }} {{ __('admin.live.status') }} {{ __('admin.live.wait') }} {{ __('admin.live.freshness') }} {{ __('admin.live.source') }} {{ __('admin.live.observed_at') }}
{{ $state->attraction->name }} {{ $state->attraction->park?->name ?? '—' }} {{ __('admin.live_status.'.$state->status) }} {{ $state->wait_minutes !== null ? $state->wait_minutes.' min' : '—' }} {{ __('admin.live_freshness.'.$state->freshness_label) }} {{ $state->source?->name ?? $state->provider?->name ?? '—' }} {{ $state->observed_at?->format('d/m/Y H:i:s') ?? '—' }}
@endif
@endsection