2018-11-20 20:47:30 +05:30
|
|
|
<script>
|
2019-02-13 22:33:31 +05:30
|
|
|
import { GlLink } from '@gitlab/ui';
|
2018-12-13 13:39:08 +05:30
|
|
|
import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
|
|
|
|
import timeagoMixin from '~/vue_shared/mixins/timeago';
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
TimeagoTooltip,
|
|
|
|
GlLink,
|
|
|
|
},
|
|
|
|
mixins: [timeagoMixin],
|
|
|
|
props: {
|
|
|
|
artifact: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
2018-11-20 20:47:30 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isExpired() {
|
|
|
|
return this.artifact.expired;
|
2018-12-05 23:21:45 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
// Only when the key is `false` we can render this block
|
|
|
|
willExpire() {
|
|
|
|
return this.artifact.expired === false;
|
2018-11-20 20:47:30 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
},
|
|
|
|
};
|
2018-11-20 20:47:30 +05:30
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<div class="block">
|
2019-02-13 22:33:31 +05:30
|
|
|
<div class="title font-weight-bold">{{ s__('Job|Job artifacts') }}</div>
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2019-01-03 12:48:30 +05:30
|
|
|
<p
|
2019-02-13 22:33:31 +05:30
|
|
|
v-if="isExpired || willExpire"
|
|
|
|
:class="{
|
|
|
|
'js-artifacts-removed': isExpired,
|
|
|
|
'js-artifacts-will-be-removed': willExpire,
|
|
|
|
}"
|
|
|
|
class="build-detail-row"
|
2019-01-03 12:48:30 +05:30
|
|
|
>
|
2019-02-13 22:33:31 +05:30
|
|
|
<span v-if="isExpired">{{ s__('Job|The artifacts were removed') }}</span>
|
|
|
|
<span v-if="willExpire">{{ s__('Job|The artifacts will be removed') }}</span>
|
|
|
|
<timeago-tooltip v-if="artifact.expire_at" :time="artifact.expire_at" />
|
2018-11-20 20:47:30 +05:30
|
|
|
</p>
|
2018-12-05 23:21:45 +05:30
|
|
|
|
2019-02-13 22:33:31 +05:30
|
|
|
<div class="btn-group d-flex prepend-top-10" role="group">
|
2018-12-13 13:39:08 +05:30
|
|
|
<gl-link
|
2018-12-05 23:21:45 +05:30
|
|
|
v-if="artifact.keep_path"
|
|
|
|
:href="artifact.keep_path"
|
2018-11-20 20:47:30 +05:30
|
|
|
class="js-keep-artifacts btn btn-sm btn-default"
|
|
|
|
data-method="post"
|
2019-02-13 22:33:31 +05:30
|
|
|
>{{ s__('Job|Keep') }}</gl-link
|
2018-11-20 20:47:30 +05:30
|
|
|
>
|
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
<gl-link
|
2018-12-05 23:21:45 +05:30
|
|
|
v-if="artifact.download_path"
|
|
|
|
:href="artifact.download_path"
|
2018-11-20 20:47:30 +05:30
|
|
|
class="js-download-artifacts btn btn-sm btn-default"
|
|
|
|
download
|
|
|
|
rel="nofollow"
|
2019-02-13 22:33:31 +05:30
|
|
|
>{{ s__('Job|Download') }}</gl-link
|
2018-11-20 20:47:30 +05:30
|
|
|
>
|
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
<gl-link
|
2018-12-05 23:21:45 +05:30
|
|
|
v-if="artifact.browse_path"
|
|
|
|
:href="artifact.browse_path"
|
2018-11-20 20:47:30 +05:30
|
|
|
class="js-browse-artifacts btn btn-sm btn-default"
|
2019-02-13 22:33:31 +05:30
|
|
|
>{{ s__('Job|Browse') }}</gl-link
|
2018-11-20 20:47:30 +05:30
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|