b051acc8b4
CI/CD Pipeline / Validate - Code Quality (push) Failing after 3m6s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 1m59s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 1m43s
CI/CD Pipeline / Unit Tests (push) Failing after 6m44s
CI/CD Pipeline / Integration Tests (push) Successful in 3m43s
CI/CD Pipeline / Frontend Lint (push) Failing after 2m15s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 2m5s
CI/CD Pipeline / Build Staging API Image (push) Successful in 16m2s
CI/CD Pipeline / Build Staging Web Image (push) Failing after 2m50s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 5m25s
CI/CD Pipeline / Canary Release to Production (push) Failing after 1217h0m41s
CI/CD Pipeline / Staging API Integration Tests (push) Failing after 1217h0m42s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1217h0m43s
CI/CD Pipeline / CI Gate (push) Failing after 1217h4m1s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 1217h0m45s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1217h7m15s
CI/CD Pipeline / Deploy Production (push) Failing after 1217h8m0s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 1217h15m39s
CI/CD Pipeline / Build Production Web Image (push) Failing after 1217h15m41s
CI/CD Pipeline / Build Production API Image (push) Failing after 1217h15m43s
CI/CD Pipeline / PR Build Web Image (push) Failing after 1217h16m51s
CI/CD Pipeline / PR Build API Image (push) Failing after 1217h16m51s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1217h17m0s
CI/CD Pipeline / ACR Image Cleanup (push) Failing after 1217h33m34s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 1217h49m42s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
66 lines
2.1 KiB
TypeScript
66 lines
2.1 KiB
TypeScript
import React from "react"
|
|
import { Modal } from "@/components/ui"
|
|
import type { TaskItem } from "@/api/tasks"
|
|
import { getStepLabel, getStatusColor } from "./constants"
|
|
|
|
interface ProgressPhaseProps {
|
|
open: boolean
|
|
task: TaskItem | null
|
|
onCancel: () => void
|
|
}
|
|
|
|
/** progress(进度轮询)阶段弹窗 */
|
|
export const ProgressPhase: React.FC<ProgressPhaseProps> = ({ open, task, onCancel }) => {
|
|
const progress = task?.progress ?? 0
|
|
const status = task?.status ?? ""
|
|
const currentStep = task?.current_step ?? ""
|
|
const userMessage = task?.user_message ?? ""
|
|
const stepColor = getStatusColor(status, currentStep)
|
|
|
|
return (
|
|
<Modal open={open} title="视频生成中" footer={null} onCancel={onCancel} closable width={480}>
|
|
<div className="ep-gen-progress">
|
|
{/* 进度环 */}
|
|
<div className="ep-gen-progress-ring-wrap">
|
|
<svg className="ep-gen-progress-ring" viewBox="0 0 120 120">
|
|
<circle className="ep-gen-progress-ring-bg" cx="60" cy="60" r="52" />
|
|
<circle
|
|
className="ep-gen-progress-ring-fill"
|
|
cx="60"
|
|
cy="60"
|
|
r="52"
|
|
style={{
|
|
strokeDasharray: `${2 * Math.PI * 52}`,
|
|
strokeDashoffset: `${2 * Math.PI * 52 * (1 - progress / 100)}`,
|
|
stroke: stepColor,
|
|
}}
|
|
/>
|
|
</svg>
|
|
<span className="ep-gen-progress-pct" style={{ color: stepColor }}>
|
|
{progress}%
|
|
</span>
|
|
</div>
|
|
|
|
{/* 当前步骤 */}
|
|
<div className="ep-gen-step-text">
|
|
{userMessage || getStepLabel(currentStep) || "处理中…"}
|
|
</div>
|
|
|
|
{/* 进度条 */}
|
|
<div className="ep-gen-progress-bar">
|
|
<div
|
|
className="ep-gen-progress-bar-fill"
|
|
style={{
|
|
width: `${progress}%`,
|
|
backgroundColor: stepColor,
|
|
}}
|
|
/>
|
|
</div>
|
|
|
|
{/* 任务 ID */}
|
|
{task?.id && <div className="ep-gen-task-id">任务 ID: {task.id}</div>}
|
|
</div>
|
|
</Modal>
|
|
)
|
|
}
|