f34c6f2ceb
Hoists hasActiveGenerationStatus into the shared display helper so all views agree on what counts as in-flight generation, shows the backend generation_error_message inline on the imitation list and detail drawer when status is failed, and drops the workspace/templates/imitation poll interval from 10s to 3s (with a 5s fallback when streaming is enabled) plus explicit query-cache invalidation so failed/completed states show up promptly.
31 lines
738 B
Vue
31 lines
738 B
Vue
<script setup lang="ts">
|
|
import { LoadingOutlined } from '@ant-design/icons-vue'
|
|
import { computed } from 'vue'
|
|
|
|
import { getGenerateStatusMeta, hasActiveGenerationStatus } from '@/lib/display'
|
|
|
|
const props = defineProps<{
|
|
status?: string | null
|
|
}>()
|
|
|
|
const statusMeta = computed(() => getGenerateStatusMeta(props.status))
|
|
const isLoading = computed(() => hasActiveGenerationStatus(props.status))
|
|
</script>
|
|
|
|
<template>
|
|
<a-tag :color="statusMeta.color">
|
|
<span class="article-generate-status">
|
|
<LoadingOutlined v-if="isLoading" spin />
|
|
<span>{{ statusMeta.label }}</span>
|
|
</span>
|
|
</a-tag>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.article-generate-status {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
</style>
|