feat: add generation trace and partial-ready workflow status
This commit is contained in:
@@ -7,7 +7,12 @@ import BaseButton from '../components/ui/BaseButton.vue'
|
||||
import BaseCard from '../components/ui/BaseCard.vue'
|
||||
import EmptyState from '../components/ui/EmptyState.vue'
|
||||
import LoadingSpinner from '../components/ui/LoadingSpinner.vue'
|
||||
import { getAssetStatusMeta, getGenerationStatusMeta } from '../utils/storyStatus'
|
||||
import {
|
||||
getAssetStatusMeta,
|
||||
getGenerationStatusMeta,
|
||||
isReadableGenerationStatus,
|
||||
needsGenerationAttention,
|
||||
} from '../utils/storyStatus'
|
||||
import {
|
||||
BookOpenIcon,
|
||||
ChevronRightIcon,
|
||||
@@ -24,6 +29,7 @@ interface StoryItem {
|
||||
created_at: string
|
||||
mode: string
|
||||
generation_status: string
|
||||
text_status: string
|
||||
image_status: string
|
||||
audio_status: string
|
||||
last_error: string | null
|
||||
@@ -35,14 +41,12 @@ const loading = ref(true)
|
||||
const error = ref('')
|
||||
const showCreateModal = ref(false)
|
||||
|
||||
const completedCount = computed(() =>
|
||||
stories.value.filter((story) => story.generation_status === 'completed').length,
|
||||
const readableCount = computed(() =>
|
||||
stories.value.filter((story) => isReadableGenerationStatus(story.generation_status)).length,
|
||||
)
|
||||
|
||||
const attentionCount = computed(() =>
|
||||
stories.value.filter((story) =>
|
||||
['degraded_completed', 'failed'].includes(story.generation_status),
|
||||
).length,
|
||||
stories.value.filter((story) => needsGenerationAttention(story.generation_status)).length,
|
||||
)
|
||||
|
||||
async function fetchStories() {
|
||||
@@ -144,12 +148,12 @@ onMounted(() => {
|
||||
<div class="text-gray-500 text-sm mt-1">绘本数量</div>
|
||||
</div>
|
||||
<div class="text-center px-4 py-2">
|
||||
<div class="text-3xl font-bold text-gray-800">{{ completedCount }}</div>
|
||||
<div class="text-gray-500 text-sm mt-1">完整可用</div>
|
||||
<div class="text-3xl font-bold text-gray-800">{{ readableCount }}</div>
|
||||
<div class="text-gray-500 text-sm mt-1">可阅读</div>
|
||||
</div>
|
||||
<div class="text-center px-4 py-2">
|
||||
<div class="text-3xl font-bold text-gray-800">{{ attentionCount }}</div>
|
||||
<div class="text-gray-500 text-sm mt-1">待补资源</div>
|
||||
<div class="text-gray-500 text-sm mt-1">需关注</div>
|
||||
</div>
|
||||
</div>
|
||||
</BaseCard>
|
||||
|
||||
Reference in New Issue
Block a user