This commit is contained in:
Andras Bacsai 2023-12-08 12:48:21 +01:00
parent 14bac0f0d7
commit 4071e096bc
2 changed files with 7 additions and 4 deletions

View File

@ -38,7 +38,6 @@ class Index extends Component
{ {
dispatch_sync(new ContainerStatusJob($this->service->server)); dispatch_sync(new ContainerStatusJob($this->service->server));
$this->refreshStacks(); $this->refreshStacks();
$this->dispatch('updateStatus');
} }
public function refreshStacks() public function refreshStacks()
{ {

View File

@ -16,8 +16,7 @@ class Navbar extends Component
public array $query; public array $query;
public $isDeploymentProgress = false; public $isDeploymentProgress = false;
public function checkDeployments() public function checkDeployments() {
{
$activity = Activity::where('properties->type_uuid', $this->service->uuid)->latest()->first(); $activity = Activity::where('properties->type_uuid', $this->service->uuid)->latest()->first();
$status = data_get($activity, 'properties.status'); $status = data_get($activity, 'properties.status');
if ($status === 'queued' || $status === 'in_progress') { if ($status === 'queued' || $status === 'in_progress') {
@ -28,10 +27,15 @@ class Navbar extends Component
} }
public function getListeners() public function getListeners()
{ {
$userId = auth()->user()->id;
return [ return [
"updateStatus" => 'checkStatus', "echo-private:custom.{$userId},ServiceStatusChanged" => 'serviceStatusChanged',
]; ];
} }
public function serviceStatusChanged()
{
$this->service->refresh();
}
public function render() public function render()
{ {
return view('livewire.project.service.navbar'); return view('livewire.project.service.navbar');