mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-25 08:50:35 -04:00
Merge pull request #6724 from ShadowArcanist/shadow/add-dropdown-healthcheck-method
chore(ui): improve application healthcheck page
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user