@props([ 'status', 'title' => 'Application status', 'containerName' => 'Container', 'align' => 'left', 'healthcheckUrl' => null, ]) @php $rawStatus = str((string) $status)->lower()->trim()->value(); $statusParts = explode(':', $rawStatus); $containerStatus = $statusParts[0] ?? 'unknown'; $healthStatus = $statusParts[1] ?? null; $monitoringExcluded = in_array('excluded', $statusParts, true); if ($healthStatus === null && preg_match('/^([^()]+)\(([^)]+)\)$/', $rawStatus, $matches)) { $containerStatus = trim($matches[1]); $healthStatus = trim($matches[2]); } $containerLabel = str($containerStatus ?: 'unknown')->headline()->value(); $healthLabel = match (true) { $monitoringExcluded => 'Monitoring disabled', $healthStatus === 'healthy' => 'Healthy', $healthStatus === 'unhealthy' => 'Unhealthy', $healthStatus === 'starting' => 'Starting', default => 'Not configured', }; $containerType = match (true) { str($containerStatus)->startsWith('running') => 'success', str($containerStatus)->startsWith(['starting', 'restarting', 'degraded']) => 'warning', default => 'error', }; $healthType = match (true) { $monitoringExcluded => 'warning', $healthStatus === 'healthy' => 'success', $healthStatus === 'unhealthy' => 'error', default => 'warning', }; [$summaryLabel, $summaryType] = match (true) { $containerType === 'error' => [$containerLabel, 'error'], str($containerStatus)->startsWith('degraded') => ['Degraded', 'warning'], $healthType === 'error' => ['Degraded', 'error'], $containerType === 'warning' => [$containerLabel, 'warning'], $monitoringExcluded => ["{$containerLabel} (monitoring disabled)", 'warning'], $healthStatus === 'starting' => ["{$containerLabel} (healthcheck starting)", 'warning'], $healthType === 'warning' => ["{$containerLabel} (no healthcheck)", 'warning'], default => [$containerLabel, 'success'], }; @endphp
$summaryType === 'success', 'bg-warning' => $summaryType === 'warning', 'bg-error' => $summaryType === 'error', ])> {{ $summaryLabel }}
$align !== 'right', 'left-auto! right-0!' => $align === 'right', ]) role="menu">
{{ $title }}
$containerType === 'success', 'bg-warning' => $containerType === 'warning', 'bg-error' => $containerType === 'error', ])> {{ $containerName }} {{ $containerLabel }}
@php $healthDot = [ 'size-1.5 shrink-0 rounded-full', 'bg-success' => $healthType === 'success', 'bg-warning' => $healthType === 'warning', 'bg-error' => $healthType === 'error', ]; $healthHelper = 'No healthcheck is configured, so Coolify can only report the container state. Traffic can still be routed to the container, but Coolify cannot verify that the application inside it is ready to receive requests.'; @endphp @if ($healthcheckUrl)
Healthcheck {{ $healthLabel }} @if ($healthLabel === 'Not configured') @endif
@else
Healthcheck {{ $healthLabel }} @if ($healthLabel === 'Not configured') @endif
@endif