From f09de9c359ca43636c2449f8b6dc28ad908f964a Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 28 Sep 2026 10:47:01 +0200 Subject: [PATCH] feat(ui): link healthcheck status row to the healthcheck page Co-Authored-By: Claude Opus 5.5 --- app/Livewire/Project/Application/Status.php | 8 +++- app/Livewire/Project/Database/Status.php | 8 +++- .../views/components/status-summary.blade.php | 47 ++++++++++++++----- .../project/application/heading.blade.php | 3 +- .../project/application/status.blade.php | 2 +- .../project/database/heading.blade.php | 3 +- .../project/database/status.blade.php | 2 +- .../ApplicationHeadingActiveTabTest.php | 17 +++++++ tests/Feature/PreviewStatusSummaryTest.php | 19 ++++++++ .../Feature/ResourceBreadcrumbStatusTest.php | 7 ++- 10 files changed, 98 insertions(+), 18 deletions(-) diff --git a/app/Livewire/Project/Application/Status.php b/app/Livewire/Project/Application/Status.php index eba5dca3b2..a1393be86f 100644 --- a/app/Livewire/Project/Application/Status.php +++ b/app/Livewire/Project/Application/Status.php @@ -27,6 +27,12 @@ class Status extends Component public 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.php index 4101227f69..eb40cf817e 100644 --- a/app/Livewire/Project/Database/Status.php +++ b/app/Livewire/Project/Database/Status.php @@ -26,6 +26,12 @@ class Status extends Component public 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.php index 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 @@ {{ $containerName }} {{ $containerLabel }} -
- $healthType === 'success', 'bg-warning' => $healthType === 'warning', 'bg-error' => $healthType === 'error', - ])> - Healthcheck - - {{ $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) +
+ + + Healthcheck + {{ $healthLabel }} + @if ($healthLabel === 'Not configured') - + + + @endif - -
+
+ @else +
+ + Healthcheck + + {{ $healthLabel }} + @if ($healthLabel === 'Not configured') + + @endif + +
+ @endif diff --git a/resources/views/livewire/project/application/heading.blade.php b/resources/views/livewire/project/application/heading.blade.php index 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 }}
- + @if ($this->runningDeploymentUrl) diff --git a/resources/views/livewire/project/application/status.blade.php b/resources/views/livewire/project/application/status.blade.php index 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 @@
- +
diff --git a/resources/views/livewire/project/database/heading.blade.php b/resources/views/livewire/project/database/heading.blade.php index 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 }}
- + @if ($isDeploymentProgress) @endif diff --git a/resources/views/livewire/project/database/status.blade.php b/resources/views/livewire/project/database/status.blade.php index 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 @@
- +
diff --git a/tests/Feature/ApplicationHeadingActiveTabTest.php b/tests/Feature/ApplicationHeadingActiveTabTest.php index 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.php index 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(''); + $link = str($html)->after('href="https://coolify.test/healthcheck"')->before('')->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('')->toString()) + ->toContain('aria-label="About unconfigured healthchecks"'); +}); + +it('does not link the healthcheck row without a healthcheck url', function () { + $html = Blade::render(''); + + expect($html)->not->toContain('role="menuitem"'); +}); diff --git a/tests/Feature/ResourceBreadcrumbStatusTest.php b/tests/Feature/ResourceBreadcrumbStatusTest.php index 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']);