2026-03-22 02:04:39 +01:00
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import ActionRunStatus from './ActionRunStatus.vue';
|
|
|
|
|
|
import WorkflowGraph from './WorkflowGraph.vue';
|
|
|
|
|
|
import type {ActionRunViewStore} from "./ActionRunView.ts";
|
|
|
|
|
|
import {computed, onBeforeUnmount, onMounted, toRefs} from "vue";
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
|
|
name: 'ActionRunSummaryView',
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
|
store: ActionRunViewStore;
|
|
|
|
|
|
locale: Record<string, any>;
|
|
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
const {currentRun: run} = toRefs(props.store.viewData);
|
|
|
|
|
|
|
|
|
|
|
|
const runTriggeredAtIso = computed(() => {
|
|
|
|
|
|
const t = props.store.viewData.currentRun.triggeredAt;
|
|
|
|
|
|
return t ? new Date(t * 1000).toISOString() : '';
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
await props.store.startPollingCurrentRun();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
|
props.store.stopPollingCurrentRun();
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<template>
|
2026-03-28 10:41:34 +01:00
|
|
|
|
<div class="action-run-summary-view">
|
2026-03-22 02:04:39 +01:00
|
|
|
|
<div class="action-run-summary-block">
|
2026-03-28 10:41:34 +01:00
|
|
|
|
<div class="flex-text-block">
|
|
|
|
|
|
{{ locale.triggeredVia.replace('%s', run.triggerEvent) }} • <relative-time :datetime="runTriggeredAtIso" prefix=""/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="flex-text-block">
|
2026-03-22 02:04:39 +01:00
|
|
|
|
<ActionRunStatus :locale-status="locale.status[run.status]" :status="run.status" :size="16"/>
|
2026-03-28 10:41:34 +01:00
|
|
|
|
<span>{{ locale.status[run.status] }}</span> • <span>{{ locale.totalDuration }} {{ run.duration || '–' }}</span>
|
|
|
|
|
|
</div>
|
2026-03-22 02:04:39 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
<WorkflowGraph
|
|
|
|
|
|
v-if="run.jobs.length > 0"
|
2026-03-28 10:41:34 +01:00
|
|
|
|
:store="store"
|
2026-03-22 02:04:39 +01:00
|
|
|
|
:jobs="run.jobs"
|
|
|
|
|
|
:run-link="run.link"
|
|
|
|
|
|
:workflow-id="run.workflowID"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<style scoped>
|
2026-03-28 10:41:34 +01:00
|
|
|
|
.action-run-summary-view {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
color: var(--color-text-light-1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-22 02:04:39 +01:00
|
|
|
|
.action-run-summary-block {
|
2026-03-28 10:41:34 +01:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
gap: 6px;
|
2026-03-22 02:04:39 +01:00
|
|
|
|
padding: 12px;
|
|
|
|
|
|
border-bottom: 1px solid var(--color-secondary);
|
2026-03-28 10:41:34 +01:00
|
|
|
|
border-radius: var(--border-radius) var(--border-radius) 0 0;
|
|
|
|
|
|
background: var(--color-box-header);
|
2026-03-22 02:04:39 +01:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|