@php use App\Services\Monitoring\ScheduledTaskStatus; /** @var \App\Services\Monitoring\CountryHealth $health */ /** @var string $countryName */ /** @var list $tasks */ /** @var bool $schedulerAlive */ /** @var ?\Carbon\CarbonInterface $schedulerHeartbeat */ /** @var ?\App\Services\Monitoring\UpcomingCompanyLaunch $nextCompanyLaunch */ /** @var list<\App\Services\Monitoring\RecentCompanyLaunch> $recentCompanyLaunches */ /** @var list<\App\Services\Monitoring\OperationalMetric> $operations */ $isOk = $health->isOk(); $criticalCnt = count($health->criticalSignals()); $stateStyles = [ ScheduledTaskStatus::STATE_RUNNING => ['run', __('monitoring.scheduler.state_running')], ScheduledTaskStatus::LAST_OK => ['ok', __('monitoring.scheduler.state_ok')], ScheduledTaskStatus::LAST_STALE => ['warn', __('monitoring.scheduler.state_stale')], ScheduledTaskStatus::LAST_FAILED => ['crit', __('monitoring.scheduler.state_failed')], ScheduledTaskStatus::LAST_UNKNOWN => ['neut', __('monitoring.scheduler.state_unknown')], ]; $runningCount = count(array_filter($tasks, fn (ScheduledTaskStatus $task) => $task->isRunning)); @endphp
{{ $countryName }}
{{ __('monitoring.legend_ok') }} {{ __('monitoring.legend_critical') }}
{{ __('monitoring.country_state') }} @if($isOk) {{ __('monitoring.state_ok') }} @else {{ __('monitoring.state_critical') }} @endif
{{ $isOk ? __('monitoring.state_ok') : __('monitoring.state_critical') }}
@if($isOk) {{ __('monitoring.state_ok_desc') }} @else {{ $criticalCnt }} {{ __('monitoring.state_critical_desc') }} @endif
    @foreach($health->signals as $signal) @php $sevOk = $signal->isOk(); @endphp
  • {{ __('monitoring.' . $signal->key) }}
    @if(! $signal->hasData()) {{ __('monitoring.act_no_data') }} @elseif($signal->isPartial()) {{ __('monitoring.act_partial') }} ({{ count($signal->failedItems()) }} {{ __('monitoring.act_partial_desc', ['total' => count($signal->items)]) }}) · {{ $signal->lastRunAt->diffForHumans() }} @elseif($sevOk) {{ __('monitoring.act_last') }} {{ $signal->lastRunAt->diffForHumans() }} @else {{ __('monitoring.act_not_run') }} {{ __('monitoring.hours_short', ['count' => $signal->hoursSince]) }} @endif · {{ __('monitoring.act_next') }} {{ $signal->nextRunAt->diffForHumans(['parts' => 2]) }} ({{ $signal->nextRunAt->format('H:i') }})
    @if(! $sevOk && $signal->items !== [])
      @foreach($signal->items as $item)
    • {{ $item['label'] }} — {{ $item['statusLabel'] }} @if($item['reason'])
      {{ $item['reason'] }}
      @endif
    • @endforeach
    @endif
  • @endforeach
{{ __('monitoring.updated_at') }} {{ now()->format('H:i') }}
{{ __('monitoring.companies.next_title') }} @if($nextCompanyLaunch) {{ $nextCompanyLaunch->isOneOff ? __('monitoring.companies.one_off') : __('monitoring.companies.recurring') }} @endif
@if($nextCompanyLaunch) {{-- Keyed on the target so a poll that brings a different launch replaces the element and restarts the countdown, instead of morphing it and leaving Alpine counting down to the launch that already fired. --}} {{-- Keyed on the target so a poll that brings a different launch replaces the element and restarts the countdown, instead of morphing it and leaving Alpine counting down to the launch that already fired. The server-rendered countdown inside is what shows before Alpine takes over. --}}
{{ $nextCompanyLaunch->countdown() }}
{{ $nextCompanyLaunch->companyName }}
{{ $nextCompanyLaunch->actionTitle }}
{{ __('monitoring.companies.scheduled_for') }} {{ $nextCompanyLaunch->scheduledAt->isoFormat('D MMMM, HH:mm') }}
@else
{{ __('monitoring.companies.next_none') }}
{{ __('monitoring.companies.next_none_desc') }}
@endif
{{ __('monitoring.updated_at') }} {{ now()->format('H:i') }}
@foreach($operations as $metric)
{{ __('monitoring.operations.' . $metric->key) }}
{{ $metric->formattedValue() }}
@if($metric->hasValue())
{{ $metric->caption }}
@else
{{ $metric->unavailableReason }}
@endif
@endforeach
{{ __('monitoring.scheduler.title') }}
{{ __('monitoring.scheduler.tasks_count') }}: {{ count($tasks) }} {{ __('monitoring.scheduler.running_count') }}: {{ $runningCount }} @if($schedulerAlive) {{ __('monitoring.scheduler.alive') }} @else {{ __('monitoring.scheduler.dead') }} @endif @if($schedulerHeartbeat) {{ __('monitoring.scheduler.heartbeat') }} {{ $schedulerHeartbeat->diffForHumans(['parts' => 2]) }} @else {{ __('monitoring.scheduler.heartbeat_never') }} @endif
@foreach($tasks as $task) @php [$stateClass, $stateLabel] = $stateStyles[$task->state()]; @endphp @endforeach
{{ __('monitoring.scheduler.th_status') }} {{ __('monitoring.scheduler.th_command') }} {{ __('monitoring.scheduler.th_schedule') }} {{ __('monitoring.scheduler.th_last') }} {{ __('monitoring.scheduler.th_next') }}
isRunning && $task->withoutOverlappingMinutes) title="{{ __('monitoring.scheduler.overlap_lock', ['count' => $task->withoutOverlappingMinutes]) }}" @endif> {{ $stateLabel }}
{{ $task->title }}
@if($task->description)
{{ $task->description }}
@endif
{{ $task->humanSchedule }}
{{ $task->expression }}
@if($task->hasLastRunData())
{{ $task->lastRunAt->diffForHumans(['parts' => 2]) }}
{{ $task->lastRunAt->format('d.m H:i') }} @if($task->lastRunDurationSeconds !== null) · {{ __('monitoring.scheduler.duration', ['count' => $task->lastRunDurationSeconds]) }} @endif
@else
{{ __('monitoring.scheduler.no_data') }}
{{ __('monitoring.scheduler.expected') }} {{ $task->expectedPreviousRunAt->format('d.m H:i') }}
@endif
{{ $task->nextRunAt->diffForHumans(['parts' => 2]) }}
{{ $task->nextRunAt->format('d.m H:i') }}
{{ __('monitoring.scheduler.note') }}
{{ __('monitoring.companies.recent_title') }} {{ __('monitoring.companies.recent_all') }} →
@if($recentCompanyLaunches === [])
{{ __('monitoring.companies.recent_none') }}
@else
@foreach($recentCompanyLaunches as $launch) @endforeach
{{ __('monitoring.companies.th_status') }} {{ __('monitoring.companies.th_company') }} {{ __('monitoring.companies.th_action') }} {{ __('monitoring.companies.th_clients') }} {{ __('monitoring.companies.th_started') }}
{{ $launch->statusLabel }} {{ $launch->companyName }} @if($launch->hasFailed() && $launch->errorReason)
{{ $launch->errorReason }}
@endif
{{ $launch->actionTitle }}
{{ $launch->clientsCount ?? __('monitoring.companies.no_clients') }}
{{ $launch->startedAt->diffForHumans(['parts' => 2]) }}
{{ $launch->startedAt->format('d.m H:i') }}
@endif