Merge pull request #6724 from ShadowArcanist/shadow/add-dropdown-healthcheck-method

chore(ui): improve application healthcheck page
This commit is contained in:
Andras Bacsai
2025-09-29 12:36:23 +02:00
committed by GitHub
2 changed files with 40 additions and 8 deletions
@@ -47,6 +47,24 @@ class HealthChecks extends Component
}
}
public function toggleHealthcheck()
{
try {
$this->authorize('update', $this->resource);
$wasEnabled = $this->resource->health_check_enabled;
$this->resource->health_check_enabled = !$this->resource->health_check_enabled;
$this->resource->save();
if ($this->resource->health_check_enabled && !$wasEnabled && $this->resource->isRunning()) {
$this->dispatch('info', 'Health check has been enabled. A restart is required to apply the new settings.');
} else {
$this->dispatch('success', 'Health check ' . ($this->resource->health_check_enabled ? 'enabled' : 'disabled') . '.');
}
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
public function render()
{
return view('livewire.project.shared.health-checks');