feat: 接入持久化工作流执行状态
This commit is contained in:
1 parent
7d2900c705
commit
3caea26924
14 files changed
+532
-44
No files matched your search
@@ -13,7 +13,14 @@ import { storyboardApi } from '../../storyboard/api'
|
||||
import ConfirmAction from '../../workflows/ConfirmAction.vue'
|
||||
import { getOperation, runOperation } from '../../workflows/operations'
|
||||
import { productionApi } from '../api'
|
||||
import { isActiveVideo, issueLabel, primaryKeyframe, primaryVideo, productionStatusLabel } from '../model'
|
||||
import {
|
||||
isActiveVideo,
|
||||
issueLabel,
|
||||
primaryKeyframe,
|
||||
primaryVideo,
|
||||
productionStatusLabel,
|
||||
videoQualityStatusLabel
|
||||
} from '../model'
|
||||
import type {
|
||||
GenerateKeyframeInput,
|
||||
KeyframeReadinessItem,
|
||||
@@ -47,18 +54,24 @@ const key = computed(() => props.shot.shotId)
|
||||
const query = usePolling(
|
||||
key,
|
||||
async (shotId, signal) => {
|
||||
const [keyframes, videos] = await Promise.all([
|
||||
const [keyframes, videos, qualityState] = await Promise.all([
|
||||
productionApi.listKeyframes(shotId, signal),
|
||||
productionApi.listVideos(shotId, signal)
|
||||
productionApi.listVideos(shotId, signal),
|
||||
productionApi
|
||||
.videoQualityStatus(shotId, signal)
|
||||
.then(data => ({ data, error: '' }))
|
||||
.catch(cause => ({ data: null, error: errorMessage(cause) }))
|
||||
])
|
||||
if (keyframes.some(item => item.shotId !== shotId) || videos.some(item => item.shotId !== shotId))
|
||||
throw new Error('资产记录与当前镜头不匹配,请刷新后重试。')
|
||||
return { keyframes, videos }
|
||||
const qualityStatus = qualityState.data?.shotId === shotId ? qualityState.data : null
|
||||
return { keyframes, videos, qualityStatus, qualityStatusError: qualityState.error }
|
||||
},
|
||||
false
|
||||
)
|
||||
const keyframes = computed(() => query.data.value?.keyframes ?? [])
|
||||
const videos = computed(() => query.data.value?.videos ?? [])
|
||||
const videoQualityStatus = computed(() => query.data.value?.qualityStatus ?? null)
|
||||
const currentKeyframe = computed(() => primaryKeyframe(keyframes.value))
|
||||
const currentVideo = computed(() => primaryVideo(videos.value))
|
||||
const activeVideo = computed(() => videos.value.find(isActiveVideo))
|
||||
@@ -358,6 +371,9 @@ async function inspectSpecs() {
|
||||
>
|
||||
当前主首帧在本次质量检查中未通过,已阻止继续生成视频。请从候选中选择质量通过的图片。
|
||||
</NAlert>
|
||||
<NAlert v-if="query.data.value?.qualityStatusError" type="warning" :show-icon="false" class="mt-3 text-xs">
|
||||
视频质量链状态暂时无法读取;视频资产仍可查看。请稍后刷新。
|
||||
</NAlert>
|
||||
<div class="production-stage-actions">
|
||||
<NButton v-if="keyframeCandidates.length" @click="candidatesOpen = true">
|
||||
管理候选({{ keyframeCandidates.length }})
|
||||
@@ -389,6 +405,26 @@ async function inspectSpecs() {
|
||||
{{ issueLabel(issue.code) }}:{{ issue.reason }}
|
||||
</li>
|
||||
</ul>
|
||||
<NAlert
|
||||
v-if="videoQualityStatus && videoQualityStatus.status !== 'not_started'"
|
||||
:type="
|
||||
videoQualityStatus.status === 'passed'
|
||||
? 'success'
|
||||
: videoQualityStatus.status === 'exhausted'
|
||||
? 'error'
|
||||
: 'info'
|
||||
"
|
||||
:show-icon="false"
|
||||
class="mt-3 text-xs"
|
||||
>
|
||||
{{ videoQualityStatusLabel(videoQualityStatus.status) }}
|
||||
<template v-if="videoQualityStatus.maxRepairAttempts !== null">
|
||||
· 修复 {{ videoQualityStatus.repairAttempt }} / {{ videoQualityStatus.maxRepairAttempts }}
|
||||
</template>
|
||||
<template v-if="videoQualityStatus.status === 'exhausted'">
|
||||
。请检查候选视频和校验结果,调整提示词或参考资产后再重新生成。
|
||||
</template>
|
||||
</NAlert>
|
||||
<div v-if="videos.length" class="mt-4 space-y-3">
|
||||
<article v-for="item in videos" :key="item.id" class="video-record">
|
||||
<video
|
||||
@@ -464,7 +500,7 @@ async function inspectSpecs() {
|
||||
</div>
|
||||
<p v-else class="mt-4 text-xs text-muted">尚无视频任务记录。</p>
|
||||
<p v-if="videos.some(item => !item.isPrimary)" class="mt-3 text-xs text-muted">
|
||||
候选视频的历史质量结果未公开;手动设为主视频前需在本会话完成视觉校验。自动质量任务的晋升结果以刷新后的主视频标记为准。
|
||||
质量链状态来自后端持久化记录;手动晋升候选仍需在当前页面完成一次视觉校验。自动质量任务通过后会直接更新主视频。
|
||||
</p>
|
||||
<div class="production-stage-actions">
|
||||
<ConfirmAction
|
||||
|
||||
Reference in new issue
Block a user