fix: service config hash update

This commit is contained in:
Andras Bacsai
2024-04-12 13:15:24 +02:00
parent 7a32b8d1d2
commit 45281360d5
5 changed files with 31 additions and 19 deletions

View File

@@ -66,7 +66,7 @@ class Configuration extends Component
try {
dispatch_sync(new ContainerStatusJob($this->service->server));
$this->dispatch('refresh')->self();
$this->dispatch('serviceStatusChanged');
$this->dispatch('updateStatus');
} catch (\Exception $e) {
return handleError($e, $this);
}

View File

@@ -30,23 +30,20 @@ class Navbar extends Component
$userId = auth()->user()->id;
return [
"echo-private:user.{$userId},ServiceStatusChanged" => 'serviceStarted',
"serviceStatusChanged"
"updateStatus"=> '$refresh',
];
}
public function serviceStarted()
{
$this->dispatch('success', 'Service status changed.');
if (is_null($this->service->config_hash) || $this->service->isConfigurationChanged()) {
$this->service->isConfigurationChanged(true);
$this->dispatch('configurationChanged');
} else {
$this->dispatch('configurationChanged');
}
}
public function serviceStatusChanged()
{
$this->dispatch('refresh')->self();
// if (is_null($this->service->config_hash) || $this->service->isConfigurationChanged()) {
// $this->service->isConfigurationChanged(true);
// $this->dispatch('configurationChanged');
// } else {
// $this->dispatch('configurationChanged');
// }
}
public function check_status()
{
$this->dispatch('check_status');