merge: 合入总仓库 weiyuan(bfdfb339) web/ 新功能,保留 ui-optimization 的 UI 重构
来源:luoguang/monkey-ai weiyuan@bfdfb339 的 web/(经 sync/main-weiyuan-web-bfdfb339 同步)
同步基准:总仓库 a2ca13cb = 本仓库初始导入 d8f3aee2
冲突处理原则:保留 ui-optimization 的 UI(样式/结构/组件),嫁接 weiyuan 的功能逻辑。
- i18n:按键三方合并;ours 的「令牌→密钥」改名键上移植 theirs 的术语修订
- task-logs / OrgLogs:ours 已手工移植同一功能(6ad95e2),保留 ours
- 删除:OrgCreate(theirs 下线 /org/create)、旧 image 组件与 VideoRegenerateModal(theirs 体验中心重写)、
OrgAvatarSection / PricingBentoPage / CommissionConsole(ours 重构中已移除)
- 测试:users-pagination 的 i18next mock 补 t();theirs 新增文件补 license header
This commit is contained in:
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* 体验中心视频页输入面板(WP A1-12)。
|
||||
* 配色全部从主题 token 派生(frontend-design skill 铁律一),禁止裸色值。
|
||||
*/
|
||||
.video-input-panel {
|
||||
--vip-ink: var(--text-primary);
|
||||
--vip-muted: var(--text-secondary);
|
||||
--vip-line: var(--border-subtle);
|
||||
--vip-surface: var(--surface-card);
|
||||
--vip-accent: var(--ui-color-primary);
|
||||
--vip-tint: color-mix(in srgb, var(--ui-color-primary) 10%, transparent);
|
||||
--vip-fill: color-mix(in srgb, var(--text-primary) 4%, var(--surface-card));
|
||||
--vip-danger: var(--ui-color-danger);
|
||||
--vip-warning: var(--ui-color-warning);
|
||||
--vip-ring: color-mix(in srgb, var(--ui-color-primary) 55%, transparent);
|
||||
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.video-input-panel button:focus-visible,
|
||||
.video-input-panel [role='button']:focus-visible {
|
||||
outline: 2px solid var(--vip-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.vip-collapse-row {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.vip-collapse-btn {
|
||||
color: var(--vip-accent) !important;
|
||||
}
|
||||
|
||||
.vip-expand-fab {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.vip-expand-fab .ant-btn {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
color: var(--ui-color-primary);
|
||||
}
|
||||
|
||||
.vip-card {
|
||||
margin-bottom: 12px;
|
||||
padding: 14px 16px;
|
||||
border: 1px solid var(--vip-line);
|
||||
border-radius: 12px;
|
||||
background: var(--vip-surface);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.vip-card-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 12px;
|
||||
color: var(--vip-ink);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.vip-card-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 8px;
|
||||
background: var(--vip-tint);
|
||||
color: var(--vip-accent);
|
||||
}
|
||||
|
||||
.vip-card-extra {
|
||||
margin-left: auto;
|
||||
color: var(--vip-muted);
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.vip-muted {
|
||||
color: var(--vip-muted);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vip-model-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.vip-model-name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.vip-model-id {
|
||||
overflow: hidden;
|
||||
color: var(--vip-muted);
|
||||
font-size: 12px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.vip-model-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px 16px;
|
||||
margin-top: 10px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 8px;
|
||||
background: var(--vip-fill);
|
||||
color: var(--vip-muted);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vip-model-meta strong {
|
||||
color: var(--vip-ink);
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.vip-model-desc {
|
||||
flex-basis: 100%;
|
||||
color: var(--vip-muted);
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vip-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vip-state-title {
|
||||
color: var(--vip-ink);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.vip-state.is-error .vip-state-title {
|
||||
color: var(--vip-danger);
|
||||
}
|
||||
|
||||
.vip-mode-option {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.vip-slots {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vip-slot-note {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.vip-portrait-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.vip-template-preview {
|
||||
margin-top: 10px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 8px;
|
||||
background: var(--vip-fill);
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vip-counter {
|
||||
display: block;
|
||||
margin-top: 6px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.vip-advanced {
|
||||
border: 1px solid var(--vip-line);
|
||||
border-radius: 12px;
|
||||
background: var(--vip-surface);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.vip-advanced .ant-collapse-header {
|
||||
margin: 0;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
.vip-advanced .ant-collapse-content-box {
|
||||
padding: 4px 16px 16px;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,9 +39,12 @@ import {
|
||||
HelpCircle,
|
||||
X,
|
||||
Loader2,
|
||||
Wallet,
|
||||
} from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { showError, showSuccess } from '../../../../../helpers';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { formatQuoteAmount } from '../../../../../hooks/creation/useCreationQuote';
|
||||
import {
|
||||
canCancelVideoTask,
|
||||
canRegenerateVideoTask,
|
||||
@@ -52,6 +55,21 @@ import './VideoPreviewPanel.css';
|
||||
|
||||
const { Title, Text, Paragraph } = Typography;
|
||||
|
||||
// 估价 budget_source → 预算层级名(i18n key);org_budget 实际值为 org_budget:<subject_type>
|
||||
const BUDGET_SOURCE_LABELS = {
|
||||
org_budget: '部门 / 项目预算',
|
||||
token: '令牌额度',
|
||||
org_member: '成员额度',
|
||||
org_gift: '企业赠送额度',
|
||||
org: '企业额度',
|
||||
membership: '会员额度',
|
||||
gift: '赠送余额',
|
||||
user: '账户余额',
|
||||
};
|
||||
|
||||
const budgetSourceLabel = (source) =>
|
||||
BUDGET_SOURCE_LABELS[String(source || '').split(':')[0]] || '';
|
||||
|
||||
const VideoPreviewPanel = ({
|
||||
formData,
|
||||
generating,
|
||||
@@ -62,8 +80,15 @@ const VideoPreviewPanel = ({
|
||||
selectedTaskForPlay, // 新增:从任务列表选择的任务
|
||||
onRegenerate, // 新增:再生成回调
|
||||
onClearSelectedTask, // 新增:清除选中任务的回调(关闭视频播放)
|
||||
submitBlock = '', // 不能提交的原因(为空表示可提交)
|
||||
submitting = false,
|
||||
quote = null,
|
||||
quoteLoading = false,
|
||||
quoteFailed = false,
|
||||
estSeconds = 0,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const [windowWidth, setWindowWidth] = useState(window.innerWidth);
|
||||
|
||||
// 监听窗口大小变化
|
||||
@@ -201,12 +226,35 @@ const VideoPreviewPanel = ({
|
||||
}
|
||||
};
|
||||
|
||||
// 判断按钮是否禁用
|
||||
const isButtonDisabled =
|
||||
(!formData.prompt && !formData.selectedTemplate) ||
|
||||
!selectedModel ||
|
||||
(typeof selectedModel === 'object' && selectedModel.level_locked) ||
|
||||
(formData.mode === 'image2video' && !formData.image);
|
||||
// 判断按钮是否禁用(原因由 useVideoGeneration 按 schema 计算)
|
||||
const isButtonDisabled = Boolean(submitBlock);
|
||||
// 余额 / 预算不足:按钮变为"去充值"(估价失败时不阻止提交)
|
||||
const needTopUp = !isButtonDisabled && quote?.balance_enough === false;
|
||||
|
||||
// 估价文案:"预计 ¥x · 约 N 秒 · 失败自动退还"
|
||||
const renderQuoteText = () => {
|
||||
const parts = [];
|
||||
const item = quote?.items?.[0];
|
||||
const amount =
|
||||
item && !item.error
|
||||
? formatQuoteAmount(item.display_amount, item.currency)
|
||||
: '';
|
||||
if (quoteFailed || (quote && !amount)) {
|
||||
parts.push(t('价格以实际扣费为准'));
|
||||
} else if (amount) {
|
||||
parts.push(
|
||||
item.approximate
|
||||
? t('预计约 {{amount}}', { amount })
|
||||
: t('预计 {{amount}}', { amount }),
|
||||
);
|
||||
} else if (quoteLoading) {
|
||||
parts.push(t('正在估价...'));
|
||||
}
|
||||
if (estSeconds > 0) parts.push(t('约 {{n}} 秒', { n: estSeconds }));
|
||||
if (parts.length === 0) return null;
|
||||
parts.push(t('失败自动退还'));
|
||||
return parts.join(' · ');
|
||||
};
|
||||
|
||||
// 渲染顶部操作栏(始终显示)
|
||||
const renderTopBar = () => {
|
||||
@@ -234,52 +282,68 @@ const VideoPreviewPanel = ({
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
type='primary'
|
||||
theme='solid'
|
||||
size={windowWidth > 768 ? 'default' : 'small'}
|
||||
icon={<Play size={16} fill='currentColor' />}
|
||||
onClick={isButtonDisabled ? undefined : handleGenerate}
|
||||
disabled={isButtonDisabled || generating}
|
||||
style={{
|
||||
fontWeight: 600,
|
||||
background:
|
||||
isButtonDisabled || generating
|
||||
? undefined
|
||||
: 'linear-gradient(135deg, #1890ff 0%, #0050b3 100%)',
|
||||
border: 'none',
|
||||
}}
|
||||
>
|
||||
{generating
|
||||
? t('生成中...')
|
||||
: windowWidth > 768
|
||||
? t('开始生成')
|
||||
: t('生成')}
|
||||
</Button>
|
||||
{needTopUp ? (
|
||||
<Button
|
||||
type='warning'
|
||||
theme='solid'
|
||||
size={windowWidth > 768 ? 'default' : 'small'}
|
||||
icon={<Wallet size={16} />}
|
||||
onClick={() => navigate('/console/topup')}
|
||||
style={{ fontWeight: 600 }}
|
||||
>
|
||||
{t('去充值')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
type='primary'
|
||||
theme='solid'
|
||||
size={windowWidth > 768 ? 'default' : 'small'}
|
||||
icon={<Play size={16} fill='currentColor' />}
|
||||
onClick={isButtonDisabled ? undefined : handleGenerate}
|
||||
disabled={isButtonDisabled || submitting}
|
||||
loading={submitting}
|
||||
style={{
|
||||
fontWeight: 600,
|
||||
background:
|
||||
isButtonDisabled || submitting
|
||||
? undefined
|
||||
: 'linear-gradient(135deg, var(--ui-color-primary) 0%, var(--ui-color-primary-active, var(--ui-color-primary)) 100%)',
|
||||
border: 'none',
|
||||
}}
|
||||
>
|
||||
{submitting
|
||||
? t('提交中...')
|
||||
: windowWidth > 768
|
||||
? t('开始生成')
|
||||
: t('生成')}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{/* 估价 / 余额不足说明 */}
|
||||
{!isButtonDisabled && (
|
||||
<Text
|
||||
type={needTopUp ? 'warning' : 'tertiary'}
|
||||
style={{
|
||||
fontSize: '12px',
|
||||
fontVariantNumeric: 'tabular-nums',
|
||||
minWidth: 0,
|
||||
}}
|
||||
aria-live='polite'
|
||||
>
|
||||
{needTopUp
|
||||
? budgetSourceLabel(quote?.budget_source)
|
||||
? t('{{source}}不足,请充值后再生成', {
|
||||
source: t(budgetSourceLabel(quote.budget_source)),
|
||||
})
|
||||
: t('余额或预算不足,请充值后再生成')
|
||||
: renderQuoteText()}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
{/* 禁用提示 */}
|
||||
{isButtonDisabled && !generating && (
|
||||
<Text type='tertiary' style={{ fontSize: '12px' }}>
|
||||
{!selectedModel && t('请选择模型')}
|
||||
{selectedModel &&
|
||||
typeof selectedModel === 'object' &&
|
||||
selectedModel.level_locked &&
|
||||
t('当前等级无权调用此模型')}
|
||||
{selectedModel &&
|
||||
!(
|
||||
typeof selectedModel === 'object' && selectedModel.level_locked
|
||||
) &&
|
||||
!formData.prompt &&
|
||||
!formData.selectedTemplate &&
|
||||
t('请输入提示词或选择模板')}
|
||||
{selectedModel &&
|
||||
!(
|
||||
typeof selectedModel === 'object' && selectedModel.level_locked
|
||||
) &&
|
||||
(formData.prompt || formData.selectedTemplate) &&
|
||||
formData.mode === 'image2video' &&
|
||||
!formData.image &&
|
||||
t('请上传图片')}
|
||||
{isButtonDisabled && !submitting && (
|
||||
<Text type='tertiary' style={{ fontSize: '12px' }} role='note'>
|
||||
{submitBlock}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
|
||||
@@ -1,296 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2025 QuantumNous
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Modal,
|
||||
Form,
|
||||
Select,
|
||||
Input,
|
||||
InputNumber,
|
||||
Switch,
|
||||
Space,
|
||||
Typography,
|
||||
} from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useIsMobile } from '../../../../../hooks/common/useIsMobile';
|
||||
import ModelSelector from '../../../../../components/common/ModelSelector';
|
||||
import { MODEL_CATEGORY } from '../../../../../constants';
|
||||
import { buildVideoRegenerateRequest } from '../../../../../helpers/videoTask';
|
||||
|
||||
const { TextArea } = Input;
|
||||
const { Text } = Typography;
|
||||
|
||||
const VideoRegenerateModal = ({ visible, onCancel, onConfirm, task }) => {
|
||||
const isNarrow = useIsMobile();
|
||||
const { t } = useTranslation();
|
||||
const [formData, setFormData] = useState({
|
||||
mode: 'text2video',
|
||||
prompt: '',
|
||||
negative_prompt: '',
|
||||
resolution: '1080P',
|
||||
duration: 5,
|
||||
fps: 30,
|
||||
ratio: '16:9',
|
||||
audio: false,
|
||||
seed: -1,
|
||||
prompt_extend: false,
|
||||
watermark: false,
|
||||
image: '',
|
||||
});
|
||||
const [selectedModel, setSelectedModel] = useState('');
|
||||
|
||||
// 从任务数据中提取参数
|
||||
useEffect(() => {
|
||||
if (task && visible) {
|
||||
const taskData = task.request || {};
|
||||
const mode = taskData.mode || 'text2video';
|
||||
const prompt = taskData.prompt || '';
|
||||
const negativePrompt = taskData.negative_prompt || '';
|
||||
const resolution = taskData.resolution || '1080P';
|
||||
const duration = taskData.duration || 5;
|
||||
const fps = taskData.fps || 30;
|
||||
const ratio = taskData.ratio || '16:9';
|
||||
const audio = taskData.audio === true;
|
||||
const seed = taskData.seed ?? -1;
|
||||
const promptExtend = taskData.prompt_extend === true;
|
||||
const watermark = taskData.watermark === true;
|
||||
const image = taskData.image || '';
|
||||
const model = taskData.model || '';
|
||||
|
||||
setFormData({
|
||||
mode,
|
||||
prompt,
|
||||
negative_prompt: negativePrompt,
|
||||
resolution,
|
||||
duration,
|
||||
fps,
|
||||
ratio,
|
||||
audio,
|
||||
seed,
|
||||
prompt_extend: promptExtend,
|
||||
watermark,
|
||||
image,
|
||||
});
|
||||
|
||||
setSelectedModel(model);
|
||||
}
|
||||
}, [task, visible]);
|
||||
|
||||
// 处理表单提交
|
||||
const handleSubmit = () => {
|
||||
if (!selectedModel || typeof selectedModel !== 'object') {
|
||||
return;
|
||||
}
|
||||
|
||||
// 构建请求数据
|
||||
onConfirm(buildVideoRegenerateRequest(formData, selectedModel));
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={t('再生成视频')}
|
||||
visible={visible}
|
||||
onCancel={onCancel}
|
||||
onOk={handleSubmit}
|
||||
okText={t('确认生成')}
|
||||
cancelText={t('取消')}
|
||||
width={700}
|
||||
bodyStyle={{
|
||||
maxHeight: '70vh',
|
||||
overflowX: 'hidden',
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
// 窄屏改为标签在上:labelWidth=120 在 ~294px 的弹窗体里要吃掉 41%,
|
||||
// 剩给控件的宽度放不下 seed 输入框和它的说明文案
|
||||
labelPosition={isNarrow ? 'top' : 'left'}
|
||||
labelAlign='right'
|
||||
labelWidth={isNarrow ? undefined : 120}
|
||||
>
|
||||
{/* 生成模式 */}
|
||||
<Form.Label>
|
||||
<Text strong>{t('生成模式')}</Text>
|
||||
</Form.Label>
|
||||
<Form.Input>
|
||||
<Select
|
||||
value={formData.mode}
|
||||
onChange={(value) => {
|
||||
setFormData({ ...formData, mode: value });
|
||||
setSelectedModel('');
|
||||
}}
|
||||
style={{ width: '100%' }}
|
||||
>
|
||||
<Select.Option value='text2video'>{t('文生视频')}</Select.Option>
|
||||
<Select.Option value='image2video'>{t('图生视频')}</Select.Option>
|
||||
</Select>
|
||||
</Form.Input>
|
||||
|
||||
{/* 模型选择 */}
|
||||
<Form.Label required>
|
||||
<Text strong>{t('选择模型')}</Text>
|
||||
</Form.Label>
|
||||
<Form.Input>
|
||||
<ModelSelector
|
||||
key={formData.mode}
|
||||
category={
|
||||
formData.mode === 'text2video'
|
||||
? MODEL_CATEGORY.TEXT_TO_VIDEO
|
||||
: MODEL_CATEGORY.IMAGE_TO_VIDEO
|
||||
}
|
||||
value={
|
||||
selectedModel?.id || selectedModel?.model_name || selectedModel
|
||||
}
|
||||
onChange={setSelectedModel}
|
||||
placeholder={t('请选择模型')}
|
||||
autoSelectFirst={false}
|
||||
onModelsLoaded={(models) => {
|
||||
if (typeof selectedModel !== 'string' || !selectedModel) return;
|
||||
const match = models.find(
|
||||
(model) => model.model_name === selectedModel,
|
||||
);
|
||||
setSelectedModel(match || '');
|
||||
}}
|
||||
/>
|
||||
</Form.Input>
|
||||
|
||||
{/* 提示词 */}
|
||||
<Form.Label required>
|
||||
<Text strong>{t('提示词')}</Text>
|
||||
</Form.Label>
|
||||
<Form.Input>
|
||||
<TextArea
|
||||
value={formData.prompt}
|
||||
onChange={(value) => setFormData({ ...formData, prompt: value })}
|
||||
placeholder={t('描述你想生成的视频内容')}
|
||||
rows={3}
|
||||
maxLength={2000}
|
||||
showClear
|
||||
/>
|
||||
</Form.Input>
|
||||
|
||||
{/* 反向提示词 */}
|
||||
<Form.Label>
|
||||
<Text strong>{t('反向提示词')}</Text>
|
||||
</Form.Label>
|
||||
<Form.Input>
|
||||
<TextArea
|
||||
value={formData.negative_prompt}
|
||||
onChange={(value) =>
|
||||
setFormData({ ...formData, negative_prompt: value })
|
||||
}
|
||||
placeholder={t('描述不想出现的内容')}
|
||||
rows={2}
|
||||
maxLength={1000}
|
||||
showClear
|
||||
/>
|
||||
</Form.Input>
|
||||
|
||||
{/* 分辨率 */}
|
||||
<Form.Label>
|
||||
<Text strong>{t('分辨率')}</Text>
|
||||
</Form.Label>
|
||||
<Form.Input>
|
||||
<Select
|
||||
value={formData.resolution}
|
||||
onChange={(value) =>
|
||||
setFormData({ ...formData, resolution: value })
|
||||
}
|
||||
style={{ width: '100%' }}
|
||||
>
|
||||
<Select.Option value='480P'>480P (832*480)</Select.Option>
|
||||
<Select.Option value='720P'>720P (1280*720)</Select.Option>
|
||||
<Select.Option value='1080P'>1080P (1920*1080)</Select.Option>
|
||||
</Select>
|
||||
</Form.Input>
|
||||
|
||||
{/* 时长 */}
|
||||
<Form.Label>
|
||||
<Text strong>{t('视频时长')}</Text>
|
||||
</Form.Label>
|
||||
<Form.Input>
|
||||
<InputNumber
|
||||
value={formData.duration}
|
||||
onChange={(value) => setFormData({ ...formData, duration: value })}
|
||||
min={3}
|
||||
max={10}
|
||||
suffix={t('秒')}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</Form.Input>
|
||||
|
||||
{/* 宽高比 */}
|
||||
<Form.Label>
|
||||
<Text strong>{t('宽高比')}</Text>
|
||||
</Form.Label>
|
||||
<Form.Input>
|
||||
<Select
|
||||
value={formData.ratio}
|
||||
onChange={(value) => setFormData({ ...formData, ratio: value })}
|
||||
style={{ width: '100%' }}
|
||||
>
|
||||
<Select.Option value='16:9'>{t('16:9 (横屏)')}</Select.Option>
|
||||
<Select.Option value='9:16'>{t('9:16 (竖屏)')}</Select.Option>
|
||||
<Select.Option value='1:1'>{t('1:1 (方形)')}</Select.Option>
|
||||
</Select>
|
||||
</Form.Input>
|
||||
|
||||
{/* 高级选项 */}
|
||||
<Form.Label>
|
||||
<Text strong>{t('高级选项')}</Text>
|
||||
</Form.Label>
|
||||
<Form.Input>
|
||||
<Space vertical align='start' style={{ width: '100%' }}>
|
||||
<Space>
|
||||
<Switch
|
||||
checked={formData.audio}
|
||||
onChange={(checked) =>
|
||||
setFormData({ ...formData, audio: checked })
|
||||
}
|
||||
/>
|
||||
<Text>{t('生成音频')}</Text>
|
||||
</Space>
|
||||
<Space>
|
||||
<Switch
|
||||
checked={formData.prompt_extend}
|
||||
onChange={(checked) =>
|
||||
setFormData({ ...formData, prompt_extend: checked })
|
||||
}
|
||||
/>
|
||||
<Text>{t('提示词扩展')}</Text>
|
||||
</Space>
|
||||
<Space>
|
||||
<InputNumber
|
||||
value={formData.seed}
|
||||
onChange={(value) => setFormData({ ...formData, seed: value })}
|
||||
placeholder={t('随机种子(可选)')}
|
||||
min={0}
|
||||
style={{ width: '100%', maxWidth: 200 }}
|
||||
/>
|
||||
<Text type='tertiary'>{t('固定种子可复现结果')}</Text>
|
||||
</Space>
|
||||
</Space>
|
||||
</Form.Input>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default VideoRegenerateModal;
|
||||
Reference in New Issue
Block a user