2024-05-17 06:53:25 +00:00
|
|
|
@props([
|
2024-10-22 08:58:23 +00:00
|
|
|
'title' => null,
|
2024-05-17 06:53:25 +00:00
|
|
|
'lastDeploymentLink' => null,
|
2024-05-17 08:12:13 +00:00
|
|
|
'resource' => null,
|
2026-06-03 09:01:28 +00:00
|
|
|
'showRefreshButton' => true,
|
2024-05-17 06:53:25 +00:00
|
|
|
])
|
2026-06-03 09:01:28 +00:00
|
|
|
@php
|
|
|
|
|
$stoppedAfterRestartLimit = $resource && method_exists($resource, 'stoppedAfterRestartLimit') && $resource->stoppedAfterRestartLimit();
|
|
|
|
|
@endphp
|
2026-04-09 17:51:31 +00:00
|
|
|
<div class="flex flex-wrap items-center gap-1">
|
|
|
|
|
@if (str($resource->status)->startsWith('running'))
|
|
|
|
|
<x-status.running :status="$resource->status" :title="$title" :lastDeploymentLink="$lastDeploymentLink" />
|
|
|
|
|
@elseif(str($resource->status)->startsWith('degraded'))
|
|
|
|
|
<x-status.degraded :status="$resource->status" :title="$title" :lastDeploymentLink="$lastDeploymentLink" />
|
|
|
|
|
@elseif(str($resource->status)->startsWith('restarting') || str($resource->status)->startsWith('starting'))
|
|
|
|
|
<x-status.restarting :status="$resource->status" :title="$title" :lastDeploymentLink="$lastDeploymentLink" />
|
|
|
|
|
@else
|
|
|
|
|
<x-status.stopped :status="$resource->status" />
|
|
|
|
|
@endif
|
2026-06-03 09:01:28 +00:00
|
|
|
@if (isset($resource->restart_count) && $resource->restart_count > 0 && (!str($resource->status)->startsWith('exited') || $stoppedAfterRestartLimit))
|
2026-06-05 12:57:57 +00:00
|
|
|
<x-status-badge status="{{ $resource->restart_count }}x restarts" type="warning"
|
|
|
|
|
title="Container has restarted {{ $resource->restart_count }} time{{ $resource->restart_count > 1 ? 's' : '' }}. Last restart: {{ $resource->last_restart_at?->diffForHumans() }}" />
|
2026-04-09 17:51:31 +00:00
|
|
|
@endif
|
2026-06-03 09:01:28 +00:00
|
|
|
@if ($stoppedAfterRestartLimit)
|
2026-06-05 12:57:57 +00:00
|
|
|
<x-status-badge status="Stopped after reaching restart limit ({{ $resource->restart_count }}/{{ $resource->max_restart_count }})."
|
|
|
|
|
type="warning"
|
|
|
|
|
title="Container has crashed and Coolify stopped it after {{ $resource->restart_count }} restart attempts." />
|
2026-06-03 09:01:28 +00:00
|
|
|
@endif
|
2026-04-09 17:51:31 +00:00
|
|
|
@if (!str($resource->status)->contains('exited') && $showRefreshButton)
|
2026-06-05 11:31:20 +00:00
|
|
|
<x-status-badge as="button" wire:target="manualCheckStatus" wire:loading.attr="disabled"
|
|
|
|
|
wire:click='manualCheckStatus' status="Refresh" type="neutral" title="Refresh Status"
|
|
|
|
|
aria-label="Refresh status"
|
|
|
|
|
class="min-w-[4.5rem] justify-center cursor-pointer border-transparent hover:bg-neutral-200 disabled:cursor-wait disabled:opacity-70 dark:hover:bg-coolgray-300" />
|
2026-04-09 17:51:31 +00:00
|
|
|
@endif
|
|
|
|
|
</div>
|