fix(logs): keep stream polling active without collapsible panel
Move log stream polling off the loading indicator so non-collapsible log panels continue polling while streaming, and cover the behavior with a Livewire feature test.
This commit is contained in:
parent
fcd63f40eb
commit
182df1cb07
2 changed files with 18 additions and 1 deletions
|
|
@ -274,10 +274,13 @@
|
||||||
<div>({{ $pull_request }})</div>
|
<div>({{ $pull_request }})</div>
|
||||||
@endif
|
@endif
|
||||||
@if ($streamLogs)
|
@if ($streamLogs)
|
||||||
<x-loading wire:poll.2000ms='getLogs(true)' />
|
<x-loading />
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
@if ($streamLogs)
|
||||||
|
<div class="sr-only" wire:poll.2000ms="getLogs(true)" aria-hidden="true"></div>
|
||||||
|
@endif
|
||||||
<div x-show="expanded" {{ $collapsible ? 'x-collapse' : '' }}
|
<div x-show="expanded" {{ $collapsible ? 'x-collapse' : '' }}
|
||||||
:class="fullscreen ? 'fullscreen flex flex-col !overflow-visible' : 'relative w-full {{ $collapsible ? 'py-4' : '' }} mx-auto'"
|
:class="fullscreen ? 'fullscreen flex flex-col !overflow-visible' : 'relative w-full {{ $collapsible ? 'py-4' : '' }} mx-auto'"
|
||||||
:style="fullscreen ? 'max-height: none !important; height: 100% !important;' : ''">
|
:style="fullscreen ? 'max-height: none !important; height: 100% !important;' : ''">
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,20 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('GetLogs stream polling', function () {
|
||||||
|
test('streaming logs polls when log panel is not collapsible', function () {
|
||||||
|
Livewire::test(GetLogs::class, [
|
||||||
|
'server' => $this->server,
|
||||||
|
'resource' => $this->application,
|
||||||
|
'container' => 'coolify-sentinel',
|
||||||
|
'collapsible' => false,
|
||||||
|
])
|
||||||
|
->assertDontSeeHtml('wire:poll.2000ms="getLogs(true)"')
|
||||||
|
->call('toggleStreamLogs')
|
||||||
|
->assertSeeHtml('wire:poll.2000ms="getLogs(true)"');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('GetLogs container name injection payloads are blocked by validation', function () {
|
describe('GetLogs container name injection payloads are blocked by validation', function () {
|
||||||
test('newline injection payload is rejected', function () {
|
test('newline injection payload is rejected', function () {
|
||||||
// The exact PoC payload from the advisory
|
// The exact PoC payload from the advisory
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue