diff --git a/resources/js/runtime-logs.js b/resources/js/runtime-logs.js index ad50b2ffbf..c5ff280f33 100644 --- a/resources/js/runtime-logs.js +++ b/resources/js/runtime-logs.js @@ -158,6 +158,9 @@ export function initializeRuntimeLogsComponent() { containerName: config.containerName ?? 'logs', findShortcutLabel: /Mac|iPhone|iPad/.test(navigator.platform) ? '⌘F' : 'Ctrl+F', logsLoaded: false, + allLines: false, + loadingAll: false, + loadingLines: false, loading: false, fullscreen: false, alwaysScroll: false, @@ -178,6 +181,7 @@ export function initializeRuntimeLogsComponent() { scrollMargin: 0, init() { + this.allLines = Number(this.$wire.numberOfLines) === -1; this.$watch('searchQuery', () => this.applyFilters()); this.$nextTick(() => this.mountVirtualizer()); streamTimer = setInterval(() => this.streamTick(), STREAM_INTERVAL_MS); @@ -257,13 +261,26 @@ export function initializeRuntimeLogsComponent() { } }, + async refreshLines() { + if (this.loading) return; + this.loadingLines = true; + try { + await this.refresh(); + } finally { + this.loadingLines = false; + } + }, + async showAllLogs() { if (this.loading) return; this.loading = true; + this.loadingAll = true; try { this.replaceLines(await this.$wire.showAllLogs()); + this.allLines = true; } finally { this.loading = false; + this.loadingAll = false; } }, diff --git a/resources/views/livewire/project/shared/get-logs.blade.php b/resources/views/livewire/project/shared/get-logs.blade.php index 407e2da96b..2fad7cfa7a 100644 --- a/resources/views/livewire/project/shared/get-logs.blade.php +++ b/resources/views/livewire/project/shared/get-logs.blade.php @@ -215,15 +215,23 @@
-
- Lines - + + Lines + + + + :class="allLines ? 'runtime-log-lines-all-active' : ''" + :aria-pressed="allLines" :aria-busy="loadingAll" + class="runtime-log-lines-all relative" {{ $streamLogs ? 'disabled' : '' }}> + All + +