2021-11-03 16:40:31 +00:00
|
|
|
<template>
|
2022-10-18 01:24:12 +00:00
|
|
|
<div v-if="pipeline" class="flex text-color w-full">
|
2022-11-14 11:25:58 +00:00
|
|
|
<PipelineStatusIcon :status="pipeline.status" class="flex items-center" />
|
2021-11-23 16:15:50 +00:00
|
|
|
<div class="flex flex-col ml-4 min-w-0">
|
2022-10-18 01:24:12 +00:00
|
|
|
<span class="underline">{{ pipeline.owner }} / {{ pipeline.name }}</span>
|
2021-11-23 16:15:50 +00:00
|
|
|
<span class="whitespace-nowrap overflow-hidden overflow-ellipsis">{{ message }}</span>
|
2021-11-03 16:40:31 +00:00
|
|
|
<div class="flex flex-col mt-2">
|
|
|
|
<div class="flex space-x-2 items-center">
|
|
|
|
<Icon name="since" />
|
2022-02-14 10:02:17 +00:00
|
|
|
<Tooltip>
|
|
|
|
<span>{{ since }}</span>
|
2022-05-16 19:18:48 +00:00
|
|
|
<template #popper
|
|
|
|
><span class="font-bold">{{ $t('created') }}</span> {{ created }}</template
|
|
|
|
>
|
2022-02-14 10:02:17 +00:00
|
|
|
</Tooltip>
|
2021-11-03 16:40:31 +00:00
|
|
|
</div>
|
2022-01-09 01:21:30 +00:00
|
|
|
<div class="flex space-x-2 items-center">
|
|
|
|
<Icon name="duration" />
|
|
|
|
<span>{{ duration }}</span>
|
|
|
|
</div>
|
2021-11-03 16:40:31 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2022-02-14 10:02:17 +00:00
|
|
|
import { Tooltip } from 'floating-vue';
|
2021-11-03 16:40:31 +00:00
|
|
|
import { defineComponent, PropType, toRef } from 'vue';
|
|
|
|
|
|
|
|
import Icon from '~/components/atomic/Icon.vue';
|
2022-10-18 01:24:12 +00:00
|
|
|
import PipelineStatusIcon from '~/components/repo/pipeline/PipelineStatusIcon.vue';
|
|
|
|
import usePipeline from '~/compositions/usePipeline';
|
|
|
|
import { PipelineFeed } from '~/lib/api/types';
|
2021-11-03 16:40:31 +00:00
|
|
|
|
|
|
|
export default defineComponent({
|
2022-10-18 01:24:12 +00:00
|
|
|
name: 'PipelineFeedItem',
|
2021-11-03 16:40:31 +00:00
|
|
|
|
2022-10-18 01:24:12 +00:00
|
|
|
components: { PipelineStatusIcon, Icon, Tooltip },
|
2021-11-03 16:40:31 +00:00
|
|
|
|
|
|
|
props: {
|
2022-10-18 01:24:12 +00:00
|
|
|
pipeline: {
|
|
|
|
type: Object as PropType<PipelineFeed>,
|
2021-11-03 16:40:31 +00:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
setup(props) {
|
2022-10-18 01:24:12 +00:00
|
|
|
const pipeline = toRef(props, 'pipeline');
|
|
|
|
const { since, duration, message, created } = usePipeline(pipeline);
|
2021-11-03 16:40:31 +00:00
|
|
|
|
2022-02-08 22:41:16 +00:00
|
|
|
return { since, duration, message, created };
|
2021-11-03 16:40:31 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|