feat: task log show username

This commit is contained in:
feitianbubu
2026-01-10 23:21:12 +08:00
parent 2432181ca0
commit 68c9890bb8
3 changed files with 49 additions and 1 deletions

View File

@@ -42,6 +42,8 @@ import {
TASK_ACTION_REMIX_GENERATE,
} from '../../../constants/common.constant';
import { CHANNEL_OPTIONS } from '../../../constants/channel.constants';
import { stringToColor } from '../../../helpers/render';
import { Avatar, Space } from '@douyinfe/semi-ui';
const colors = [
'amber',
@@ -288,6 +290,39 @@ export const getTaskLogsColumns = ({
);
},
},
{
key: COLUMN_KEYS.USERNAME,
title: t('用户'),
dataIndex: 'username',
render: (text, record, index) => {
if (!isAdminUser) {
return <></>;
}
const displayName = record.display_name;
const label = displayName || text || t('未知');
const avatarText =
typeof displayName === 'string' && displayName.length > 0
? displayName[0]
: typeof text === 'string' && text.length > 0
? text[0]
: '?';
return (
<Space>
<Avatar
size='extra-small'
color={stringToColor(label)}
style={{ cursor: 'default' }}
>
{avatarText}
</Avatar>
<Typography.Text ellipsis={{ showTooltip: true }}>
{label}
</Typography.Text>
</Space>
);
},
},
{
key: COLUMN_KEYS.PLATFORM,
title: t('平台'),