fix(server): refresh the page after the localhost connection is validated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-11-04 11:29:49 +01:00
co-authored by Claude Opus 5.5
parent 860e786481
commit ca27224628
3 changed files with 47 additions and 39 deletions
+5
View File
@@ -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();
}
+3
View File
@@ -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.<br><br>Check this <a target="_blank" class="underline" href="https://coolify.io/docs/knowledge-base/server/openssh">documentation</a> for further help. <br><br>Error: '.$error);
return;
@@ -302,46 +302,46 @@
<x-reicon :name="$menuItem['icon']" class="menu-item-icon" />
<span class="menu-item-label">{{ $menuItem['label'] }}</span>
</span>
@continue
@endif
<a wire:key="{{ $placement }}-server-settings-link-{{ str($menuItem['label'])->slug() }}"
@class([
'menu-item',
'menu-item-active' => $menuItem['active'],
])
@if ($menuItem['navigate'] ?? true) {{ wireNavigate() }} @endif
href="{{ route($menuItem['route'], $serverRouteParameters) }}">
<x-reicon :name="$menuItem['icon']" class="menu-item-icon" />
<span class="menu-item-label">{{ $menuItem['label'] }}</span>
@if ($menuItem['tracks_proxy_configuration'] ?? false)
<x-reicon name="alert-triangle" x-cloak
x-show="proxyConfigurationPending || traefikOutdated || proxyNotRunning"
class="ml-auto size-3.5 shrink-0 text-orange-500 dark:text-warning" />
@elseif ($menuItem['tracks_sentinel_status'] ?? false)
<x-reicon name="alert-triangle" x-cloak x-show="sentinelOutOfSync"
class="ml-auto size-3.5 shrink-0 text-orange-500 dark:text-warning" />
@elseif ($menuItem['warning'] ?? false)
<x-reicon name="alert-triangle"
class="ml-auto size-3.5 shrink-0 text-orange-500 dark:text-warning" />
@elseif ($menuItem['beta'] ?? false)
<x-beta-badge class="ml-auto shrink-0" />
@else
<a wire:key="{{ $placement }}-server-settings-link-{{ str($menuItem['label'])->slug() }}"
@class([
'menu-item',
'menu-item-active' => $menuItem['active'],
])
@if ($menuItem['navigate'] ?? true) {{ wireNavigate() }} @endif
href="{{ route($menuItem['route'], $serverRouteParameters) }}">
<x-reicon :name="$menuItem['icon']" class="menu-item-icon" />
<span class="menu-item-label">{{ $menuItem['label'] }}</span>
@if ($menuItem['tracks_proxy_configuration'] ?? false)
<x-reicon name="alert-triangle" x-cloak
x-show="proxyConfigurationPending || traefikOutdated || proxyNotRunning"
class="ml-auto size-3.5 shrink-0 text-orange-500 dark:text-warning" />
@elseif ($menuItem['tracks_sentinel_status'] ?? false)
<x-reicon name="alert-triangle" x-cloak x-show="sentinelOutOfSync"
class="ml-auto size-3.5 shrink-0 text-orange-500 dark:text-warning" />
@elseif ($menuItem['warning'] ?? false)
<x-reicon name="alert-triangle"
class="ml-auto size-3.5 shrink-0 text-orange-500 dark:text-warning" />
@elseif ($menuItem['beta'] ?? false)
<x-beta-badge class="ml-auto shrink-0" />
@endif
</a>
@if ($menuItem['active'] && isset($menuItem['children']))
<div class="col-span-full grid grid-cols-1 gap-0.5 border-l border-neutral-200 pl-2 dark:border-white/[0.08]">
@foreach (collect($menuItem['children'])->filter(fn (array $child): bool => $child['visible'] ?? true) as $child)
<a wire:key="{{ $placement }}-server-settings-child-{{ str($menuItem['label'].'-'.$child['label'])->slug() }}"
@class(['menu-item', 'menu-item-active' => $child['active']])
@if ($child['navigate'] ?? true) {{ wireNavigate() }} @endif
href="{{ route($child['route'], $serverRouteParameters) }}">
<x-reicon :name="$child['icon']" class="menu-item-icon" />
<span class="menu-item-label">{{ $child['label'] }}</span>
@if ($child['beta'] ?? false)
<x-beta-badge class="ml-auto shrink-0" />
@endif
</a>
@endforeach
</div>
@endif
</a>
@if ($menuItem['active'] && isset($menuItem['children']))
<div class="col-span-full grid grid-cols-1 gap-0.5 border-l border-neutral-200 pl-2 dark:border-white/[0.08]">
@foreach (collect($menuItem['children'])->filter(fn (array $child): bool => $child['visible'] ?? true) as $child)
<a wire:key="{{ $placement }}-server-settings-child-{{ str($menuItem['label'].'-'.$child['label'])->slug() }}"
@class(['menu-item', 'menu-item-active' => $child['active']])
@if ($child['navigate'] ?? true) {{ wireNavigate() }} @endif
href="{{ route($child['route'], $serverRouteParameters) }}">
<x-reicon :name="$child['icon']" class="menu-item-icon" />
<span class="menu-item-label">{{ $child['label'] }}</span>
@if ($child['beta'] ?? false)
<x-beta-badge class="ml-auto shrink-0" />
@endif
</a>
@endforeach
</div>
@endif
@endforeach
@endforeach