d3fc15ddd9
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 4m44s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3m26s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 5m34s
CI/CD Pipeline / Build Staging API Image (push) Successful in 2m41s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 2m49s
CI/CD Pipeline / Validate - Code Quality (push) Has been cancelled
CI/CD Pipeline / Unit Tests (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (push) Has been cancelled
CI/CD Pipeline / Build Staging Web Image (push) Has been cancelled
CI/CD Pipeline / Build Staging Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled
CI/CD Pipeline / Build Production API Image (push) Has been cancelled
CI/CD Pipeline / Build Production Web Image (push) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Production (push) Has been cancelled
CI/CD Pipeline / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (push) Has been cancelled
CI/CD Pipeline / Canary Release to Production (push) Has been cancelled
CI/CD Pipeline / CI Gate (push) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 446h38m57s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 446h40m47s
CI/CD Pipeline / PR Build API Image (push) Failing after 446h40m51s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 446h40m53s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 446h40m57s
CI/CD Pipeline / Frontend Lint (push) Failing after 446h41m13s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 446h46m35s
CI/CD Pipeline / PR Build Web Image (push) Failing after 447h14m50s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 447h14m56s
- 步骤4(选择标题)底部按钮改为「确认生成视频」,点击后执行标题/预览 校验,直接调用 createGenerationTask 创建最终渲染任务,成功后跳转步骤5 - 步骤5不再有「开始生成」按钮,仅展示渲染进度;渲染中禁用下一步, 完成后停留本页,手动点下一步进入封面(不自动跳转) - 步骤6封面页底部仅保留上一步(修正确认按钮误挂最后一步的遗留问题) - 生成失败:创建失败留在步骤4可重试;轮询失败在步骤5展示错误卡片 - generate() 返回 boolean,任务创建成功才跳转 - 修复「查看结果」滚动选择器失效(xx-preview-section → xx-inline-video-player) - 步骤5增加未开始生成空状态提示
90 lines
2.4 KiB
TypeScript
90 lines
2.4 KiB
TypeScript
/**
|
|
* GeneratePage 步骤底部操作按钮
|
|
*
|
|
* 步骤 1~3:上一步 / 下一步
|
|
* 步骤 4(标题+预览):上一步 / 确认生成视频(点击后直接创建最终渲染任务,成功后跳转步骤5)
|
|
* 步骤 5(确认生成):上一步 / 下一步(渲染中禁用,渲染完成后可进入封面)
|
|
* 步骤 6(选择封面):仅上一步
|
|
*/
|
|
import React from "react"
|
|
|
|
export interface GenerateStepActionsProps {
|
|
currentStep: number
|
|
onPrev: () => void
|
|
onNext: () => void
|
|
/** 步骤4:确认生成视频(校验 + 创建渲染任务 + 成功后进入步骤5) */
|
|
onConfirmGenerate: () => void | Promise<void>
|
|
generating: boolean
|
|
generated: boolean
|
|
generateError: string | null
|
|
}
|
|
|
|
export const GenerateStepActions: React.FC<GenerateStepActionsProps> = ({
|
|
currentStep,
|
|
onPrev,
|
|
onNext,
|
|
onConfirmGenerate,
|
|
generating,
|
|
generated,
|
|
generateError,
|
|
}) => {
|
|
const renderPrimaryButton = () => {
|
|
/* 步骤 4:确认生成视频(触发按钮在标题页) */
|
|
if (currentStep === 4) {
|
|
if (generating) {
|
|
return (
|
|
<button className="xx-btn xx-btn-primary" disabled>
|
|
⏳ 视频生成中…
|
|
</button>
|
|
)
|
|
}
|
|
if (generateError) {
|
|
return (
|
|
<button className="xx-btn xx-btn-primary" onClick={onConfirmGenerate}>
|
|
🔄 重新生成视频
|
|
</button>
|
|
)
|
|
}
|
|
if (generated) {
|
|
return (
|
|
<button className="xx-btn xx-btn-primary" onClick={onNext}>
|
|
下一步 →
|
|
</button>
|
|
)
|
|
}
|
|
return (
|
|
<button className="xx-btn xx-btn-primary" onClick={onConfirmGenerate}>
|
|
✨ 确认生成视频
|
|
</button>
|
|
)
|
|
}
|
|
|
|
/* 步骤 5:渲染中禁用,完成后下一步进入封面 */
|
|
if (currentStep === 5) {
|
|
return (
|
|
<button
|
|
className="xx-btn xx-btn-primary"
|
|
onClick={onNext}
|
|
disabled={generating || !generated}
|
|
>
|
|
{generating ? "视频生成中…" : "下一步 →"}
|
|
</button>
|
|
)
|
|
}
|
|
|
|
/* 步骤 6(最后一步):无主按钮 */
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<div className="xx-step-actions">
|
|
<button className="xx-btn xx-btn-ghost" onClick={onPrev} disabled={currentStep === 1}>
|
|
← 上一步
|
|
</button>
|
|
{renderPrimaryButton()}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default GenerateStepActions
|