From fe6e76ad0db2d8b8906cb345a587f3abb3374a45 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 11 Dec 2023 15:09:36 +0100 Subject: [PATCH] fix --- app/Livewire/Project/Shared/GetLogs.php | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Livewire/Project/Shared/GetLogs.php b/app/Livewire/Project/Shared/GetLogs.php index 220c6b9af..e6f1ab009 100644 --- a/app/Livewire/Project/Shared/GetLogs.php +++ b/app/Livewire/Project/Shared/GetLogs.php @@ -70,27 +70,27 @@ class GetLogs extends Component } public function getLogs($refresh = false) { - if (!$refresh && $this->resource?->getMorphClass() === 'App\Models\Service') return; - if ($this->container) { - if ($this->showTimeStamps) { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}"); - } else { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} {$this->container}"); - } - if ($refresh) { - $this->outputs = ''; - } - Process::run($sshCommand, function (string $type, string $output) { - $this->doSomethingWithThisChunkOfOutput($output); - }); - if ($this->showTimeStamps) { - $this->outputs = str($this->outputs)->split('/\n/')->sort(function ($a, $b) { - $a = explode(' ', $a); - $b = explode(' ', $b); - return $a[0] <=> $b[0]; - })->join("\n"); - } + if (!$refresh && $this->resource?->getMorphClass() === 'App\Models\Service') return; + if ($this->container) { + if ($this->showTimeStamps) { + $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}"); + } else { + $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} {$this->container}"); } + if ($refresh) { + $this->outputs = ''; + } + Process::run($sshCommand, function (string $type, string $output) { + $this->doSomethingWithThisChunkOfOutput($output); + }); + if ($this->showTimeStamps) { + $this->outputs = str($this->outputs)->split('/\n/')->sort(function ($a, $b) { + $a = explode(' ', $a); + $b = explode(' ', $b); + return $a[0] <=> $b[0]; + })->join("\n"); + } + } } public function render() {