diff --git a/web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx b/web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx index d38dc6193..cf2c1c96c 100644 --- a/web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx +++ b/web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx @@ -20,12 +20,12 @@ For commercial licensing, please contact support@quantumnous.com import React from 'react'; import { Avatar, - Button, Space, Tag, Tooltip, Popover, Typography, + Button } from '@douyinfe/semi-ui'; import { timestamp2string, @@ -41,8 +41,8 @@ import { renderClaudeModelPrice, renderModelPrice, } from '../../../helpers'; -import { IconHelpCircle, IconStarStroked } from '@douyinfe/semi-icons'; -import { Route } from 'lucide-react'; +import { IconHelpCircle } from '@douyinfe/semi-icons'; +import { Route, Sparkles } from 'lucide-react'; const colors = [ 'amber', @@ -307,6 +307,9 @@ export const getLogsColumns = ({ render: (text, record, index) => { let isMultiKey = false; let multiKeyIndex = -1; + let content = t('渠道') + `:${record.channel}`; + let affinity = null; + let showMarker = false; let other = getLogOther(record.other); if (other?.admin_info) { let adminInfo = other.admin_info; @@ -314,21 +317,71 @@ export const getLogsColumns = ({ isMultiKey = true; multiKeyIndex = adminInfo.multi_key_index; } + if ( + Array.isArray(adminInfo.use_channel) && + adminInfo.use_channel.length > 0 + ) { + content = t('渠道') + `:${adminInfo.use_channel.join('->')}`; + } + if (adminInfo.channel_affinity) { + affinity = adminInfo.channel_affinity; + showMarker = true; + } } return isAdminUser && (record.type === 0 || record.type === 2 || record.type === 5) ? ( - - - + + + + {text} + + + + {showMarker && ( + +
{content}
+ {affinity ? ( +
+ {buildChannelAffinityTooltip(affinity, t)} +
+ ) : null} + + } > - {text} -
-
-
+ { + e.stopPropagation(); + openChannelAffinityUsageCacheModal?.(affinity); + }} + > + + + + )} + {isMultiKey && ( {multiKeyIndex} @@ -559,7 +612,6 @@ export const getLogsColumns = ({ return <>; } let content = t('渠道') + `:${record.channel}`; - let affinity = null; if (record.other !== '') { let other = JSON.parse(record.other); if (other === null) { @@ -567,60 +619,17 @@ export const getLogsColumns = ({ } if (other.admin_info !== undefined) { if ( - other.admin_info.use_channel !== null && - other.admin_info.use_channel !== undefined && - other.admin_info.use_channel !== '' + other.admin_info.use_channel !== null && + other.admin_info.use_channel !== undefined && + other.admin_info.use_channel !== '' ) { let useChannel = other.admin_info.use_channel; let useChannelStr = useChannel.join('->'); content = t('渠道') + `:${useChannelStr}`; } - if (other.admin_info.channel_affinity) { - affinity = other.admin_info.channel_affinity; - } } } - return isAdminUser ? ( - -
{content}
- {affinity ? ( - - {buildChannelAffinityTooltip(affinity, t)} -
- -
- - } - > - - - - - {t('优选')} - - - -
- ) : null} -
- ) : ( - <> - ); + return isAdminUser ?
{content}
: <>; }, }, {