From ca27224628c0fadfba6892fbd24dfe5f4f154678 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Wed, 4 Nov 2026 11:29:49 +0100 Subject: [PATCH] fix(server): refresh the page after the localhost connection is validated Co-Authored-By: Claude Opus 5.5 --- app/Livewire/Server/Navbar.php | 5 ++ app/Livewire/Server/Show.php | 3 + .../views/components/server/sidebar.blade.php | 78 +++++++++---------- 3 files changed, 47 insertions(+), 39 deletions(-) diff --git a/app/Livewire/Server/Navbar.php b/app/Livewire/Server/Navbar.php index 4e742df4e5..4117a449ad 100644 --- a/app/Livewire/Server/Navbar.php +++ b/app/Livewire/Server/Navbar.php @@ -252,6 +252,11 @@ class Navbar extends Component $this->server->refresh(); $this->server->load('settings'); $this->proxyStatus = $this->server->proxy->status ?? 'unknown'; + $this->serverSwitcherOptions = collect($this->serverSwitcherOptions) + ->map(fn (array $option): array => $option['uuid'] === $this->server->uuid + ? [...$option, 'functional' => $this->server->isFunctional()] + : $option) + ->all(); $this->dispatchProxyConfigurationState(); } diff --git a/app/Livewire/Server/Show.php b/app/Livewire/Server/Show.php index c8080ac36e..695a7a8180 100644 --- a/app/Livewire/Server/Show.php +++ b/app/Livewire/Server/Show.php @@ -460,7 +460,10 @@ class Show extends Component ServerReachabilityChanged::dispatch($this->server); $this->server->gatherServerMetadata(); $this->server->refresh(); + $this->dispatch('refreshServerShow')->to(Navbar::class); } else { + $this->isReachable = $this->server->settings->is_reachable; + $this->dispatch('refreshServerShow')->to(Navbar::class); $this->dispatch('error', 'Server is not reachable.', 'Please validate your configuration and connection.

Check this documentation for further help.

Error: '.$error); return; diff --git a/resources/views/components/server/sidebar.blade.php b/resources/views/components/server/sidebar.blade.php index 7011211723..9b6bc5d5ad 100644 --- a/resources/views/components/server/sidebar.blade.php +++ b/resources/views/components/server/sidebar.blade.php @@ -302,46 +302,46 @@ {{ $menuItem['label'] }} - @continue - @endif - $menuItem['active'], - ]) - @if ($menuItem['navigate'] ?? true) {{ wireNavigate() }} @endif - href="{{ route($menuItem['route'], $serverRouteParameters) }}"> - - {{ $menuItem['label'] }} - @if ($menuItem['tracks_proxy_configuration'] ?? false) - - @elseif ($menuItem['tracks_sentinel_status'] ?? false) - - @elseif ($menuItem['warning'] ?? false) - - @elseif ($menuItem['beta'] ?? false) - + @else + $menuItem['active'], + ]) + @if ($menuItem['navigate'] ?? true) {{ wireNavigate() }} @endif + href="{{ route($menuItem['route'], $serverRouteParameters) }}"> + + {{ $menuItem['label'] }} + @if ($menuItem['tracks_proxy_configuration'] ?? false) + + @elseif ($menuItem['tracks_sentinel_status'] ?? false) + + @elseif ($menuItem['warning'] ?? false) + + @elseif ($menuItem['beta'] ?? false) + + @endif + + @if ($menuItem['active'] && isset($menuItem['children'])) + @endif - - @if ($menuItem['active'] && isset($menuItem['children'])) - @endif @endforeach @endforeach