Revert "feat(org): expose enterprise drawing and task logs"
This reverts commit 72bec4f8f1.
This commit is contained in:
@@ -55,6 +55,7 @@ export const exportTaskLogsPageCsv = (logs, isAdminUser, t) => {
|
||||
{ key: 'channel_name', title: t('渠道名称') },
|
||||
]
|
||||
: []),
|
||||
{ key: 'platform', title: t('平台') },
|
||||
{ key: 'action', title: t('类型') },
|
||||
{
|
||||
key: 'model',
|
||||
|
||||
@@ -35,6 +35,7 @@ import {
|
||||
Video,
|
||||
Sparkles,
|
||||
Timer,
|
||||
Image as ImageIcon,
|
||||
ImagePlus,
|
||||
Coins,
|
||||
Cpu,
|
||||
@@ -47,6 +48,7 @@ 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
|
||||
@@ -229,6 +231,34 @@ 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' },
|
||||
@@ -326,6 +356,12 @@ 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,
|
||||
@@ -393,7 +429,6 @@ export const getTaskLogsColumns = ({
|
||||
copyText,
|
||||
openContentModal,
|
||||
isAdminUser,
|
||||
isRootUser = false,
|
||||
openVideoModal,
|
||||
usageRecordMode = false,
|
||||
}) => {
|
||||
@@ -447,6 +482,14 @@ 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('类型'),
|
||||
@@ -489,16 +532,10 @@ export const getTaskLogsColumns = ({
|
||||
return (
|
||||
<Typography.Text
|
||||
ellipsis={{ showTooltip: true }}
|
||||
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'
|
||||
}
|
||||
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'
|
||||
>
|
||||
{text}
|
||||
</Typography.Text>
|
||||
|
||||
@@ -51,7 +51,6 @@ const TaskLogsFilters = ({
|
||||
isAdminUser,
|
||||
getFreshInitValues,
|
||||
usageRecordMode = false,
|
||||
hideDateRange = false,
|
||||
t,
|
||||
}) => {
|
||||
const SearchIcon = Search;
|
||||
@@ -269,27 +268,25 @@ const TaskLogsFilters = ({
|
||||
|
||||
{/* 搜索字段网格 */}
|
||||
<div className='grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3'>
|
||||
{/* 时间选择器:企业页复用上方消费记录的已提交时间范围 */}
|
||||
{!hideDateRange && (
|
||||
<div className='col-span-1 lg:col-span-2'>
|
||||
<div className='relative group'>
|
||||
<div className='absolute -inset-0.5 bg-gradient-to-r from-cyan-500/20 to-blue-500/20 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300 blur-sm' />
|
||||
<div className='relative'>
|
||||
<Form.DatePicker
|
||||
field='dateRange'
|
||||
className='w-full'
|
||||
type='dateTimeRange'
|
||||
placeholder={[t('开始时间'), t('结束时间')]}
|
||||
showClear
|
||||
pure
|
||||
size='small'
|
||||
prefix={<InputPrefix icon={Calendar} />}
|
||||
presets={datePresets}
|
||||
/>
|
||||
</div>
|
||||
{/* 时间选择器 */}
|
||||
<div className='col-span-1 lg:col-span-2'>
|
||||
<div className='relative group'>
|
||||
<div className='absolute -inset-0.5 bg-gradient-to-r from-cyan-500/20 to-blue-500/20 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300 blur-sm' />
|
||||
<div className='relative'>
|
||||
<Form.DatePicker
|
||||
field='dateRange'
|
||||
className='w-full'
|
||||
type='dateTimeRange'
|
||||
placeholder={[t('开始时间'), t('结束时间')]}
|
||||
showClear
|
||||
pure
|
||||
size='small'
|
||||
prefix={<InputPrefix icon={Calendar} />}
|
||||
presets={datePresets}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* 任务 ID */}
|
||||
<div className='relative group'>
|
||||
|
||||
@@ -42,7 +42,6 @@ const TaskLogsTable = (taskLogsData) => {
|
||||
openContentModal,
|
||||
openVideoModal,
|
||||
isAdminUser,
|
||||
isRootUser,
|
||||
t,
|
||||
COLUMN_KEYS,
|
||||
usageRecordMode = false,
|
||||
@@ -58,7 +57,6 @@ const TaskLogsTable = (taskLogsData) => {
|
||||
openVideoModal,
|
||||
isAdminUser,
|
||||
usageRecordMode,
|
||||
isRootUser,
|
||||
});
|
||||
}, [
|
||||
t,
|
||||
@@ -68,7 +66,6 @@ const TaskLogsTable = (taskLogsData) => {
|
||||
openVideoModal,
|
||||
isAdminUser,
|
||||
usageRecordMode,
|
||||
isRootUser,
|
||||
]);
|
||||
|
||||
// Filter columns based on visibility settings
|
||||
|
||||
@@ -34,19 +34,8 @@ import { useTaskLogsData } from '../../../hooks/task-logs/useTaskLogsData';
|
||||
import { useIsMobile } from '../../../hooks/common/useIsMobile';
|
||||
import { createCardProPagination } from '../../../helpers/utils';
|
||||
|
||||
const TaskLogsPage = ({
|
||||
usageRecordMode = false,
|
||||
organizationMode = false,
|
||||
sharedStartTimestamp,
|
||||
sharedEndTimestamp,
|
||||
sharedFilterRevision = 0,
|
||||
}) => {
|
||||
const taskLogsData = useTaskLogsData({
|
||||
organizationMode,
|
||||
sharedStartTimestamp,
|
||||
sharedEndTimestamp,
|
||||
sharedFilterRevision,
|
||||
});
|
||||
const TaskLogsPage = ({ usageRecordMode = false }) => {
|
||||
const taskLogsData = useTaskLogsData();
|
||||
const isMobile = useIsMobile();
|
||||
// 与 CardPro 一致:移动端默认收起筛选区,仅视图状态
|
||||
const [showMobileFilters, setShowMobileFilters] = useState(false);
|
||||
@@ -178,12 +167,7 @@ const TaskLogsPage = ({
|
||||
statsArea={
|
||||
<TaskLogsActions {...taskLogsData} logs={taskLogsData.logs} />
|
||||
}
|
||||
searchArea={
|
||||
<TaskLogsFilters
|
||||
{...taskLogsData}
|
||||
hideDateRange={taskLogsData.usesSharedDateRange}
|
||||
/>
|
||||
}
|
||||
searchArea={<TaskLogsFilters {...taskLogsData} />}
|
||||
paginationArea={createCardProPagination({
|
||||
currentPage: taskLogsData.activePage,
|
||||
pageSize: taskLogsData.pageSize,
|
||||
|
||||
@@ -30,7 +30,6 @@ const ColumnSelectorModal = ({
|
||||
initDefaultColumns,
|
||||
COLUMN_KEYS,
|
||||
isAdminUser,
|
||||
isRootUser,
|
||||
copyText,
|
||||
openContentModal,
|
||||
t,
|
||||
@@ -42,7 +41,6 @@ const ColumnSelectorModal = ({
|
||||
copyText,
|
||||
openContentModal,
|
||||
isAdminUser,
|
||||
isRootUser,
|
||||
});
|
||||
|
||||
// 计算"全选"状态时应忽略的 key:当前角色下不可见的管理员专属列
|
||||
|
||||
Reference in New Issue
Block a user