forked from 77media/video-flow
加上 开启/关闭 剧本拓展
This commit is contained in:
parent
40fe7ac0e8
commit
9ec610c8de
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
# NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com
|
NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com
|
||||||
# NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com
|
NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com
|
||||||
# NEXT_PUBLIC_CUT_URL = https://smartcut.huiying.video
|
NEXT_PUBLIC_CUT_URL = https://smartcut.huiying.video
|
||||||
NEXT_PUBLIC_JAVA_URL = https://auth.movieflow.ai
|
# NEXT_PUBLIC_JAVA_URL = https://auth.movieflow.ai
|
||||||
NEXT_PUBLIC_BASE_URL = https://api.video.movieflow.ai
|
# NEXT_PUBLIC_BASE_URL = https://api.video.movieflow.ai
|
||||||
NEXT_PUBLIC_CUT_URL = https://smartcut.movieflow.ai
|
# NEXT_PUBLIC_CUT_URL = https://smartcut.movieflow.ai
|
||||||
|
|
||||||
# 失败率
|
# 失败率
|
||||||
NEXT_PUBLIC_ERROR_CONFIG = 0.2
|
NEXT_PUBLIC_ERROR_CONFIG = 0.2
|
||||||
@ -27,6 +27,7 @@ import {
|
|||||||
Popconfirm,
|
Popconfirm,
|
||||||
Image,
|
Image,
|
||||||
Popover,
|
Popover,
|
||||||
|
Switch,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import { UploadOutlined } from "@ant-design/icons";
|
import { UploadOutlined } from "@ant-design/icons";
|
||||||
import { StoryTemplateEntity } from "@/app/service/domain/Entities";
|
import { StoryTemplateEntity } from "@/app/service/domain/Entities";
|
||||||
@ -114,16 +115,20 @@ export function ChatInputBox({ noData }: { noData: boolean }) {
|
|||||||
const [isItemGenerating, setIsItemGenerating] = useState<{[key: string]: boolean}>({}); // 道具AI生成按钮的加载状态
|
const [isItemGenerating, setIsItemGenerating] = useState<{[key: string]: boolean}>({}); // 道具AI生成按钮的加载状态
|
||||||
|
|
||||||
// 配置选项状态 - 整合所有配置项到一个对象
|
// 配置选项状态 - 整合所有配置项到一个对象
|
||||||
const [configOptions, setConfigOptions] = useState<{
|
type ConfigOptions = {
|
||||||
mode: "auto" | "manual";
|
mode: "auto" | "manual";
|
||||||
resolution: "720p" | "1080p" | "4k";
|
resolution: "720p" | "1080p" | "4k";
|
||||||
language: string;
|
language: string;
|
||||||
videoDuration: string;
|
videoDuration: string;
|
||||||
}>({
|
expansion_mode: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
const [configOptions, setConfigOptions] = useState<ConfigOptions>({
|
||||||
mode: "auto",
|
mode: "auto",
|
||||||
resolution: "720p",
|
resolution: "720p",
|
||||||
language: "english",
|
language: "english",
|
||||||
videoDuration: "1min",
|
videoDuration: "1min",
|
||||||
|
expansion_mode: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 从 localStorage 初始化配置
|
// 从 localStorage 初始化配置
|
||||||
@ -137,6 +142,7 @@ export function ChatInputBox({ noData }: { noData: boolean }) {
|
|||||||
resolution: parsed.resolution || "720p",
|
resolution: parsed.resolution || "720p",
|
||||||
language: parsed.language || "english",
|
language: parsed.language || "english",
|
||||||
videoDuration: parsed.videoDuration || "1min",
|
videoDuration: parsed.videoDuration || "1min",
|
||||||
|
expansion_mode: typeof parsed.expansion_mode === 'boolean' ? parsed.expansion_mode : false,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn('解析保存的配置失败,使用默认配置:', error);
|
console.warn('解析保存的配置失败,使用默认配置:', error);
|
||||||
@ -144,7 +150,7 @@ export function ChatInputBox({ noData }: { noData: boolean }) {
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onConfigChange = (key: string, value: string) => {
|
const onConfigChange = <K extends keyof ConfigOptions>(key: K, value: ConfigOptions[K]) => {
|
||||||
setConfigOptions((prev) => ({
|
setConfigOptions((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[key]: value,
|
[key]: value,
|
||||||
@ -177,6 +183,7 @@ export function ChatInputBox({ noData }: { noData: boolean }) {
|
|||||||
resolution: configOptions.resolution,
|
resolution: configOptions.resolution,
|
||||||
language: configOptions.language,
|
language: configOptions.language,
|
||||||
video_duration: configOptions.videoDuration,
|
video_duration: configOptions.videoDuration,
|
||||||
|
expansion_mode: configOptions.expansion_mode,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 调用创建剧集API
|
// 调用创建剧集API
|
||||||
@ -378,6 +385,27 @@ export function ChatInputBox({ noData }: { noData: boolean }) {
|
|||||||
<span className="text-sm">{LauguageOptions.find((option) => option.value === configOptions.language)?.code}</span>
|
<span className="text-sm">{LauguageOptions.find((option) => option.value === configOptions.language)?.code}</span>
|
||||||
</button>
|
</button>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
||||||
|
{/* 分隔线 */}
|
||||||
|
<div className="w-px h-4 bg-white/[0.20]"></div>
|
||||||
|
|
||||||
|
{/* 剧本扩展开关 */}
|
||||||
|
<Tooltip title="Enable script expansion" placement="top" trigger={isDesktop ? "hover" : "click"}>
|
||||||
|
<div data-alt="config-expansion-mode" className="flex items-center gap-2 px-2">
|
||||||
|
{/* <span className="text-sm text-white/80">Script Expansion</span> */}
|
||||||
|
<Switch
|
||||||
|
size="small"
|
||||||
|
checked={configOptions.expansion_mode}
|
||||||
|
onChange={(checked) => onConfigChange('expansion_mode', checked)}
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'rgba(255,255,255,0.45)',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<span className={`text-xs text-white/50`}>
|
||||||
|
{configOptions.expansion_mode ? 'On' : 'Off'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 右侧Action按钮 */}
|
{/* 右侧Action按钮 */}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user