diff --git a/resources/views/components/applications/links.blade.php b/resources/views/components/applications/links.blade.php index 647dc1ab9..fa9a88119 100644 --- a/resources/views/components/applications/links.blade.php +++ b/resources/views/components/applications/links.blade.php @@ -45,6 +45,10 @@ @if (data_get($fqdn, 'domain')) @foreach (explode(',', data_get($fqdn, 'domain')) as $domain) + + Production + {{ getFqdnWithoutPort($domain) }} @endforeach @@ -54,6 +58,10 @@ @if (data_get($application, 'fqdn')) @foreach (str(data_get($application, 'fqdn'))->explode(',') as $fqdn) + + Production + {{ getFqdnWithoutPort($fqdn) }} @endforeach @@ -66,7 +74,11 @@ @foreach (explode(',', data_get($fqdn, 'domain')) as $domain) - PR{{ data_get($preview, 'pull_request_id') }} | {{ getFqdnWithoutPort($domain) }} + + PR #{{ data_get($preview, 'pull_request_id') }} + + {{ getFqdnWithoutPort($domain) }} @endforeach @endif @@ -77,7 +89,11 @@ @if (data_get($preview, 'fqdn')) - PR{{ data_get($preview, 'pull_request_id') }} | {{ data_get($preview, 'fqdn') }} + + PR #{{ data_get($preview, 'pull_request_id') }} + + {{ getFqdnWithoutPort(data_get($preview, 'fqdn')) }} @endif @endforeach diff --git a/resources/views/components/forms/button.blade.php b/resources/views/components/forms/button.blade.php index 86423eb9d..7a061dc45 100644 --- a/resources/views/components/forms/button.blade.php +++ b/resources/views/components/forms/button.blade.php @@ -9,9 +9,9 @@ $loadingTarget = null; if ($showLoadingIndicator) { if (filled($wireClickValue)) { - $loadingTarget = trim(explode('(', (string) $wireClickValue, 2)[0]); + $loadingTarget = trim((string) $wireClickValue); } elseif ($hasExplicitWireTarget) { - $loadingTarget = trim(explode('(', (string) $wireTargetValue, 2)[0]); + $loadingTarget = trim((string) $wireTargetValue); } } diff --git a/resources/views/components/helper.blade.php b/resources/views/components/helper.blade.php index fb6364973..15a5055c3 100644 --- a/resources/views/components/helper.blade.php +++ b/resources/views/components/helper.blade.php @@ -54,11 +54,11 @@ const triggerRect = trigger.getBoundingClientRect(); const popupRect = popup.getBoundingClientRect(); const padding = 8; - let top = triggerRect.top - popupRect.height - padding; + let top = triggerRect.bottom + padding; let left = triggerRect.right - popupRect.width; - if (top < padding) { - top = triggerRect.bottom + padding; + if (top + popupRect.height > window.innerHeight - padding) { + top = triggerRect.top - popupRect.height - padding; } left = Math.min(Math.max(padding, left), window.innerWidth - popupRect.width - padding); @@ -68,11 +68,11 @@ } }" @pointerdown.window="closeWhenPointerIsOutside($event)" @keydown.window.escape="close" @resize.window="open && position()" @scroll.window="open && position()" - {{ $attributes->merge(['class' => 'relative z-10 inline-block align-middle']) }}> + {{ $attributes->merge(['class' => 'relative inline-block align-middle']) }}> {{-- button (not div) so label-for associations do not steal the click on mobile --}} + @endif +
{{ $server->isSentinelLive() ? 'In sync' : 'Out of sync' }} @endif - @if ($server->proxySet()) - - @endif
diff --git a/resources/views/components/status-summary.blade.php b/resources/views/components/status-summary.blade.php new file mode 100644 index 000000000..4cea3b594 --- /dev/null +++ b/resources/views/components/status-summary.blade.php @@ -0,0 +1,94 @@ +@props(['status', 'title' => 'Application status', 'containerName' => 'Container']) + +@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']) => 'warning', + default => 'error', + }; + + $healthType = match (true) { + $monitoringExcluded => 'warning', + $healthStatus === 'healthy' => 'success', + $healthStatus === 'unhealthy' => 'error', + default => 'warning', + }; + + [$summaryLabel, $summaryType] = match (true) { + $containerType === 'error' => [$containerLabel, 'error'], + $healthType === 'error' => ['Degraded', 'error'], + $containerType === 'warning' => [$containerLabel, 'warning'], + $monitoringExcluded => ["{$containerLabel} (monitoring disabled)", 'warning'], + $healthStatus === 'starting' => ["{$containerLabel} (health check starting)", 'warning'], + $healthType === 'warning' => ["{$containerLabel} (no health check)", 'warning'], + default => [$containerLabel, 'success'], + }; +@endphp + +
+ + $summaryType === 'success', + 'bg-warning' => $summaryType === 'warning', + 'bg-error' => $summaryType === 'error', + ])> + {{ $summaryLabel }} + + + + + + +
diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 38ee3264a..02f6ecf1a 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -97,6 +97,7 @@ +