diff --git a/app/Livewire/Project/Application/Deployment/Show.php b/app/Livewire/Project/Application/Deployment/Show.php index 4b2904594..f2968f6d9 100644 --- a/app/Livewire/Project/Application/Deployment/Show.php +++ b/app/Livewire/Project/Application/Deployment/Show.php @@ -13,8 +13,6 @@ class Show extends Component public ApplicationDeploymentQueue $application_deployment_queue; - public Collection $logLines; - public string $deployment_uuid; public $isKeepAliveOn = true; @@ -56,13 +54,11 @@ class Show extends Component $this->application = $application; $this->application_deployment_queue = $application_deployment_queue; $this->deployment_uuid = $deploymentUuid; - $this->buildLogLines(); } public function refreshQueue() { $this->application_deployment_queue->refresh(); - $this->buildLogLines(); } public function polling() @@ -72,17 +68,11 @@ class Show extends Component if (data_get($this->application_deployment_queue, 'status') == 'finished' || data_get($this->application_deployment_queue, 'status') == 'failed') { $this->isKeepAliveOn = false; } - $this->buildLogLines(); } - public function render() + public function getLogLinesProperty() { - return view('livewire.project.application.deployment.show'); - } - - private function buildLogLines() - { - $this->logLines = decode_remote_command_output($this->application_deployment_queue)->map(function ($logLine) { + return decode_remote_command_output($this->application_deployment_queue)->map(function ($logLine) { $logLine['line'] = e($logLine['line']); $logLine['line'] = preg_replace( '/(https?:\/\/[^\s]+)/', @@ -93,4 +83,9 @@ class Show extends Component return $logLine; }); } + + public function render() + { + return view('livewire.project.application.deployment.show'); + } } diff --git a/resources/views/livewire/project/application/deployment/show.blade.php b/resources/views/livewire/project/application/deployment/show.blade.php index bc8ab3f34..5ba0be0a2 100644 --- a/resources/views/livewire/project/application/deployment/show.blade.php +++ b/resources/views/livewire/project/application/deployment/show.blade.php @@ -93,7 +93,7 @@
- @forelse ($logLines as $line) + @forelse ($this->logLines as $line)
$line['command'] ?? false,