feat(executions): add 'Load All' button to view all logs and implement loadAllLogs method for complete log retrieval
This commit is contained in:
@@ -105,6 +105,19 @@ class Executions extends Component
|
|||||||
$this->currentPage++;
|
$this->currentPage++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function loadAllLogs()
|
||||||
|
{
|
||||||
|
if (! $this->selectedExecution || ! $this->selectedExecution->message) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$lines = collect(explode("\n", $this->selectedExecution->message));
|
||||||
|
$totalLines = $lines->count();
|
||||||
|
$totalPages = ceil($totalLines / $this->logsPerPage);
|
||||||
|
|
||||||
|
$this->currentPage = $totalPages;
|
||||||
|
}
|
||||||
|
|
||||||
public function getLogLinesProperty()
|
public function getLogLinesProperty()
|
||||||
{
|
{
|
||||||
if (! $this->selectedExecution) {
|
if (! $this->selectedExecution) {
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
}">
|
}">
|
||||||
@forelse($executions as $execution)
|
@forelse($executions as $execution)
|
||||||
<a wire:click="selectTask({{ data_get($execution, 'id') }})" @class([
|
<a wire:click="selectTask({{ data_get($execution, 'id') }})" @class([
|
||||||
'flex flex-col border-l-2 transition-colors p-4 cursor-pointer bg-white hover:bg-gray-100 dark:bg-coolgray-100 dark:hover:bg-coolgray-200 text-black dark:text-white',
|
'relative flex flex-col border-l-2 transition-colors p-4 cursor-pointer bg-white hover:bg-gray-100 dark:bg-coolgray-100 dark:hover:bg-coolgray-200 text-black dark:text-white',
|
||||||
'bg-gray-200 dark:bg-coolgray-200' => data_get($execution, 'id') == $selectedKey,
|
'bg-gray-200 dark:bg-coolgray-200' => data_get($execution, 'id') == $selectedKey,
|
||||||
'border-blue-500/50 border-dashed' => data_get($execution, 'status') === 'running',
|
'border-blue-500/50 border-dashed' => data_get($execution, 'status') === 'running',
|
||||||
'border-error' => data_get($execution, 'status') === 'failed',
|
'border-error' => data_get($execution, 'status') === 'failed',
|
||||||
@@ -67,18 +67,22 @@
|
|||||||
@endif
|
@endif
|
||||||
@if ($this->logLines->isNotEmpty())
|
@if ($this->logLines->isNotEmpty())
|
||||||
<div>
|
<div>
|
||||||
|
<div class="max-h-[600px] overflow-y-auto border border-gray-200 dark:border-coolgray-300 rounded p-4 bg-gray-50 dark:bg-coolgray-100 scrollbar">
|
||||||
<pre class="whitespace-pre-wrap">
|
<pre class="whitespace-pre-wrap">
|
||||||
@foreach ($this->logLines as $line)
|
@foreach ($this->logLines as $line)
|
||||||
{{ $line }}
|
{{ $line }}
|
||||||
@endforeach
|
@endforeach
|
||||||
</pre>
|
</pre>
|
||||||
<div class="flex gap-2">
|
</div>
|
||||||
|
<div class="flex gap-2 mt-4">
|
||||||
@if ($this->hasMoreLogs())
|
@if ($this->hasMoreLogs())
|
||||||
<x-forms.button wire:click.prevent="loadMoreLogs" isHighlighted>
|
<x-forms.button wire:click.prevent="loadMoreLogs" isHighlighted>
|
||||||
Load More
|
Load More
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
|
<x-forms.button wire:click.prevent="loadAllLogs">
|
||||||
|
Load All
|
||||||
|
</x-forms.button>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
|
Reference in New Issue
Block a user