fix: service container status updates
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -182,7 +182,7 @@ class General extends Component
|
||||
$this->resetDefaultLabels(false);
|
||||
}
|
||||
$this->submit();
|
||||
$this->dispatch('build_pack_updated');
|
||||
$this->dispatch('buildPackUpdated');
|
||||
}
|
||||
public function getWildcardDomain()
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user