Skip to content

Commit

Permalink
Improved: displaying the job time on the Job Configuration card accor…
Browse files Browse the repository at this point in the history
…ding to the history segment (hotwax#680)
  • Loading branch information
R-Sourabh committed Oct 29, 2024
1 parent 3f2f3f6 commit 89b8b4a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/JobConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<ion-button fill="outline" slot="end" v-if="isRefreshRequired" @click="refreshCurrentJob">
<ion-icon :icon="refreshOutline" slot="icon-only" />
</ion-button>
<ion-badge slot="end" color="dark" v-if="currentJob?.runTime && currentJob.statusId !== 'SERVICE_DRAFT' && !isRefreshRequired">{{ translate("running") }} {{ timeTillJob(currentJob.runTime) }}</ion-badge>
<ion-badge slot="end" color="dark" v-if="currentJob.cancelDateTime || currentJob.finishDateTime">{{ currentJob.statusId == "SERVICE_CANCELLED" || currentJob.statusId == "SERVICE_CRASHED" ? timeFromNow(currentJob.cancelDateTime) : timeFromNow(currentJob.finishDateTime) }}</ion-badge>
<ion-badge slot="end" color="dark" v-else-if="currentJob?.runTime && currentJob.statusId !== 'SERVICE_DRAFT' && !isRefreshRequired">{{ translate("running") }} {{ timeTillJob(currentJob.runTime) }}</ion-badge>
</ion-item>

<ion-list>
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 89b8b4a

Please sign in to comment.