fix: service status updated

This commit is contained in:
Andras Bacsai 2024-03-04 08:57:18 +01:00
parent 0e1ba64836
commit 0aa85a3701
2 changed files with 5 additions and 1 deletions

View File

@ -18,6 +18,7 @@ public function getListeners()
$userId = auth()->user()->id;
return [
"echo-private:user.{$userId},ServiceStatusChanged" => 'check_status',
"check_status"
];
}
public function render()

View File

@ -6,7 +6,6 @@
use App\Actions\Service\StartService;
use App\Actions\Service\StopService;
use App\Events\ServiceStatusChanged;
use App\Jobs\ContainerStatusJob;
use App\Models\Service;
use Livewire\Component;
use Spatie\Activitylog\Models\Activity;
@ -27,6 +26,10 @@ public function serviceStatusChanged()
{
$this->dispatch('refresh')->self();
}
public function check_status() {
$this->dispatch('check_status');
$this->dispatch('success', 'Service status updated.');
}
public function render()
{
return view('livewire.project.service.navbar');