From 45281360d517b30a9d4052814cdf2184cbfbc234 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 12 Apr 2024 13:15:24 +0200 Subject: [PATCH] fix: service config hash update --- .../Project/Service/Configuration.php | 2 +- app/Livewire/Project/Service/Navbar.php | 19 ++++++++----------- resources/views/components/helper.blade.php | 15 ++++++++++----- .../views/components/status/running.blade.php | 12 +++++++++++- .../project/service/edit-domain.blade.php | 2 +- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/app/Livewire/Project/Service/Configuration.php b/app/Livewire/Project/Service/Configuration.php index ea0e804b7..2cbda4e02 100644 --- a/app/Livewire/Project/Service/Configuration.php +++ b/app/Livewire/Project/Service/Configuration.php @@ -66,7 +66,7 @@ public function check_status() 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); } diff --git a/app/Livewire/Project/Service/Navbar.php b/app/Livewire/Project/Service/Navbar.php index 85a8da69f..141859ed4 100644 --- a/app/Livewire/Project/Service/Navbar.php +++ b/app/Livewire/Project/Service/Navbar.php @@ -30,23 +30,20 @@ public function getListeners() $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'); diff --git a/resources/views/components/helper.blade.php b/resources/views/components/helper.blade.php index 43c49491d..394f6275f 100644 --- a/resources/views/components/helper.blade.php +++ b/resources/views/components/helper.blade.php @@ -1,9 +1,14 @@ -
merge(['class' => "group"]) }}> +
merge(['class' => 'group']) }}>
- - - + @isset($icon) + {{ $icon }} + @else + + + + @endisset +
diff --git a/resources/views/components/status/running.blade.php b/resources/views/components/status/running.blade.php index 5d349899b..52758303b 100644 --- a/resources/views/components/status/running.blade.php +++ b/resources/views/components/status/running.blade.php @@ -9,7 +9,17 @@ {{ str($status)->before(':')->headline() }}
@if (!str($status)->startsWith('Proxy') && !str($status)->contains('(')) -
({{ str($status)->after(':') }})
+ @if (str($status)->contains('unhealthy')) + + + + + + {{-- @else +
({{ str($status)->after(':') }})
--}} + @endif @endif
diff --git a/resources/views/livewire/project/service/edit-domain.blade.php b/resources/views/livewire/project/service/edit-domain.blade.php index ff8f03bf5..909d02169 100644 --- a/resources/views/livewire/project/service/edit-domain.blade.php +++ b/resources/views/livewire/project/service/edit-domain.blade.php @@ -1,5 +1,5 @@
- Save