debian-mirror-gitlab/app/assets/javascripts/jobs/components/job_container_item.vue

70 lines
1.4 KiB
Vue
Raw Normal View History

2018-12-13 13:39:08 +05:30
<script>
2021-01-03 14:25:43 +05:30
import { GlLink, GlIcon, GlTooltipDirective } from '@gitlab/ui';
2018-12-13 13:39:08 +05:30
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import delayedJobMixin from '~/jobs/mixins/delayed_job_mixin';
import { sprintf } from '~/locale';
export default {
components: {
CiIcon,
2020-11-24 15:15:51 +05:30
GlIcon,
2018-12-13 13:39:08 +05:30
GlLink,
},
directives: {
2021-01-03 14:25:43 +05:30
GlTooltip: GlTooltipDirective,
2018-12-13 13:39:08 +05:30
},
mixins: [delayedJobMixin],
props: {
job: {
type: Object,
required: true,
},
isActive: {
type: Boolean,
required: true,
},
},
computed: {
tooltipText() {
const { name, status } = this.job;
const text = `${name} - ${status.tooltip}`;
if (this.isDelayedJob) {
return sprintf(text, { remainingTime: this.remainingTime });
}
return text;
},
},
};
</script>
<template>
<div
2019-07-31 22:56:46 +05:30
class="build-job position-relative"
2018-12-13 13:39:08 +05:30
:class="{
retried: job.retried,
2019-02-15 15:39:39 +05:30
active: isActive,
2018-12-13 13:39:08 +05:30
}"
>
<gl-link
2021-01-03 14:25:43 +05:30
v-gl-tooltip
2018-12-13 13:39:08 +05:30
:href="job.status.details_path"
:title="tooltipText"
2019-12-21 20:55:43 +05:30
class="js-job-link d-flex"
2018-12-13 13:39:08 +05:30
>
2020-11-24 15:15:51 +05:30
<gl-icon
2019-07-31 22:56:46 +05:30
v-if="isActive"
name="arrow-right"
class="js-arrow-right icon-arrow-right position-absolute d-block"
/>
2018-12-13 13:39:08 +05:30
<ci-icon :status="job.status" />
2019-12-21 20:55:43 +05:30
<span class="text-truncate w-100">{{ job.name ? job.name : job.id }}</span>
2018-12-13 13:39:08 +05:30
2020-11-24 15:15:51 +05:30
<gl-icon v-if="job.retried" name="retry" class="js-retry-icon" />
2018-12-13 13:39:08 +05:30
</gl-link>
</div>
</template>