{{-- The public status page. Built to the shape every status page a customer has ever read uses, because that shape is a convention and a convention is what lets somebody find the answer without being taught the page: banner, components with a ninety-day bar, then the written record underneath. It used to be a self-contained page with its own stylesheet, on the theory that it should survive a broken asset build. It does not buy that: if the stylesheet cannot be served, the application serving this page is already failing, and mid-deployment the whole site answers with the maintenance page. What it did buy was a third design nobody maintained. It draws from the shared tokens now, and carries the site's own header and footer so the reader can get back. Every figure comes from a record. A day nobody sampled is drawn as a gap, never as green. --}} @php use App\Models\Incident; $tone = [ 'operational' => ['dot' => 'bg-success-bright', 'text' => 'text-success', 'bar' => 'bg-success-bright'], 'degraded' => ['dot' => 'bg-warning', 'text' => 'text-warning', 'bar' => 'bg-warning'], 'down' => ['dot' => 'bg-danger', 'text' => 'text-danger', 'bar' => 'bg-danger'], 'unknown' => ['dot' => 'bg-faint', 'text' => 'text-muted', 'bar' => 'bg-line-strong'], ]; $banner = [ 'operational' => ['bg' => 'bg-success-bg border-success-border', 'icon' => 'check', 'text' => 'text-success'], 'degraded' => ['bg' => 'bg-warning-bg border-warning-border', 'icon' => 'alert-triangle', 'text' => 'text-warning'], 'down' => ['bg' => 'bg-danger-bg border-danger-border', 'icon' => 'alert-triangle', 'text' => 'text-danger'], 'unknown' => ['bg' => 'bg-surface-2 border-line-strong', 'icon' => 'alert-triangle', 'text' => 'text-muted'], ][$overall]; @endphp
{{-- ── The one sentence somebody came for ───────────────────────────── --}}

{{ __('status.page.title') }}

{{ __("status.overall.{$overall}") }}

{{ __('status.page.checked_at', ['time' => $checkedAt->local()->isoFormat('DD.MM.YYYY, HH:mm')]) }} · {{ __('status.page.timezone', ['zone' => config('app.display_timezone')]) }}

{{-- ── Announced work ───────────────────────────────────────────────── --}} @if ($maintenance->isNotEmpty())

{{ __('status.maintenance.heading') }}

@foreach ($maintenance as $window) @php $live = $window->derivedState() === 'active'; @endphp
{{ $window->title }} {{ $live ? __('status.maintenance.active') : __('status.maintenance.upcoming') }}

{{ __('status.maintenance.window', [ 'from' => $window->starts_at->local()->isoFormat('DD.MM. HH:mm'), 'to' => $window->ends_at->local()->isoFormat('DD.MM. HH:mm'), ]) }}

@if ($window->public_description)

{{ $window->public_description }}

@endif
@endforeach
@endif {{-- ── Whatever is broken right now, before the components ──────────── --}} @foreach ($ongoing as $incident)
{{ __('status.incident.ongoing') }}

{{ $incident->title }}

@endforeach {{-- ── The components, each with its ninety days ─────────────────────── --}}
@foreach ($components as $component) @php $state = $component['state']; $bars = $history[$component['key']] ?? ['days' => [], 'uptime' => null]; @endphp

{{ __("status.component.{$component['key']}") }}

{{ __("status.state.{$state}") }}

{{ __("status.about.{$component['key']}") }} @if (! empty($component['detail'])) {{ __("status.detail.{$component['key']}", $component['detail']) }} @endif

{{-- The bar. One column per day, oldest on the left, the same shape a reader has seen on every other status page — which is the reason to use it. --}}
{{ __('status.history.from', ['days' => $historyDays]) }} @if ($bars['uptime'] !== null) {{ __('status.history.uptime', ['percent' => number_format($bars['uptime'], 2, ',', '.')]) }} @else {{ __('status.history.unmeasured') }} @endif {{ __('status.history.today') }}
@endforeach

@foreach (['operational', 'degraded', 'down'] as $legend) {{ __("status.state.{$legend}") }} @endforeach {{ __('status.history.legend_gap') }}

{{-- ── The record ───────────────────────────────────────────────────── --}}

{{ __('status.incident.past_heading') }}

{{ __('status.page.subscribe') }}

@if ($past->isEmpty())

{{ __('status.incident.none', ['days' => $historyDays]) }}

@else
@foreach ($past as $day => $incidents)
{{-- The day heading comes from an incident's own timestamp rather than from the group key. The key is a bare 'Y-m-d' string; parsing it back yields midnight UTC, and converting THAT to the display zone lands on the previous evening — a heading two hours wide enough to name the wrong day. --}}

{{ $incidents->first()->started_at->local()->isoFormat('D. MMMM YYYY') }}

@foreach ($incidents as $incident)

{{ $incident->title }}

{{ __("status.incident.impact.{$incident->impact}") }}
{{ __('status.incident.started') }}
{{ $incident->started_at->local()->isoFormat('DD.MM. HH:mm') }}
{{ __('status.incident.resolved') }}
{{ $incident->resolved_at->local()->isoFormat('DD.MM. HH:mm') }}
{{ __('status.incident.duration') }}
{{ __('status.incident.affected') }}
{{ collect($incident->components)->map(fn ($c) => __("status.component.{$c}"))->join(', ') }}
@endforeach
@endforeach
@endif