diff --git a/app/Livewire/Shell/FleetStatus.php b/app/Livewire/Shell/FleetStatus.php new file mode 100644 index 0000000..9441337 --- /dev/null +++ b/app/Livewire/Shell/FleetStatus.php @@ -0,0 +1,21 @@ + Server::where('status', 'online')->count(), + 'total' => Server::count(), + ]); + } +} diff --git a/resources/views/components/topbar.blade.php b/resources/views/components/topbar.blade.php index 87898ef..6ef71d4 100644 --- a/resources/views/components/topbar.blade.php +++ b/resources/views/components/topbar.blade.php @@ -22,10 +22,7 @@ {{ __('shell.shortcut_ctrl_k') }} - @php - $fleetTotal = \App\Models\Server::count(); - $fleetOnline = \App\Models\Server::where('status', 'online')->count(); - @endphp - {{ __('shell.fleet_online', ['online' => $fleetOnline, 'total' => $fleetTotal]) }} + {{-- Live-polled island so the online count updates when a server goes up/down (not just on nav). --}} + diff --git a/resources/views/livewire/alerts/index.blade.php b/resources/views/livewire/alerts/index.blade.php index 4a0e4cb..568a7c3 100644 --- a/resources/views/livewire/alerts/index.blade.php +++ b/resources/views/livewire/alerts/index.blade.php @@ -10,7 +10,8 @@ }; @endphp -
+{{-- Poll so firing/resolved incidents appear live, matching the dashboard, without a manual refresh. --}} +
{{-- Header --}}

{{ __('alerts.eyebrow') }}

@@ -140,7 +141,7 @@
diff --git a/resources/views/livewire/server-switcher.blade.php b/resources/views/livewire/server-switcher.blade.php index 32820fd..756dc47 100644 --- a/resources/views/livewire/server-switcher.blade.php +++ b/resources/views/livewire/server-switcher.blade.php @@ -1,4 +1,6 @@ -
+{{-- Poll so the active + fleet status dots reflect a server going up/down live (Livewire morph keeps + the Alpine `open` dropdown state across re-renders). --}} +
@foreach ($groups as $g)
{{ $u->role?->label() ?? __('settings.role_admin') }} diff --git a/resources/views/livewire/shell/fleet-status.blade.php b/resources/views/livewire/shell/fleet-status.blade.php new file mode 100644 index 0000000..e7fc990 --- /dev/null +++ b/resources/views/livewire/shell/fleet-status.blade.php @@ -0,0 +1,3 @@ +
+ {{ __('shell.fleet_online', ['online' => $online, 'total' => $total]) }} +