An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat(ui): link healthcheck status row to the healthcheck page
Andras Bacsaif09de9c359ca
diff --git a/app/Livewire/Project/Application/Status.php b/app/Livewire/Project/Application/Status.phpindex eba5dca3b2..a1393be86f 100644--- a/app/Livewire/Project/Application/Status.php+++ b/app/Livewire/Project/Application/Status.php@@ -27,6 +27,12 @@ class Status extends Componentpublic function render(): View{- return view('livewire.project.application.status');+ return view('livewire.project.application.status', [+ 'healthcheckUrl' => route('project.application.healthcheck', [+ 'project_uuid' => $this->application->project()->uuid,+ 'environment_uuid' => $this->application->environment->uuid,+ 'application_uuid' => $this->application->uuid,+ ]),+ ]);}}diff --git a/app/Livewire/Project/Database/Status.php b/app/Livewire/Project/Database/Status.phpindex 4101227f69..eb40cf817e 100644--- a/app/Livewire/Project/Database/Status.php+++ b/app/Livewire/Project/Database/Status.php@@ -26,6 +26,12 @@ class Status extends Componentpublic function render(): View{- return view('livewire.project.database.status');+ return view('livewire.project.database.status', [+ 'healthcheckUrl' => route('project.database.healthcheck', [+ 'project_uuid' => $this->database->environment->project->uuid,+ 'environment_uuid' => $this->database->environment->uuid,+ 'database_uuid' => $this->database->uuid,+ ]),+ ]);}}diff --git a/resources/views/components/status-summary.blade.php b/resources/views/components/status-summary.blade.phpindex 27010cda9f..c2998dec68 100644--- a/resources/views/components/status-summary.blade.php+++ b/resources/views/components/status-summary.blade.php@@ -1,4 +1,10 @@-@props(['status', 'title' => 'Application status', 'containerName' => 'Container', 'align' => 'left'])+@props([+ 'status',+ 'title' => 'Application status',+ 'containerName' => 'Container',+ 'align' => 'left',+ 'healthcheckUrl' => null,+])@php$rawStatus = str((string) $status)->lower()->trim()->value();@@ -79,21 +85,40 @@<span class="flex-1">{{ $containerName }}</span><span>{{ $containerLabel }}</span></div>- <div class="listbox-option cursor-default! gap-2.5!">- <span @class([+ @php+ $healthDot = ['size-1.5 shrink-0 rounded-full','bg-success' => $healthType === 'success','bg-warning' => $healthType === 'warning','bg-error' => $healthType === 'error',- ])></span>- <span class="flex-1">Healthcheck</span>- <span class="inline-flex items-center gap-1.5">- {{ $healthLabel }}+ ];+ $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)+ <div class="listbox-option gap-0! p-0!">+ <a href="{{ $healthcheckUrl }}" {{ wireNavigate() }} role="menuitem"+ class="flex min-h-8 flex-1 items-center gap-2.5 px-2 py-1.5">+ <span @class($healthDot)></span>+ <span class="flex-1">Healthcheck</span>+ <span>{{ $healthLabel }}</span>+ </a>@if ($healthLabel === 'Not configured')- <x-helper label="About unconfigured healthchecks"- helper="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." />+ <span class="inline-flex pr-2">+ <x-helper label="About unconfigured healthchecks" :helper="$healthHelper" />+ </span>@endif- </span>- </div>+ </div>+ @else+ <div class="listbox-option cursor-default! gap-2.5!">+ <span @class($healthDot)></span>+ <span class="flex-1">Healthcheck</span>+ <span class="inline-flex items-center gap-1.5">+ {{ $healthLabel }}+ @if ($healthLabel === 'Not configured')+ <x-helper label="About unconfigured healthchecks" :helper="$healthHelper" />+ @endif+ </span>+ </div>+ @endif</div></div>diff --git a/resources/views/livewire/project/application/heading.blade.php b/resources/views/livewire/project/application/heading.blade.phpindex 2449c65ddb..c7b906d23a 100644--- a/resources/views/livewire/project/application/heading.blade.php+++ b/resources/views/livewire/project/application/heading.blade.php@@ -6,7 +6,8 @@{{ $application->name }}</h1><div class="relative flex w-full min-w-0 items-center gap-2">- <x-status-summary :status="$application->status" align="right" />+ <x-status-summary :status="$application->status" align="right"+ :healthcheck-url="route('project.application.healthcheck', $parameters)" /><x-applications.links :application="$application" compact />@if ($this->runningDeploymentUrl)<x-deploying-indicator :href="$this->runningDeploymentUrl" />diff --git a/resources/views/livewire/project/application/status.blade.php b/resources/views/livewire/project/application/status.blade.phpindex 7897d095ed..88f8eb886b 100644--- a/resources/views/livewire/project/application/status.blade.php+++ b/resources/views/livewire/project/application/status.blade.php@@ -1,4 +1,4 @@<div wire:poll.10000ms="refreshStatus" class="flex items-center gap-1">- <x-status-summary :status="$application->status" />+ <x-status-summary :status="$application->status" :healthcheck-url="$healthcheckUrl" /><x-application.restart-limit-warning :application="$application" /></div>diff --git a/resources/views/livewire/project/database/heading.blade.php b/resources/views/livewire/project/database/heading.blade.phpindex 92c33bfb8b..abf58177c7 100644--- a/resources/views/livewire/project/database/heading.blade.php+++ b/resources/views/livewire/project/database/heading.blade.php@@ -65,7 +65,8 @@{{ $database->name }}</h1><div class="relative flex w-full min-w-0 items-center gap-2">- <x-status-summary :status="$database->status" title="Database status" />+ <x-status-summary :status="$database->status" title="Database status"+ :healthcheck-url="route('project.database.healthcheck', $parameters)" />@if ($isDeploymentProgress)<x-deploying-indicator label="Working" />@endifdiff --git a/resources/views/livewire/project/database/status.blade.php b/resources/views/livewire/project/database/status.blade.phpindex 468f855bf2..489a811378 100644--- a/resources/views/livewire/project/database/status.blade.php+++ b/resources/views/livewire/project/database/status.blade.php@@ -1,4 +1,4 @@<div wire:poll.10000ms="refreshStatus" class="flex items-center gap-1">- <x-status-summary :status="$database->status" title="Database status" />+ <x-status-summary :status="$database->status" title="Database status" :healthcheck-url="$healthcheckUrl" /><x-application.restart-limit-warning :application="$database" /></div>diff --git a/tests/Feature/ApplicationHeadingActiveTabTest.php b/tests/Feature/ApplicationHeadingActiveTabTest.phpindex eba38ca5e6..4117749b13 100644--- a/tests/Feature/ApplicationHeadingActiveTabTest.php+++ b/tests/Feature/ApplicationHeadingActiveTabTest.php@@ -98,3 +98,20 @@ it('refreshes the breadcrumb application status after it changes', function () {expect($component->instance()->getListeners())->toHaveKey("echo-private:team.{$this->team->id},ServiceChecked", 'refreshStatus');});++it('links the application healthcheck status to the healthcheck page', function () {+ $this->actingAs($this->admin);+ session(['currentTeam' => $this->team]);++ $healthcheckUrl = route('project.application.healthcheck', [+ 'project_uuid' => $this->project->uuid,+ 'environment_uuid' => $this->environment->uuid,+ 'application_uuid' => $this->application->uuid,+ ]);++ Livewire::test(ApplicationStatus::class, ['application' => $this->application])+ ->assertSeeHtml('href="'.$healthcheckUrl.'"');++ Livewire::test(ApplicationHeading::class, ['application' => $this->application])+ ->assertSeeHtml('href="'.$healthcheckUrl.'"');+});diff --git a/tests/Feature/PreviewStatusSummaryTest.php b/tests/Feature/PreviewStatusSummaryTest.phpindex 2156e708e2..e36dba9852 100644--- a/tests/Feature/PreviewStatusSummaryTest.php+++ b/tests/Feature/PreviewStatusSummaryTest.php@@ -28,3 +28,22 @@ it('shows degraded aggregate service status as a warning', function () {->toContain('bg-warning')->not->toContain('bg-error');});++it('links the healthcheck row to the healthcheck page and keeps the helper outside the link', function () {+ $html = Blade::render('<x-status-summary status="running:unknown" healthcheck-url="https://coolify.test/healthcheck" />');+ $link = str($html)->after('href="https://coolify.test/healthcheck"')->before('</a>')->toString();++ expect($html)->toContain('href="https://coolify.test/healthcheck"')+ ->and($link)+ ->toContain('Healthcheck')+ ->toContain('Not configured')+ ->not->toContain('About unconfigured healthchecks')+ ->and(str($html)->after('</a>')->toString())+ ->toContain('aria-label="About unconfigured healthchecks"');+});++it('does not link the healthcheck row without a healthcheck url', function () {+ $html = Blade::render('<x-status-summary status="running:healthy" />');++ expect($html)->not->toContain('role="menuitem"');+});diff --git a/tests/Feature/ResourceBreadcrumbStatusTest.php b/tests/Feature/ResourceBreadcrumbStatusTest.phpindex c3bcb035a9..e2358e4546 100644--- a/tests/Feature/ResourceBreadcrumbStatusTest.php+++ b/tests/Feature/ResourceBreadcrumbStatusTest.php@@ -44,7 +44,12 @@ it('refreshes the breadcrumb database status after it changes', function () {]);$component = Livewire::test(DatabaseStatus::class, ['database' => $database])- ->assertSee('Running');+ ->assertSee('Running')+ ->assertSeeHtml('href="'.route('project.database.healthcheck', [+ 'project_uuid' => $this->project->uuid,+ 'environment_uuid' => $this->environment->uuid,+ 'database_uuid' => $database->uuid,+ ]).'"');$database->update(['status' => 'exited']);