2023-07-28 19:36:19 +00:00
|
|
|
@props([
|
2023-09-22 13:29:19 +00:00
|
|
|
'status' => 'Stopped',
|
2024-10-03 19:29:55 +00:00
|
|
|
'noLoading' => false,
|
2023-07-28 19:36:19 +00:00
|
|
|
])
|
2025-11-20 16:31:07 +00:00
|
|
|
@php
|
|
|
|
|
// Handle both colon format (backend) and parentheses format (from services.blade.php)
|
2025-11-24 08:09:08 +00:00
|
|
|
// For exited containers, health status is hidden (health checks don't run on stopped containers)
|
|
|
|
|
// exited:unhealthy → Exited
|
|
|
|
|
// exited (unhealthy) → Exited
|
2025-11-20 16:31:07 +00:00
|
|
|
|
|
|
|
|
if (str($status)->contains('(')) {
|
|
|
|
|
// Already in parentheses format from services.blade.php - use as-is
|
|
|
|
|
$displayStatus = $status;
|
|
|
|
|
$healthStatus = str($status)->after('(')->before(')')->trim()->value();
|
2025-11-24 08:09:08 +00:00
|
|
|
|
|
|
|
|
// Don't show health status for exited containers (health checks don't run on stopped containers)
|
|
|
|
|
if (str($displayStatus)->lower()->contains('exited')) {
|
|
|
|
|
$displayStatus = str($status)->before('(')->trim()->headline();
|
|
|
|
|
$healthStatus = null;
|
|
|
|
|
}
|
2025-11-20 16:31:07 +00:00
|
|
|
} elseif (str($status)->contains(':')) {
|
|
|
|
|
// Colon format from backend - transform it
|
|
|
|
|
$parts = explode(':', $status);
|
|
|
|
|
$displayStatus = str($parts[0])->headline();
|
|
|
|
|
$healthStatus = $parts[1] ?? null;
|
2025-11-24 08:09:08 +00:00
|
|
|
|
|
|
|
|
// Don't show health status for exited containers (health checks don't run on stopped containers)
|
|
|
|
|
if (str($displayStatus)->lower()->contains('exited')) {
|
|
|
|
|
$healthStatus = null;
|
|
|
|
|
}
|
2025-11-20 16:31:07 +00:00
|
|
|
} else {
|
|
|
|
|
// Simple status without health
|
|
|
|
|
$displayStatus = str($status)->headline();
|
|
|
|
|
$healthStatus = null;
|
|
|
|
|
}
|
|
|
|
|
@endphp
|
2024-03-20 11:54:06 +00:00
|
|
|
<div class="flex items-center">
|
2024-10-03 19:29:55 +00:00
|
|
|
@if (!$noLoading)
|
|
|
|
|
<x-loading wire:loading.delay.longer />
|
|
|
|
|
@endif
|
2024-03-20 11:54:06 +00:00
|
|
|
<span wire:loading.remove.delay.longer class="flex items-center">
|
|
|
|
|
<div class="badge badge-error "></div>
|
2025-11-20 16:31:07 +00:00
|
|
|
<div class="pl-2 pr-1 text-xs font-bold text-error">{{ $displayStatus }}</div>
|
|
|
|
|
@if ($healthStatus && !str($displayStatus)->contains('('))
|
|
|
|
|
<div class="text-xs text-error">({{ $healthStatus }})</div>
|
|
|
|
|
@endif
|
2024-03-20 11:54:06 +00:00
|
|
|
</span>
|
2023-06-08 08:55:50 +00:00
|
|
|
</div>
|