mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
fix(server): remove patch summary from server list header
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f5c8cb6ab4
commit
0d3f6d5dbe
@@ -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>
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user