Skip to content

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.

fix(server): remove patch summary from server list header

Andras Bacsai0d3f6d5dbeec
diff --git a/resources/views/livewire/server/index.blade.php b/resources/views/livewire/server/index.blade.php
index c6905cdde2..0b9469dc08 100644
--- a/resources/views/livewire/server/index.blade.php
+++ b/resources/views/livewire/server/index.blade.php
@@ -77,16 +77,6 @@
$patchStatuses = $serverRows->pluck('patchStatus')->filter();
$showPatches = $patchStatuses->isNotEmpty();
- $withUpdates = $patchStatuses->where('updates', '>', 0)->count();
- $withSecurityUpdates = $patchStatuses->where('security', '>', 0)->count();
- $needReboot = $patchStatuses->where('rebootRequired', true)->count();
- $failedChecks = $patchStatuses->where('failed', true)->count();
- $patchSummary = collect([
- $withUpdates > 0 ? $withUpdates.' '.str('server')->plural($withUpdates).' with updates' : null,
- $withSecurityUpdates > 0 ? $withSecurityUpdates.' with security updates' : null,
- $needReboot > 0 ? $needReboot.' '.($needReboot === 1 ? 'needs' : 'need').' a reboot' : null,
- $failedChecks > 0 ? $failedChecks.' '.str('check')->plural($failedChecks).' failed' : null,
- ])->filter()->join(' · ');
@endphp
<div x-data="{
@@ -125,9 +115,6 @@
</div>
<div class="flex flex-wrap items-center gap-3 sm:justify-end">
- @if (filled($patchSummary))
- <p class="text-[12px] text-neutral-500 dark:text-fg-dim">Patches: {{ $patchSummary }}</p>
- @endif
<x-canvas-view-toggle :list-url="route('server.index')"
:canvas-url="route('server.canvas.index')" />
</div>
diff --git a/tests/Feature/Server/ServerListPatchStatusTest.php b/tests/Feature/Server/ServerListPatchStatusTest.php
index 02c6bf018d..50f1758a5d 100644
--- a/tests/Feature/Server/ServerListPatchStatusTest.php
+++ b/tests/Feature/Server/ServerListPatchStatusTest.php
@@ -112,7 +112,7 @@ describe('server list', function () {
serverListPatchServer($this, 'unchecked-host');
});
- it('shows patch badges and the team summary to an admin', function () {
+ it('shows patch badges to an admin', function () {
serverListPatchActingAs($this, 'admin');
Livewire::test(Index::class)
@@ -120,21 +120,20 @@ describe('server list', function () {
->assertSee('2 updates')
->assertSee('Reboot required')
->assertSee('Patch check failed')
- ->assertSee('Patches: 2 servers with updates · 1 with security updates · 1 needs a reboot · 1 check failed');
+ ->assertDontSee('Patches:');
});
- it('hides patch badges and the summary from a member', function () {
+ it('hides patch badges from a member', function () {
serverListPatchActingAs($this, 'member');
Livewire::test(Index::class)
->assertSee('secure-host')
->assertDontSee('security update')
->assertDontSee('Reboot required')
- ->assertDontSee('Patch check failed')
- ->assertDontSee('Patches:');
+ ->assertDontSee('Patch check failed');
});
- it('hides the summary when every checked server is up to date', function () {
+ it('shows up to date when every checked server has no updates', function () {
Server::query()->each(fn (Server $server) => $server->settings->forceFill([
'patch_check_result' => serverListPatchResult(0, 0, false),
'patch_check_error' => null,
@@ -143,7 +142,6 @@ describe('server list', function () {
serverListPatchActingAs($this, 'admin');
Livewire::test(Index::class)
- ->assertSee('Up to date')
- ->assertDontSee('Patches:');
+ ->assertSee('Up to date');
});
});