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

73 lines
1.5 KiB
Vue
Raw Normal View History

2018-12-13 13:39:08 +05:30
<script>
2019-02-15 15:39:39 +05:30
import { GlLink } from '@gitlab/ui';
2018-12-13 13:39:08 +05:30
import tooltip from '~/vue_shared/directives/tooltip';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Icon from '~/vue_shared/components/icon.vue';
import delayedJobMixin from '~/jobs/mixins/delayed_job_mixin';
import { sprintf } from '~/locale';
export default {
components: {
CiIcon,
Icon,
GlLink,
},
directives: {
tooltip,
},
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
v-tooltip
:href="job.status.details_path"
:title="tooltipText"
data-boundary="viewport"
2019-12-21 20:55:43 +05:30
class="js-job-link d-flex"
2018-12-13 13:39:08 +05:30
>
2019-07-31 22:56:46 +05:30
<icon
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
2019-02-15 15:39:39 +05:30
<icon v-if="job.retried" name="retry" class="js-retry-icon" />
2018-12-13 13:39:08 +05:30
</gl-link>
</div>
</template>