diff --git a/video-gen-admin/.gitignore b/video-gen-admin/.gitignore new file mode 100644 index 00000000..c51d479f --- /dev/null +++ b/video-gen-admin/.gitignore @@ -0,0 +1,143 @@ +# ========================= +# Dependencies +# ========================= +#node_modules/ +.pnp/ +.pnp.js +.pnp.cjs + +# ========================= +# Build outputs +# ========================= +dist/ +build/ +out/ +.next/ +.nuxt/ +.cache/ +.parcel-cache/ +.vite/ +.turbo/ + +# ========================= +# Logs +# ========================= +logs/ +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +# ========================= +# Runtime / cache +# ========================= +.cache/ +.eslintcache +.stylelintcache +*.tsbuildinfo + +# ========================= +# Environment files +# ========================= +.env +.env.local +.env.*.local +.env.development.local +.env.test.local +.env.production.local + +# 如果你有示例环境变量文件,可以提交 +!.env.example + +# ========================= +# WebStorm / JetBrains IDE +# ========================= +.idea/ +*.iml +*.iws +*.ipr + +# 如果团队需要共享 WebStorm 配置,可以改成下面这种策略: +# .idea/* +# !.idea/codeStyles/ +# !.idea/inspectionProfiles/ +# !.idea/runConfigurations/ + +# ========================= +# VSCode +# ========================= +.vscode/* +!.vscode/extensions.json +!.vscode/settings.json + +# ========================= +# OS files +# ========================= +.DS_Store +.AppleDouble +.LSOverride +Thumbs.db +ehthumbs.db +Desktop.ini + +# ========================= +# Test coverage +# ========================= +coverage/ +.nyc_output/ + +# ========================= +# Storybook +# ========================= +storybook-static/ + +# ========================= +# Cypress / Playwright +# ========================= +cypress/videos/ +cypress/screenshots/ +playwright-report/ +test-results/ + +# ========================= +# Sentry / source maps +# ========================= +*.map + +# 如果线上需要 sourcemap,就不要忽略 *.map + +# ========================= +# Package manager cache +# ========================= +.npm/ +.yarn/* +!.yarn/releases +!.yarn/plugins +!.yarn/sdks +!.yarn/versions + +# ========================= +# Temporary files +# ========================= +tmp/ +temp/ +*.tmp +*.temp + +# ========================= +# Local certificates / keys +# ========================= +*.pem +*.key +*.crt +*.p12 +*.pfx + +# ========================= +# Misc +# ========================= +*.bak +*.swp +*.swo \ No newline at end of file diff --git a/video-gen-admin/src/api/index.ts b/video-gen-admin/src/api/index.ts index c74539b8..c051b14e 100644 --- a/video-gen-admin/src/api/index.ts +++ b/video-gen-admin/src/api/index.ts @@ -298,7 +298,7 @@ export async function adminUpdateGenerationStatus( } export async function adminGenerateVideo( - recordId: string, aspectRatio: string, resolution: string + recordId: string, aspectRatio: string, resolution: string, image_size: string ): Promise { - await api.post(`/admin/generation-records/${recordId}/generate`, { aspect_ratio: aspectRatio, resolution }); + await api.post(`/admin/generation-records/${recordId}/generate`, { aspect_ratio: aspectRatio, resolution, image_size }); } diff --git a/video-gen-admin/src/pages/AdminGenerationRecords.tsx b/video-gen-admin/src/pages/AdminGenerationRecords.tsx index 12d69a7b..8ee58e06 100644 --- a/video-gen-admin/src/pages/AdminGenerationRecords.tsx +++ b/video-gen-admin/src/pages/AdminGenerationRecords.tsx @@ -5,7 +5,7 @@ import { import { PlayCircleOutlined, EyeOutlined, ClockCircleOutlined, CheckCircleOutlined, LoadingOutlined, CloseCircleOutlined, SearchOutlined, VideoCameraOutlined, - ExclamationCircleOutlined, + ExclamationCircleOutlined, FileImageOutlined } from '@ant-design/icons'; import { getAdminGenerationRecords, adminUpdateGenerationStatus, adminGenerateVideo } from '../api'; import type { AdminGenerationRecord } from '../types'; @@ -32,7 +32,7 @@ const AdminGenerationRecords: React.FC = () => { const [filterUserId, setFilterUserId] = useState(''); const [preview, setPreview] = useState(null); const [updating, setUpdating] = useState(null); - const [genModal, setGenModal] = useState<{ record: AdminGenerationRecord; ratio: string; resolution: string } | null>(null); + const [genModal, setGenModal] = useState<{ record: AdminGenerationRecord; ratio: string; resolution: string; image_size: string } | null>(null); const load = async () => { setLoading(true); @@ -63,7 +63,12 @@ const AdminGenerationRecords: React.FC = () => { videoTokensUsed: item.videoTokensUsed || 0, errorMessage: item.errorMessage, createdAt: item.createdAt, - generatedAt: item.generatedAt, + genType: item.genType, + imageSize: item.imageSize, + imageUrl: item.imageUrl, + imageTokensUsed: item.imageTokensUsed, + imageProportion: item.imageProportion, + imagePx: item.imagePx, }))); setTotal(res.total); } catch { @@ -92,7 +97,7 @@ const AdminGenerationRecords: React.FC = () => { if (!genModal) return; setUpdating(genModal.record.id); try { - await adminGenerateVideo(genModal.record.id, genModal.ratio, genModal.resolution); + await adminGenerateVideo(genModal.record.id, genModal.ratio, genModal.resolution, genModal.image_size); message.success('已提交视频生成'); setGenModal(null); load(); @@ -117,6 +122,12 @@ const AdminGenerationRecords: React.FC = () => { title: '项目', dataIndex: 'projectName', width: 120, ellipsis: true, render: (v: string) => {v}, }, + { + title: '类型', dataIndex: 'genType', width: 60, ellipsis: true, + render: (v: string) => + {v==='video' ? "视频" : "图片"} + , + }, { title: '提示词', key: 'prompt', ellipsis: true, render: (_: any, r: AdminGenerationRecord) => ( @@ -130,13 +141,22 @@ const AdminGenerationRecords: React.FC = () => { { title: '参数', key: 'params', width: 140, render: (_: any, r: AdminGenerationRecord) => ( - r.duration ? ( - - {r.duration}s - {r.aspectRatio} - {r.resolution} - - ) : 待配置 + r.genType === 'video'? + (r.duration ? ( + + {r.duration}s + {r.aspectRatio} + {r.resolution} + + ) : 待配置) + : + (r.imageSize ? ( + + {r.imageSize} + {r.imageProportion} + {r.imagePx} + + ) : 待配置) ), }, { @@ -147,7 +167,7 @@ const AdminGenerationRecords: React.FC = () => {
文字: {r.textCreditsCost}
)} {r.creditsCost > 0 && ( -
视频: {r.creditsCost}
+
{r.genType === 'video'? "视频" : "图片"}: {r.creditsCost}
)} {r.textCreditsCost === 0 && r.creditsCost === 0 && ( 0 @@ -193,16 +213,16 @@ const AdminGenerationRecords: React.FC = () => { )} {r.status === 'failed' && ( )} {r.status === 'prompt_optimized' && ( <>