From e26f4ce707eb869147413d89a220d7eb2fa71041 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 29 May 2024 11:13:22 +0200 Subject: [PATCH] chore: Update deployment index.blade.php script for better performance --- .../application/deployment/index.blade.php | 73 +++++++++---------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/resources/views/livewire/project/application/deployment/index.blade.php b/resources/views/livewire/project/application/deployment/index.blade.php index c944efd97..41b11dc3b 100644 --- a/resources/views/livewire/project/application/deployment/index.blade.php +++ b/resources/views/livewire/project/application/deployment/index.blade.php @@ -105,48 +105,43 @@ @endforelse @if ($deployments_count > 0) - @assets - - - - @endassets - @script - + + + - @endscript + if (status === 'in_progress') { + timers[uuid] = setInterval(() => { + this.finished_time = dayjs().diff(dayjs.utc(created_at), + 'second') + 's' + }, 1000); + } else { + let seconds = dayjs.utc(updated_at).diff(dayjs.utc(created_at), 'second') + this.finished_time = seconds + 's'; + } + }, + measure_finished_time() { + return this.finished_time; + }, + measure_since_started() { + return dayjs.utc(created_at).fromNow(); + } + })) + @endif -