refactor(dashboard): remove deployment loading logic and introduce DeploymentsIndicator component for better UI management

This commit is contained in:
Andras Bacsai
2025-09-30 11:43:30 +02:00
parent db2d44ca1f
commit a03c1b3b4b
11 changed files with 150 additions and 94 deletions

View File

@@ -52,13 +52,13 @@ class HealthChecks extends Component
try {
$this->authorize('update', $this->resource);
$wasEnabled = $this->resource->health_check_enabled;
$this->resource->health_check_enabled = !$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()) {
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') . '.');
$this->dispatch('success', 'Health check '.($this->resource->health_check_enabled ? 'enabled' : 'disabled').'.');
}
} catch (\Throwable $e) {
return handleError($e, $this);