Skip to content

Commit f0fbaf3

Browse files
authored
Fix logs not loading for single container services (#7509)
2 parents b299ceb + a0884b7 commit f0fbaf3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/Livewire/Project/Shared/GetLogs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function getLogs($refresh = false)
122122
if (! $this->server->isFunctional()) {
123123
return;
124124
}
125-
if (! $refresh && ($this->resource?->getMorphClass() === \App\Models\Service::class || str($this->container)->contains('-pr-'))) {
125+
if (! $refresh && ! $this->expandByDefault && ($this->resource?->getMorphClass() === \App\Models\Service::class || str($this->container)->contains('-pr-'))) {
126126
return;
127127
}
128128
if ($this->numberOfLines <= 0 || is_null($this->numberOfLines)) {

resources/views/livewire/project/shared/get-logs.blade.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div id="screen" x-data="{
33
collapsible: {{ $collapsible ? 'true' : 'false' }},
44
expanded: {{ ($expandByDefault || !$collapsible) ? 'true' : 'false' }},
5-
logsLoaded: {{ ($expandByDefault || !$collapsible) ? 'true' : 'false' }},
5+
logsLoaded: false,
66
fullscreen: false,
77
alwaysScroll: false,
88
intervalId: null,
@@ -156,7 +156,10 @@
156156
URL.revokeObjectURL(url);
157157
},
158158
init() {
159-
if (this.expanded) { this.$wire.getLogs(); }
159+
if (this.expanded) {
160+
this.$wire.getLogs();
161+
this.logsLoaded = true;
162+
}
160163
// Re-render logs after Livewire updates
161164
Livewire.hook('commit', ({ succeed }) => {
162165
succeed(() => {

0 commit comments

Comments
 (0)