feat: video action to constant

This commit is contained in:
skynono
2025-06-27 22:43:01 +08:00
parent 0a04a76c71
commit 59a1f4c900
6 changed files with 21 additions and 10 deletions

View File

@@ -51,6 +51,7 @@ import {
IconDescend
} from '@douyinfe/semi-icons';
import { useTableCompactMode } from '../../hooks/useTableCompactMode';
import { TASK_ACTION_GENERATE, TASK_ACTION_TEXT_GENERATE } from '../../constants/common.constant';
const { Text } = Typography;
@@ -209,13 +210,13 @@ const LogsTable = () => {
{t('生成歌词')}
</Tag>
);
case 'generate':
case TASK_ACTION_GENERATE:
return (
<Tag color='blue' size='large' shape='circle' prefixIcon={<Sparkles size={14} />}>
{t('图生视频')}
</Tag>
);
case 'textGenerate':
case TASK_ACTION_TEXT_GENERATE:
return (
<Tag color='blue' size='large' shape='circle' prefixIcon={<Sparkles size={14} />}>
{t('文生视频')}
@@ -446,7 +447,7 @@ const LogsTable = () => {
fixed: 'right',
render: (text, record, index) => {
// 仅当为视频生成任务且成功,且 fail_reason 是 URL 时显示可点击链接
const isVideoTask = record.action === 'generate' || record.action === 'textGenerate';
const isVideoTask = record.action === TASK_ACTION_GENERATE || record.action === TASK_ACTION_TEXT_GENERATE;
const isSuccess = record.status === 'SUCCESS';
const isUrl = typeof text === 'string' && /^https?:\/\//.test(text);
if (isSuccess && isVideoTask && isUrl) {