blob: d1b2da4d115e86ed3b69575a33cd08d30d1aba7a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
<script>
import { GlIcon } from '@gitlab/ui';
import { durationTimeFormatted } from '~/lib/utils/datetime_utility';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import timeagoMixin from '~/vue_shared/mixins/timeago';
export default {
iconSize: 12,
components: {
GlIcon,
TimeAgoTooltip,
},
mixins: [timeagoMixin],
props: {
job: {
type: Object,
required: true,
},
},
computed: {
finishedTime() {
return this.job?.finishedAt;
},
duration() {
return this.job?.duration;
},
durationFormatted() {
return durationTimeFormatted(this.duration);
},
},
};
</script>
<template>
<div>
<div v-if="duration" data-testid="job-duration">
<gl-icon name="timer" :size="$options.iconSize" data-testid="duration-icon" />
{{ durationFormatted }}
</div>
<div v-if="finishedTime" data-testid="job-finished-time">
<gl-icon name="calendar" :size="$options.iconSize" data-testid="finished-time-icon" />
<time-ago-tooltip :time="finishedTime" />
</div>
</div>
</template>
|