feat: task log show username
This commit is contained in:
@@ -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('平台'),
|
||||
|
||||
Reference in New Issue
Block a user