mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-18 14:54:16 +00:00
View full pipeline duration in tooltip
This commit is contained in:
@@ -262,7 +262,7 @@
|
||||
"warnings": "Warnings",
|
||||
"show_errors": "Show errors",
|
||||
"we_got_some_errors": "Oh no, an error occurred!",
|
||||
"duration": "Pipeline duration",
|
||||
"duration": "Pipeline duration: {duration}",
|
||||
"created": "Created: {created}",
|
||||
"debug": {
|
||||
"title": "Debug",
|
||||
|
@@ -57,7 +57,7 @@
|
||||
<span class="truncate">{{ pipeline.commit.slice(0, 10) }}</span>
|
||||
</div>
|
||||
|
||||
<div class="flex min-w-0 items-center space-x-2" :title="$t('repo.pipeline.duration')">
|
||||
<div class="flex min-w-0 items-center space-x-2" :title="durationElapsed > 0 ? $t('repo.pipeline.duration', { duration: durationAsNumber(durationElapsed) }) : ''">
|
||||
<Icon name="duration" />
|
||||
<span class="truncate">{{ duration }}</span>
|
||||
</div>
|
||||
@@ -80,6 +80,7 @@ import ListItem from '~/components/atomic/ListItem.vue';
|
||||
import { pipelineStatusColors } from '~/components/repo/pipeline/pipeline-status';
|
||||
import PipelineRunningIcon from '~/components/repo/pipeline/PipelineRunningIcon.vue';
|
||||
import PipelineStatusIcon from '~/components/repo/pipeline/PipelineStatusIcon.vue';
|
||||
import { useDate } from '~/compositions/useDate';
|
||||
import usePipeline from '~/compositions/usePipeline';
|
||||
import type { Pipeline } from '~/lib/api/types';
|
||||
|
||||
@@ -88,9 +89,10 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const { durationAsNumber } = useDate()
|
||||
|
||||
const pipeline = toRef(props, 'pipeline');
|
||||
const { since, duration, message, shortMessage, prettyRef, created } = usePipeline(pipeline);
|
||||
const { since, duration, durationElapsed, message, shortMessage, prettyRef, created } = usePipeline(pipeline);
|
||||
|
||||
const pipelineEventTitle = computed(() => {
|
||||
switch (pipeline.value.event) {
|
||||
|
@@ -115,5 +115,5 @@ export default (pipeline: Ref<Pipeline | undefined>) => {
|
||||
return toLocaleString(new Date(start * 1000));
|
||||
});
|
||||
|
||||
return { since, duration, message, shortMessage, prTitle, prTitleWithDescription, prettyRef, created };
|
||||
return { since, duration, durationElapsed, message, shortMessage, prTitle, prTitleWithDescription, prettyRef, created };
|
||||
};
|
||||
|
@@ -66,7 +66,7 @@
|
||||
<Icon name="since" />
|
||||
<span>{{ since }}</span>
|
||||
</div>
|
||||
<div class="flex shrink-0 items-center gap-2" :title="$t('repo.pipeline.duration')">
|
||||
<div class="flex shrink-0 items-center gap-2" :title="durationElapsed > 0 ? $t('repo.pipeline.duration', { duration: durationAsNumber(durationElapsed) }) : ''">
|
||||
<Icon name="duration" />
|
||||
<span>{{ duration }}</span>
|
||||
</div>
|
||||
@@ -115,6 +115,7 @@ import Tab from '~/components/layout/scaffold/Tab.vue';
|
||||
import PipelineStatusIcon from '~/components/repo/pipeline/PipelineStatusIcon.vue';
|
||||
import useApiClient from '~/compositions/useApiClient';
|
||||
import { useAsyncAction } from '~/compositions/useAsyncAction';
|
||||
import { useDate } from '~/compositions/useDate';
|
||||
import { useFavicon } from '~/compositions/useFavicon';
|
||||
import { provide, requiredInject } from '~/compositions/useInjectProvide';
|
||||
import useNotifications from '~/compositions/useNotifications';
|
||||
@@ -136,6 +137,7 @@ const favicon = useFavicon();
|
||||
const i18n = useI18n();
|
||||
|
||||
const pipelineStore = usePipelineStore();
|
||||
const { durationAsNumber } = useDate()
|
||||
const pipelineId = toRef(props, 'pipelineId');
|
||||
const _repoId = toRef(props, 'repoId');
|
||||
const repositoryId = computed(() => Number.parseInt(_repoId.value, 10));
|
||||
@@ -143,7 +145,7 @@ const repo = requiredInject('repo');
|
||||
const repoPermissions = requiredInject('repo-permissions');
|
||||
|
||||
const pipeline = pipelineStore.getPipeline(repositoryId, pipelineId);
|
||||
const { since, duration, created, message, shortMessage } = usePipeline(pipeline);
|
||||
const { since, duration, durationElapsed, created, message, shortMessage } = usePipeline(pipeline);
|
||||
provide('pipeline', pipeline as Ref<Pipeline>); // can't be undefined because of v-if in template
|
||||
|
||||
const pipelineConfigs = ref<PipelineConfig[]>();
|
||||
|
Reference in New Issue
Block a user