diff --git a/app/Livewire/Project/Application/Configuration.php b/app/Livewire/Project/Application/Configuration.php index b095ab54d..832f0fcc3 100644 --- a/app/Livewire/Project/Application/Configuration.php +++ b/app/Livewire/Project/Application/Configuration.php @@ -10,7 +10,7 @@ class Configuration extends Component { public Application $application; public $servers; - protected $listeners = ['build_pack_updated' => '$refresh']; + protected $listeners = ['buildPackUpdated' => '$refresh']; public function mount() { diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php index 37b650281..b3c565fdd 100644 --- a/app/Livewire/Project/Application/General.php +++ b/app/Livewire/Project/Application/General.php @@ -182,7 +182,7 @@ class General extends Component $this->resetDefaultLabels(false); } $this->submit(); - $this->dispatch('build_pack_updated'); + $this->dispatch('buildPackUpdated'); } public function getWildcardDomain() { diff --git a/app/Livewire/Project/Service/Configuration.php b/app/Livewire/Project/Service/Configuration.php index afbdd47bc..33aac21d0 100644 --- a/app/Livewire/Project/Service/Configuration.php +++ b/app/Livewire/Project/Service/Configuration.php @@ -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(); - }); - } } diff --git a/app/Livewire/Project/Service/Navbar.php b/app/Livewire/Project/Service/Navbar.php index 5640084b9..70c304de0 100644 --- a/app/Livewire/Project/Service/Navbar.php +++ b/app/Livewire/Project/Service/Navbar.php @@ -17,7 +17,20 @@ class Navbar extends Component public array $parameters; public array $query; public $isDeploymentProgress = false; - + public function getListeners() + { + return [ + "serviceStatusChanged" + ]; + } + public function serviceStatusChanged() + { + $this->dispatch('refresh')->self(); + } + public function render() + { + return view('livewire.project.service.navbar'); + } public function checkDeployments() { $activity = Activity::where('properties->type_uuid', $this->service->uuid)->latest()->first(); @@ -28,26 +41,6 @@ class Navbar extends Component $this->isDeploymentProgress = false; } } - public function getListeners() - { - return [ - "serviceStatusChanged" - ]; - } - public function serviceStatusChanged() - { - $this->service->refresh(); - } - public function render() - { - return view('livewire.project.service.navbar'); - } - public function check_status($showNotification = false) - { - dispatch_sync(new ContainerStatusJob($this->service->destination->server)); - $this->service->refresh(); - if ($showNotification) $this->dispatch('success', 'Service status updated.'); - } public function deploy() { $this->checkDeployments(); @@ -62,7 +55,6 @@ class Navbar extends Component public function stop(bool $forceCleanup = false) { StopService::run($this->service); - $this->service->refresh(); if ($forceCleanup) { $this->dispatch('success', 'Containers cleaned up.'); } else { diff --git a/resources/views/livewire/project/database/heading.blade.php b/resources/views/livewire/project/database/heading.blade.php index 0a9734810..11202c8a8 100644 --- a/resources/views/livewire/project/database/heading.blade.php +++ b/resources/views/livewire/project/database/heading.blade.php @@ -1,4 +1,4 @@ -