From d01486ce42f2ae78d3deb5469a9aa9ba4f33d1b9 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 8 Jun 2023 09:23:25 +0200 Subject: [PATCH] fix deployment status --- app/Jobs/ApplicationDeploymentJob.php | 5 +++++ .../project/application/deployment-logs.blade.php | 3 +-- .../project/application/deployment-navbar.blade.php | 3 ++- .../project/application/deployments.blade.php | 12 ++++++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 90e8b176f..92c057a5f 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -273,9 +273,14 @@ COPY --from=$this->build_image_name /app/{$this->application->publish_directory} private function next(string $status) { if (!Str::of($this->application_deployment_queue->status)->startsWith('cancelled')) { + ray('Next Status: ' . $status); $this->application_deployment_queue->update([ 'status' => $status, ]); + $this->activity->properties = $this->activity->properties->merge([ + 'status' => $status, + ]); + $this->activity->save(); } dispatch(new ApplicationContainerStatusJob( application: $this->application, diff --git a/resources/views/livewire/project/application/deployment-logs.blade.php b/resources/views/livewire/project/application/deployment-logs.blade.php index 61d4842fd..8631760c0 100644 --- a/resources/views/livewire/project/application/deployment-logs.blade.php +++ b/resources/views/livewire/project/application/deployment-logs.blade.php @@ -1,12 +1,11 @@
-

Logs

@if (data_get($activity, 'properties.status') === 'in_progress')
Deployment is
{{ Str::headline(data_get($activity, 'properties.status')) }}.
-
Logs will be updated automatically.
+
Logs will be updated automatically.
@else
Deployment is {{ Str::headline(data_get($activity, 'properties.status')) }}. diff --git a/resources/views/livewire/project/application/deployment-navbar.blade.php b/resources/views/livewire/project/application/deployment-navbar.blade.php index 28d059748..5d91531ce 100644 --- a/resources/views/livewire/project/application/deployment-navbar.blade.php +++ b/resources/views/livewire/project/application/deployment-navbar.blade.php @@ -1,4 +1,5 @@ -
+
+

Logs

@if (data_get($activity, 'properties.status') === 'in_progress') Cancel deployment @else diff --git a/resources/views/livewire/project/application/deployments.blade.php b/resources/views/livewire/project/application/deployments.blade.php index 05200acde..67765c35e 100644 --- a/resources/views/livewire/project/application/deployments.blade.php +++ b/resources/views/livewire/project/application/deployments.blade.php @@ -48,14 +48,18 @@
@endif
-
Finished 0s in 0s
+
+ @if ($deployment->status !== 'in_progress') + Finished 0s in + @else + Running for + @endif + 0s +
@endforeach - -