fix: service navbar using new realtime events

This commit is contained in:
Andras Bacsai
2023-12-08 12:12:44 +01:00
parent 86c2415210
commit b55bd298f2
16 changed files with 107 additions and 33 deletions

View File

@@ -13,7 +13,15 @@ class Index extends Component
public $databases;
public array $parameters;
public array $query;
protected $listeners = ["refreshStacks", "checkStatus"];
public function getListeners()
{
$userId = auth()->user()->id;
return [
"echo-private:custom.{$userId},ServiceStatusChanged" => 'checkStatus',
"refreshStacks",
"checkStatus",
];
}
public function render()
{
return view('livewire.project.service.index');
@@ -28,7 +36,7 @@ class Index extends Component
}
public function checkStatus()
{
dispatch(new ContainerStatusJob($this->service->server));
dispatch_sync(new ContainerStatusJob($this->service->server));
$this->refreshStacks();
}
public function refreshStacks()