An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat(proxy): show sidebar warning icon when proxy is not running
Andras Bacsai0db2eae8deb2
diff --git a/app/Livewire/Server/Navbar.php b/app/Livewire/Server/Navbar.phpindex b64adf10a3..545494db51 100644--- a/app/Livewire/Server/Navbar.php+++ b/app/Livewire/Server/Navbar.php@@ -258,6 +258,7 @@ class Navbar extends Component'proxy-configuration-state-changed',pending: $this->server->hasPendingProxyConfiguration(),traefikOutdated: $this->server->hasCurrentTraefikOutdatedInfo(),+ proxyNotRunning: $this->server->proxySet() && ($this->server->proxy->status ?? 'unknown') !== 'running',);}diff --git a/resources/views/components/server/sidebar.blade.php b/resources/views/components/server/sidebar.blade.phpindex 65fe3cabbc..3645dd2a27 100644--- a/resources/views/components/server/sidebar.blade.php+++ b/resources/views/components/server/sidebar.blade.php@@ -3,6 +3,7 @@@php$serverRouteParameters = ['server_uuid' => $server->uuid];$sentinelStatus = $server->sentinelStatus();+ $proxyNotRunning = $server->proxySet() && ($server->proxy->status ?? 'unknown') !== 'running';$sentinelStatusStartedAt = $server->sentinel_waiting_since ?? \Illuminate\Support\Carbon::parse($server->sentinel_updated_at);$sentinelTimeoutSeconds = $server->sentinel_waiting_since !== null? $server->firstSentinelReportTimeoutSeconds()@@ -199,6 +200,7 @@x-data="{proxyConfigurationPending: @js($server->hasPendingProxyConfiguration()),traefikOutdated: @js($server->hasCurrentTraefikOutdatedInfo()),+ proxyNotRunning: @js($proxyNotRunning),sentinelOutOfSync: @js($server->isSentinelEnabled() && $sentinelStatus === 'out_of_sync'),sentinelExpiryTimer: null,scheduleSentinelExpiry(delay) {@@ -212,6 +214,7 @@@proxy-configuration-state-changed.window="proxyConfigurationPending = $event.detail.pending;traefikOutdated = $event.detail.traefikOutdated;+ proxyNotRunning = $event.detail.proxyNotRunning;"@sentinel-status-changed.window="sentinelOutOfSync = $event.detail.outOfSync;@@ -247,7 +250,7 @@<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"+ 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"diff --git a/tests/Feature/Proxy/RestartProxyTest.php b/tests/Feature/Proxy/RestartProxyTest.phpindex d60a3b19b5..c554d9cf15 100644--- a/tests/Feature/Proxy/RestartProxyTest.php+++ b/tests/Feature/Proxy/RestartProxyTest.php@@ -135,6 +135,26 @@ test('running proxy hides pending configuration warning when saved settings matc->assertSee('Your configuration changed, please restart the proxy.');});+test('navbar tells the sidebar when the proxy is not running', function () {+ [$user, $team, $server] = setupProxyUser('admin');+ makeServerProxyRunning($server);++ $this->actingAs($user);+ session(['currentTeam' => $team]);++ $component = Livewire::test('server.navbar', ['server' => $server->fresh()]);++ $component->call('showNotification')+ ->assertDispatched('proxy-configuration-state-changed', proxyNotRunning: false);++ $server->refresh();+ $server->proxy->status = 'exited';+ $server->save();++ $component->call('showNotification')+ ->assertDispatched('proxy-configuration-state-changed', proxyNotRunning: true);+});+test('admin can stop a proxy while it is starting', function () {[$user, $team, $server] = setupProxyUser('admin');diff --git a/tests/Feature/ServerSidebarIconsTest.php b/tests/Feature/ServerSidebarIconsTest.phpindex bdc9cdaddd..9592105ef2 100644--- a/tests/Feature/ServerSidebarIconsTest.php+++ b/tests/Feature/ServerSidebarIconsTest.php@@ -62,6 +62,9 @@ it('shows a warning icon when a server menu item requires attention', function (->toContain('proxyConfigurationPending: @js($server->hasPendingProxyConfiguration()),')->toContain('traefikOutdated: @js($server->hasCurrentTraefikOutdatedInfo())')->toContain('@proxy-configuration-state-changed.window')+ ->toContain('proxyNotRunning: @js($proxyNotRunning)')+ ->toContain('proxyNotRunning = $event.detail.proxyNotRunning')+ ->toContain('x-show="proxyConfigurationPending || traefikOutdated || proxyNotRunning"')->toContain('@sentinel-status-changed.window')->toContain('sentinelOutOfSync = $event.detail.outOfSync')->toContain('scheduleSentinelExpiry($event.detail.expiresInMilliseconds)')