coolify/resources/views/components/status/restarting.blade.php

47 lines
1.8 KiB
PHP
Raw Normal View History

2023-07-28 19:36:19 +00:00
@props([
2023-09-22 13:29:19 +00:00
'status' => 'Restarting',
'title' => null,
'lastDeploymentLink' => null,
'noLoading' => false,
2023-07-28 19:36:19 +00:00
])
@php
// Handle both colon format (backend) and parentheses format (from services.blade.php)
// starting:unknown → Starting (unknown)
// starting (unknown) → starting (unknown) (already formatted, display as-is)
if (str($status)->contains('(')) {
// Already in parentheses format from services.blade.php - use as-is
$displayStatus = $status;
$healthStatus = str($status)->after('(')->before(')')->trim()->value();
} elseif (str($status)->contains(':') && !str($status)->startsWith('Proxy')) {
// Colon format from backend - transform it
$parts = explode(':', $status);
$displayStatus = str($parts[0])->headline();
$healthStatus = $parts[1] ?? null;
} else {
// Simple status without health
$displayStatus = str($status)->headline();
$healthStatus = null;
}
@endphp
2024-04-03 11:04:21 +00:00
<div class="flex items-center">
@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-warning"></div>
<div class="pl-2 pr-1 text-xs font-bold dark:text-warning" @if($title) title="{{$title}}" @endif>
@if ($lastDeploymentLink)
<a href="{{ $lastDeploymentLink }}" target="_blank" class="underline cursor-pointer">
{{ $displayStatus }}
</a>
@else
{{ $displayStatus }}
@endif
2024-03-20 11:54:06 +00:00
</div>
@if ($healthStatus && !str($displayStatus)->contains('('))
<div class="text-xs dark:text-warning">({{ $healthStatus }})</div>
2024-03-20 11:54:06 +00:00
@endif
</span>
2023-06-08 08:55:50 +00:00
</div>