From 89b8b4a69e70f5c4806e690d0911b186b26b25b8 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Tue, 29 Oct 2024 14:21:19 +0530 Subject: [PATCH] Improved: displaying the job time on the Job Configuration card according to the history segment (#680) --- src/components/JobConfiguration.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/JobConfiguration.vue b/src/components/JobConfiguration.vue index 5543b0c6..835f2abe 100644 --- a/src/components/JobConfiguration.vue +++ b/src/components/JobConfiguration.vue @@ -6,7 +6,8 @@ - {{ translate("running") }} {{ timeTillJob(currentJob.runTime) }} + {{ currentJob.statusId == "SERVICE_CANCELLED" || currentJob.statusId == "SERVICE_CRASHED" ? timeFromNow(currentJob.cancelDateTime) : timeFromNow(currentJob.finishDateTime) }} + {{ translate("running") }} {{ timeTillJob(currentJob.runTime) }} @@ -483,6 +484,10 @@ export default defineComponent({ const timeDiff = DateTime.fromMillis(time).diff(DateTime.local()); return DateTime.local().plus(timeDiff).toRelative(); }, + timeFromNow (time: any) { + const timeDiff = DateTime.fromMillis(time).diff(DateTime.local()); + return DateTime.local().plus(timeDiff).toRelative(); + }, async viewJobHistory(job: any) { const jobHistoryModal = await modalController.create({ component: JobHistoryModal,