ccb5ed816a
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1m25s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 1m40s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 2m29s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 2m50s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m53s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 3m21s
CI/CD Pipeline / Build Staging API Image (push) Successful in 3m57s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 35s
AI Code Review / AI Code Review (pull_request) Failing after 3m24s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 34s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 3m52s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 4m28s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 7m50s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m21s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 47s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 59s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m2s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 10m8s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 10m39s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m11s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 4m4s
CI/CD Pipeline / Integration Tests (push) Successful in 4m35s
CI/CD Pipeline / Unit Tests (push) Successful in 14m13s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 13m37s
CI/CD Pipeline / CI Gate (pull_request) Successful in 6s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 544h12m59s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 544h12m59s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 544h13m0s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 544h13m1s
CI/CD Pipeline / Production Browser E2E (push) Failing after 544h13m45s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 544h13m1s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 544h13m46s
CI/CD Pipeline / Canary Release to Production (push) Failing after 544h13m46s
CI/CD Pipeline / Build Production Web Image (push) Failing after 544h13m47s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 544h25m21s
CI/CD Pipeline / Build Production API Image (push) Failing after 544h13m47s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 544h26m2s
CI/CD Pipeline / CI Gate (push) Failing after 544h13m47s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 544h26m4s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 544h26m35s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 544h25m23s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 544h26m37s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 544h25m25s
CI/CD Pipeline / Frontend Lint (push) Failing after 544h26m59s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 544h28m4s
CI/CD Pipeline / PR Build Web Image (push) Failing after 544h26m6s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 544h28m32s
CI/CD Pipeline / PR Build API Image (push) Failing after 544h26m8s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 544h28m36s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 544h29m30s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 544h46m53s
CI/CD Pipeline / Deploy Production (push) Failing after 544h47m39s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 544h59m25s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 545h2m27s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
137 lines
4.5 KiB
TypeScript
Executable File
137 lines
4.5 KiB
TypeScript
Executable File
import React from "react"
|
|
import { Modal, Spin } from "antd"
|
|
import type { CoverConfig } from "../types/cover"
|
|
import { useStep6Cover } from "../hooks/useStep6Cover"
|
|
import Button from "@/components/ui/Button"
|
|
import CoverSettingsModal from "./cover-settings/CoverSettingsModal"
|
|
import CoverEditorModal from "./cover-settings/CoverEditorModal"
|
|
|
|
interface Step6CoverSettingsProps {
|
|
coverSettings: CoverConfig
|
|
onCoverSettingsChange: (settings: CoverConfig) => void
|
|
duration: number
|
|
/** 当前素材 ID 列表,用于智能封面生成 */
|
|
assetIds?: string[]
|
|
/** 当前选中的模板 ID */
|
|
selectedTemplate?: string
|
|
/** Step4 标题设置,用于预览视频烧录标题 & 封面叠加标题 */
|
|
titleSettings?: import("../types").TitleSettings
|
|
/** 预览任务创建回调——将 task_id 暴露给父组件供 confirmGeneration 复用 */
|
|
onPreviewTaskCreated?: (taskId: string) => void
|
|
/** 从预览响应中提取到 source_edit_plan_id 时的回调 */
|
|
onSourceEditPlanIdExtracted?: (planId: string) => void
|
|
/** 配音模式 */
|
|
voiceMode?: "preset" | "custom" | "clone"
|
|
/** 选中的配音素材 ID */
|
|
selectedVoice?: string
|
|
/** 选中的克隆音色 ID */
|
|
selectedClonedVoice?: string
|
|
/** BGM 开关 */
|
|
bgm?: boolean
|
|
/** BGM 配置 */
|
|
bgmConfig?: { enabled: boolean; music_id?: string }
|
|
}
|
|
|
|
const Step6CoverSettings: React.FC<Step6CoverSettingsProps> = (props) => {
|
|
const {
|
|
coverSettings,
|
|
generating,
|
|
generateAutoCover,
|
|
showCoverSettings,
|
|
setShowCoverSettings,
|
|
showCoverEditor,
|
|
setShowCoverEditor,
|
|
selectedTemplateId,
|
|
editingTemplate,
|
|
coverTemplates,
|
|
templatesLoading,
|
|
templatesError,
|
|
handleSelectTemplate,
|
|
handleEditTemplate,
|
|
handleSaveTemplate,
|
|
handleDeleteTemplate,
|
|
} = useStep6Cover({
|
|
coverSettings: props.coverSettings,
|
|
onCoverSettingsChange: props.onCoverSettingsChange,
|
|
duration: props.duration,
|
|
assetIds: props.assetIds,
|
|
selectedTemplate: props.selectedTemplate,
|
|
titleSettings: props.titleSettings,
|
|
onPreviewTaskCreated: props.onPreviewTaskCreated,
|
|
onSourceEditPlanIdExtracted: props.onSourceEditPlanIdExtracted,
|
|
voiceMode: props.voiceMode,
|
|
selectedVoice: props.selectedVoice,
|
|
selectedClonedVoice: props.selectedClonedVoice,
|
|
bgm: props.bgm,
|
|
bgmConfig: props.bgmConfig,
|
|
})
|
|
|
|
const handleAutoGenerate = () => {
|
|
generateAutoCover()
|
|
}
|
|
|
|
// 预览图:优先 thumbnail_url,其次 upload_url
|
|
const previewUrl = coverSettings.thumbnail_url || coverSettings.upload_url
|
|
|
|
return (
|
|
<div className="xx-form-section">
|
|
<h3>🖼️ 选择封面</h3>
|
|
|
|
<div className="xx-cover-actions">
|
|
<Button buttonType="primary" onClick={handleAutoGenerate}>
|
|
✨ 自动生成封面
|
|
</Button>
|
|
<Button buttonType="ghost" onClick={() => setShowCoverSettings(true)}>
|
|
⚙️ 封面设置
|
|
</Button>
|
|
</div>
|
|
|
|
<div className="xx-section-title">封面预览</div>
|
|
<div className="xx-cover-preview-box">
|
|
{previewUrl ? (
|
|
<img src={previewUrl} alt="封面预览" className="xx-cover-preview-img" />
|
|
) : (
|
|
<div className="xx-cover-preview-placeholder">
|
|
<span style={{ fontSize: 28 }}>🖼️</span>
|
|
<span>点击"自动生成封面"或选择模板</span>
|
|
</div>
|
|
)}
|
|
<div className="xx-cover-preview-ratio">9:16</div>
|
|
</div>
|
|
|
|
<CoverSettingsModal
|
|
open={showCoverSettings}
|
|
onClose={() => setShowCoverSettings(false)}
|
|
templates={coverTemplates}
|
|
loading={templatesLoading}
|
|
error={templatesError}
|
|
selectedTemplateId={selectedTemplateId}
|
|
onSelectTemplate={handleSelectTemplate}
|
|
onEditTemplate={handleEditTemplate}
|
|
onDeleteTemplate={handleDeleteTemplate}
|
|
onCreateNew={() => {
|
|
setShowCoverSettings(false)
|
|
setShowCoverEditor(true)
|
|
}}
|
|
/>
|
|
|
|
<CoverEditorModal
|
|
open={showCoverEditor}
|
|
onClose={() => setShowCoverEditor(false)}
|
|
template={editingTemplate}
|
|
onSave={handleSaveTemplate}
|
|
/>
|
|
|
|
{/* AI 生成封面进度弹窗 */}
|
|
<Modal open={generating} closable={false} footer={null} centered>
|
|
<div style={{ textAlign: "center", padding: "24px 0" }}>
|
|
<Spin size="large" />
|
|
<p style={{ marginTop: 16, fontSize: 14, color: "#666" }}>AI 正在生成封面,请稍候...</p>
|
|
</div>
|
|
</Modal>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Step6CoverSettings
|