feat(org): expose enterprise drawing and task logs
(cherry picked from commit b80afd273c)
This commit is contained in:
@@ -35,7 +35,6 @@ import {
|
||||
Video,
|
||||
Sparkles,
|
||||
Timer,
|
||||
Image as ImageIcon,
|
||||
ImagePlus,
|
||||
Coins,
|
||||
Cpu,
|
||||
@@ -48,7 +47,6 @@ import {
|
||||
IMAGE_ACTION_GENERATE,
|
||||
IMAGE_ACTION_EDIT,
|
||||
} from '../../../constants/common.constant';
|
||||
import { CHANNEL_OPTIONS } from '../../../constants/channel.constants';
|
||||
import { renderQuota } from '../../../helpers';
|
||||
|
||||
// 仅保留与下方 COLOR_CONFIG 一一对应的色值,避免 amber/lime/violet/teal/indigo/light-blue
|
||||
@@ -231,34 +229,6 @@ const renderType = (type, t) => {
|
||||
);
|
||||
};
|
||||
|
||||
const renderPlatform = (platform, t) => {
|
||||
let option = CHANNEL_OPTIONS.find(
|
||||
(opt) => String(opt.value) === String(platform),
|
||||
);
|
||||
if (option) {
|
||||
return (
|
||||
<CustomTag
|
||||
icon={Video}
|
||||
label={option.label}
|
||||
colorKey={option.color || 'cyan'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (platform === 'suno') {
|
||||
return <CustomTag icon={Music} label='Suno' colorKey='green' />;
|
||||
}
|
||||
if (platform === 'image') {
|
||||
return <CustomTag icon={ImageIcon} label={t('图片')} colorKey='cyan' />;
|
||||
}
|
||||
if (platform === 'video') {
|
||||
return <CustomTag icon={Video} label={t('视频')} colorKey='blue' />;
|
||||
}
|
||||
if (platform === 'mj') {
|
||||
return <CustomTag icon={Sparkles} label='Midjourney' colorKey='purple' />;
|
||||
}
|
||||
return <CustomTag icon={HelpCircle} label={t('未知')} colorKey='grey' />;
|
||||
};
|
||||
|
||||
const renderStatus = (type, t) => {
|
||||
const statusConfig = {
|
||||
SUCCESS: { icon: CheckCircle, label: t('成功'), color: 'green' },
|
||||
@@ -356,12 +326,6 @@ const applyTaskRecordPresentation = (columns, { COLUMN_KEYS }) =>
|
||||
);
|
||||
},
|
||||
};
|
||||
case COLUMN_KEYS.PLATFORM:
|
||||
return {
|
||||
...column,
|
||||
render: (text, record, index) =>
|
||||
unwrap(text, record, index)?.props?.label ?? '-',
|
||||
};
|
||||
case COLUMN_KEYS.TYPE:
|
||||
return {
|
||||
...column,
|
||||
@@ -429,6 +393,7 @@ export const getTaskLogsColumns = ({
|
||||
copyText,
|
||||
openContentModal,
|
||||
isAdminUser,
|
||||
isRootUser = false,
|
||||
openVideoModal,
|
||||
usageRecordMode = false,
|
||||
}) => {
|
||||
@@ -482,14 +447,6 @@ export const getTaskLogsColumns = ({
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: COLUMN_KEYS.PLATFORM,
|
||||
title: t('平台'),
|
||||
dataIndex: 'platform',
|
||||
render: (text, record, index) => {
|
||||
return <div>{renderPlatform(text, t)}</div>;
|
||||
},
|
||||
},
|
||||
{
|
||||
key: COLUMN_KEYS.TYPE,
|
||||
title: t('类型'),
|
||||
@@ -532,10 +489,16 @@ export const getTaskLogsColumns = ({
|
||||
return (
|
||||
<Typography.Text
|
||||
ellipsis={{ showTooltip: true }}
|
||||
onClick={() => {
|
||||
openContentModal(JSON.stringify(record, null, 2));
|
||||
}}
|
||||
className='cursor-pointer hover:text-blue-500 dark:hover:text-blue-400 transition-colors font-mono text-xs'
|
||||
onClick={
|
||||
isRootUser
|
||||
? () => openContentModal(JSON.stringify(record, null, 2))
|
||||
: undefined
|
||||
}
|
||||
className={
|
||||
isRootUser
|
||||
? 'cursor-pointer hover:text-blue-500 dark:hover:text-blue-400 transition-colors font-mono text-xs'
|
||||
: 'font-mono text-xs'
|
||||
}
|
||||
>
|
||||
{text}
|
||||
</Typography.Text>
|
||||
|
||||
Reference in New Issue
Block a user