mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-11-02 14:11:49 +08:00
4 lines
1.3 KiB
Vue
4 lines
1.3 KiB
Vue
<script setup lang="ts">import { computed } from 'vue'; import { useI18n } from 'vue-i18n'; import type { TeamRun } from '@/api'; const props=defineProps<{run:TeamRun}>(); const {t}=useI18n(); const state=computed(()=>props.run.liveness?.state ?? (['completed','partial','failed','cancelled'].includes(props.run.status)?'terminal':'quiet'))</script>
|
|
<template><section data-team-run-runtime class="run-runtime" :class="`is-${state}`"><span class="run-runtime__dot" :class="{'is-loading':state==='live'}"/><strong>{{ t('teamRuns.runtime') }}</strong><span>{{ t(`teamRuns.liveness.${state}`) }}</span><time v-if="run.liveness?.lastActivityAt">{{ run.liveness.lastActivityAt }}</time></section></template>
|
|
<style scoped>.run-runtime{display:flex;align-items:center;gap:7px;min-width:0;padding:7px 10px;background:var(--mc-team-run-status-bg,rgba(255,255,255,.82));font-size:11px;color:var(--mc-text-secondary)}.run-runtime__dot{width:7px;height:7px;border-radius:50%;background:#94a3b8}.run-runtime.is-live .run-runtime__dot{background:#1b8f68}.run-runtime.is-stalled .run-runtime__dot{background:#c13d3d}.run-runtime time{margin-left:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(prefers-reduced-motion:reduce){.run-runtime__dot{animation:none!important}}</style>
|