@php // container state -> status-pill status $pill = fn (string $s) => match (true) { $s === 'running' => 'online', $s === 'paused' => 'warning', in_array($s, ['created', 'restarting'], true) => 'pending', default => 'offline', // exited / dead / removing }; $hostOn = $this->hostConfigured(); $effTarget = $this->effectiveTarget(); $active = $this->activeServer(); $targetName = $effTarget === 'host' ? __('docker.host_target') : $active?->name; @endphp
{{-- Header --}}

{{ __('docker.eyebrow') }}

{{ __('docker.title') }}

{{-- Target switch: the Clusev host vs the active fleet server (only when a host login exists) --}} @if ($hostOn)
@endif {{ $connected ? __('docker.connected') : __('docker.disconnected') }}
@if (! $ready) {{-- lazy skeleton --}}
@for ($i = 0; $i < 3; $i++)
@endfor
@elseif ($hostNotConfigured) {{-- Host target picked but no host SSH login yet — send the operator to setup. --}}

{{ __('docker.host_unconfigured_title') }}

{{ __('docker.host_unconfigured_hint') }}

@elseif ($notInstalled) {{-- Honest, neutral state: the target simply has no docker (not a fault). --}}

{{ __('docker.not_installed_title') }}

{{ __('docker.not_installed_hint') }}

@elseif (! $connected)

{{ __('docker.unavailable_title') }}

{{ __('docker.unavailable_hint') }}

@if ($error)
{{ $error }}
@endif
@elseif (empty($containers))

{{ __('docker.empty_title') }}

{{ __('docker.empty_hint') }}

@else
@foreach ($containers as $c)

{{ $c['name'] }}

{{-- Just the image — the raw port list is noisy and rarely useful at a glance. --}}

{{ $c['image'] }}

@can('operate') {{ __('docker.logs') }} @if ($c['state'] === 'running') {{ __('docker.restart') }} {{ __('docker.stop') }} @else {{ __('docker.start') }} @endif @endcan
@endforeach
@endif