diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js index 4b9ba9e8..ddf64631 100644 --- a/web/src/components/ChannelsTable.js +++ b/web/src/components/ChannelsTable.js @@ -245,16 +245,19 @@ const ChannelsTable = () => { key: COLUMN_KEYS.ID, title: t('ID'), dataIndex: 'id', + width: 50, }, { key: COLUMN_KEYS.NAME, title: t('名称'), dataIndex: 'name', + width: 80, }, { key: COLUMN_KEYS.GROUP, title: t('分组'), dataIndex: 'group', + width: 180, render: (text, record, index) => (
@@ -274,6 +277,7 @@ const ChannelsTable = () => { key: COLUMN_KEYS.TYPE, title: t('类型'), dataIndex: 'type', + width: 120, render: (text, record, index) => { if (record.children === undefined) { return <>{renderType(text)}; @@ -286,6 +290,7 @@ const ChannelsTable = () => { key: COLUMN_KEYS.STATUS, title: t('状态'), dataIndex: 'status', + width: 120, render: (text, record, index) => { if (text === 3) { if (record.other_info === '') { @@ -312,6 +317,7 @@ const ChannelsTable = () => { key: COLUMN_KEYS.RESPONSE_TIME, title: t('响应时间'), dataIndex: 'response_time', + width: 120, render: (text, record, index) => (
{renderResponseTime(text)}
), @@ -320,6 +326,7 @@ const ChannelsTable = () => { key: COLUMN_KEYS.BALANCE, title: t('已用/剩余'), dataIndex: 'expired_time', + width: 120, render: (text, record, index) => { if (record.children === undefined) { return ( @@ -359,6 +366,7 @@ const ChannelsTable = () => { key: COLUMN_KEYS.PRIORITY, title: t('优先级'), dataIndex: 'priority', + width: 100, render: (text, record, index) => { if (record.children === undefined) { return ( @@ -411,6 +419,7 @@ const ChannelsTable = () => { key: COLUMN_KEYS.WEIGHT, title: t('权重'), dataIndex: 'weight', + width: 100, render: (text, record, index) => { if (record.children === undefined) { return ( @@ -463,6 +472,7 @@ const ChannelsTable = () => { key: COLUMN_KEYS.OPERATE, title: '', dataIndex: 'operate', + width: 350, render: (text, record, index) => { if (record.children === undefined) { // 创建更多操作的下拉菜单项 diff --git a/web/src/components/LogsTable.js b/web/src/components/LogsTable.js index b7d12a0c..49c6bb5d 100644 --- a/web/src/components/LogsTable.js +++ b/web/src/components/LogsTable.js @@ -372,11 +372,13 @@ const LogsTable = () => { key: COLUMN_KEYS.TIME, title: t('时间'), dataIndex: 'timestamp2string', + width: 180, }, { key: COLUMN_KEYS.CHANNEL, title: t('渠道'), dataIndex: 'channel', + width: 80, className: isAdmin() ? 'tableShow' : 'tableHiddle', render: (text, record, index) => { return isAdminUser ? ( @@ -407,6 +409,7 @@ const LogsTable = () => { key: COLUMN_KEYS.USERNAME, title: t('用户'), dataIndex: 'username', + width: 150, className: isAdmin() ? 'tableShow' : 'tableHiddle', render: (text, record, index) => { return isAdminUser ? ( @@ -433,6 +436,7 @@ const LogsTable = () => { key: COLUMN_KEYS.TOKEN, title: t('令牌'), dataIndex: 'token_name', + width: 160, render: (text, record, index) => { return record.type === 0 || record.type === 2 || record.type === 5 ? (
@@ -458,6 +462,7 @@ const LogsTable = () => { key: COLUMN_KEYS.GROUP, title: t('分组'), dataIndex: 'group', + width: 120, render: (text, record, index) => { if (record.type === 0 || record.type === 2 || record.type === 5) { if (record.group) { @@ -490,6 +495,7 @@ const LogsTable = () => { key: COLUMN_KEYS.TYPE, title: t('类型'), dataIndex: 'type', + width: 100, render: (text, record, index) => { return <>{renderType(text)}; }, @@ -498,6 +504,7 @@ const LogsTable = () => { key: COLUMN_KEYS.MODEL, title: t('模型'), dataIndex: 'model_name', + width: 160, render: (text, record, index) => { return record.type === 0 || record.type === 2 || record.type === 5 ? ( <>{renderModelName(record)} @@ -510,6 +517,7 @@ const LogsTable = () => { key: COLUMN_KEYS.USE_TIME, title: t('用时/首字'), dataIndex: 'use_time', + width: 160, render: (text, record, index) => { if (record.is_stream) { let other = getLogOther(record.other); @@ -538,6 +546,7 @@ const LogsTable = () => { key: COLUMN_KEYS.PROMPT, title: t('提示'), dataIndex: 'prompt_tokens', + width: 100, render: (text, record, index) => { return record.type === 0 || record.type === 2 || record.type === 5 ? ( <>{ {text} } @@ -550,6 +559,7 @@ const LogsTable = () => { key: COLUMN_KEYS.COMPLETION, title: t('补全'), dataIndex: 'completion_tokens', + width: 100, render: (text, record, index) => { return parseInt(text) > 0 && (record.type === 0 || record.type === 2 || record.type === 5) ? ( @@ -563,6 +573,7 @@ const LogsTable = () => { key: COLUMN_KEYS.COST, title: t('花费'), dataIndex: 'quota', + width: 120, render: (text, record, index) => { return record.type === 0 || record.type === 2 || record.type === 5 ? ( <>{renderQuota(text, 6)} @@ -575,6 +586,7 @@ const LogsTable = () => { key: COLUMN_KEYS.RETRY, title: t('重试'), dataIndex: 'retry', + width: 160, className: isAdmin() ? 'tableShow' : 'tableHiddle', render: (text, record, index) => { let content = t('渠道') + `:${record.channel}`; @@ -603,6 +615,7 @@ const LogsTable = () => { key: COLUMN_KEYS.DETAILS, title: t('详情'), dataIndex: 'content', + width: 200, render: (text, record, index) => { let other = getLogOther(record.other); if (other == null || record.type !== 2) { diff --git a/web/src/components/MjLogsTable.js b/web/src/components/MjLogsTable.js index f44f712f..08c47e7d 100644 --- a/web/src/components/MjLogsTable.js +++ b/web/src/components/MjLogsTable.js @@ -374,6 +374,7 @@ const LogsTable = () => { key: COLUMN_KEYS.SUBMIT_TIME, title: t('提交时间'), dataIndex: 'submit_time', + width: 180, render: (text, record, index) => { return
{renderTimestamp(text / 1000)}
; }, @@ -381,9 +382,9 @@ const LogsTable = () => { { key: COLUMN_KEYS.DURATION, title: t('花费时间'), - dataIndex: 'finish_time', // 以finish_time作为dataIndex + dataIndex: 'finish_time', + width: 120, render: (finish, record) => { - // 假设record.start_time是存在的,并且finish是完成时间的时间戳 return renderDuration(record.submit_time, finish); }, }, @@ -391,6 +392,7 @@ const LogsTable = () => { key: COLUMN_KEYS.CHANNEL, title: t('渠道'), dataIndex: 'channel_id', + width: 100, className: isAdmin() ? 'tableShow' : 'tableHiddle', render: (text, record, index) => { return isAdminUser ? ( @@ -400,7 +402,7 @@ const LogsTable = () => { size='large' shape='circle' onClick={() => { - copyText(text); // 假设copyText是用于文本复制的函数 + copyText(text); }} > {' '} @@ -416,6 +418,7 @@ const LogsTable = () => { key: COLUMN_KEYS.TYPE, title: t('类型'), dataIndex: 'action', + width: 120, render: (text, record, index) => { return
{renderType(text)}
; }, @@ -424,6 +427,7 @@ const LogsTable = () => { key: COLUMN_KEYS.TASK_ID, title: t('任务ID'), dataIndex: 'mj_id', + width: 200, render: (text, record, index) => { return
{text}
; }, @@ -432,6 +436,7 @@ const LogsTable = () => { key: COLUMN_KEYS.SUBMIT_RESULT, title: t('提交结果'), dataIndex: 'code', + width: 120, className: isAdmin() ? 'tableShow' : 'tableHiddle', render: (text, record, index) => { return isAdminUser ?
{renderCode(text)}
: <>; @@ -441,6 +446,7 @@ const LogsTable = () => { key: COLUMN_KEYS.TASK_STATUS, title: t('任务状态'), dataIndex: 'status', + width: 120, className: isAdmin() ? 'tableShow' : 'tableHiddle', render: (text, record, index) => { return
{renderStatus(text)}
; @@ -450,11 +456,11 @@ const LogsTable = () => { key: COLUMN_KEYS.PROGRESS, title: t('进度'), dataIndex: 'progress', + width: 160, render: (text, record, index) => { return (
{ - // 转换例如100%为数字100,如果text未定义,返回0 { key: COLUMN_KEYS.IMAGE, title: t('结果图片'), dataIndex: 'image_url', + width: 120, render: (text, record, index) => { if (!text) { return t('无'); @@ -481,8 +488,8 @@ const LogsTable = () => { return (