1、后台界面/video-engines,添加修改需要增加可传图片和视频的数量

2、前台接口/credits/ratios,同步返回
This commit is contained in:
2026-07-01 10:10:43 +08:00
parent a011e4575b
commit 3543be4628
8 changed files with 698 additions and 57 deletions
@@ -17,6 +17,9 @@ interface VideoEngine {
supportedRatios: string[];
supportedResolutions: string[];
supportedDurations: number[];
maxDuration: number;
maxImageCount: number;
maxVideoCount: number;
isActive: boolean;
priority: number;
}
@@ -66,6 +69,9 @@ const AdminVideoEngines: React.FC = () => {
supported_ratios: JSON.stringify(values.supportedRatios || []),
supported_resolutions: JSON.stringify(values.supportedResolutions || []),
supported_durations: JSON.stringify(values.supportedDurations || []),
max_duration: values.maxDuration ?? 15,
max_image_count: values.maxImageCount ?? 5,
max_video_count: values.maxVideoCount ?? 2,
is_active: values.isActive ?? true,
priority: values.priority ?? 0,
};
@@ -103,6 +109,9 @@ const AdminVideoEngines: React.FC = () => {
form.resetFields();
form.setFieldsValue({
isActive: true, priority: 0,
maxDuration: 15,
maxImageCount: 5,
maxVideoCount: 2,
supportedRatios: ['16:9', '4:3', '1:1', '3:4', '9:16', '21:9'],
supportedResolutions: ['480p', '720p', '1080p'],
supportedDurations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
@@ -142,6 +151,14 @@ const AdminVideoEngines: React.FC = () => {
title: '支持时长', dataIndex: 'supportedDurations', width: 120,
render: (d: number[]) => <Tag color="orange">{d?.length ? `${Math.min(...d)}-${Math.max(...d)}s` : '-'}</Tag>,
},
{
title: '最大图片', dataIndex: 'maxImageCount', width: 100,
render: (v: number) => <Tag color="purple">{v} </Tag>,
},
{
title: '最大视频', dataIndex: 'maxVideoCount', width: 100,
render: (v: number) => <Tag color="cyan">{v} </Tag>,
},
{
title: '状态', dataIndex: 'isActive', width: 80,
render: (v: boolean) => <Tag color={v ? 'green' : 'default'}>{v ? '启用' : '停用'}</Tag>,
@@ -234,6 +251,17 @@ const AdminVideoEngines: React.FC = () => {
} />
</Form.Item>
</div>
<div style={{ display: 'flex', gap: 16 }}>
<Form.Item name="maxDuration" label="最大时长(秒)" style={{ flex: 1 }}>
<Input type="number" size="large" />
</Form.Item>
<Form.Item name="maxImageCount" label="最大图片数量" style={{ flex: 1 }}>
<Input type="number" size="large" />
</Form.Item>
<Form.Item name="maxVideoCount" label="最大视频数量" style={{ flex: 1 }}>
<Input type="number" size="large" />
</Form.Item>
</div>
<div style={{ display: 'flex', gap: 16 }}>
<Form.Item name="priority" label="优先级">
<Select size="large" options={[