mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-06-13 02:49:37 +00:00
7d7d75d7e5
* Add support for localization * Add docs & format code * Add lib to docs
55 lines
1.6 KiB
Vue
55 lines
1.6 KiB
Vue
<template>
|
|
<div v-if="build" class="flex text-gray-600 dark:text-gray-500 w-full">
|
|
<BuildStatusIcon :build="build" class="flex items-center" />
|
|
<div class="flex flex-col ml-4 min-w-0">
|
|
<span class="underline">{{ build.owner }} / {{ build.name }}</span>
|
|
<span class="whitespace-nowrap overflow-hidden overflow-ellipsis">{{ message }}</span>
|
|
<div class="flex flex-col mt-2">
|
|
<div class="flex space-x-2 items-center">
|
|
<Icon name="since" />
|
|
<Tooltip>
|
|
<span>{{ since }}</span>
|
|
<template #popper
|
|
><span class="font-bold">{{ $t('created') }}</span> {{ created }}</template
|
|
>
|
|
</Tooltip>
|
|
</div>
|
|
<div class="flex space-x-2 items-center">
|
|
<Icon name="duration" />
|
|
<span>{{ duration }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { Tooltip } from 'floating-vue';
|
|
import { defineComponent, PropType, toRef } from 'vue';
|
|
|
|
import Icon from '~/components/atomic/Icon.vue';
|
|
import BuildStatusIcon from '~/components/repo/build/BuildStatusIcon.vue';
|
|
import useBuild from '~/compositions/useBuild';
|
|
import { BuildFeed } from '~/lib/api/types';
|
|
|
|
export default defineComponent({
|
|
name: 'BuildFeedItem',
|
|
|
|
components: { BuildStatusIcon, Icon, Tooltip },
|
|
|
|
props: {
|
|
build: {
|
|
type: Object as PropType<BuildFeed>,
|
|
required: true,
|
|
},
|
|
},
|
|
|
|
setup(props) {
|
|
const build = toRef(props, 'build');
|
|
const { since, duration, message, created } = useBuild(build);
|
|
|
|
return { since, duration, message, created };
|
|
},
|
|
});
|
|
</script>
|