fix: service container status updates

This commit is contained in:
Andras Bacsai
2024-03-01 10:36:32 +01:00
parent 604ab0afd8
commit 5322d446bd
7 changed files with 23 additions and 45 deletions

View File

@@ -17,9 +17,7 @@ class Configuration extends Component
{
$userId = auth()->user()->id;
return [
"echo-private:user.{$userId},ServiceStatusChanged" => 'checkStatus',
"refreshStacks",
"checkStatus",
"echo-private:user.{$userId},ServiceStatusChanged" => 'check_status',
];
}
public function render()
@@ -37,21 +35,10 @@ class Configuration extends Component
$this->applications = $this->service->applications->sort();
$this->databases = $this->service->databases->sort();
}
public function checkStatus()
public function check_status()
{
dispatch_sync(new ContainerStatusJob($this->service->server));
$this->refreshStacks();
$this->dispatch('refresh')->self();
$this->dispatch('serviceStatusChanged');
}
public function refreshStacks()
{
$this->applications = $this->service->applications->sort();
$this->applications->each(function ($application) {
$application->refresh();
});
$this->databases = $this->service->databases->sort();
$this->databases->each(function ($database) {
$database->refresh();
});
}
}