🎨 style: adjust table column widths for better layout

This commit adjusts the column widths in multiple table components to optimize the layout and improve visual consistency:

- TokensTable:
  - Reduce ID width from 80px to 50px
  - Reduce name width from 160px to 80px
  - Reduce group width from 200px to 180px
  - Reduce balance width from 200px to 120px
  - Reduce operation width from 400px to 350px

- RedemptionsTable:
  - Add fixed widths for all columns:
    - ID: 50px
    - Name: 120px
    - Status: 100px
    - Quota: 100px
    - Created time: 180px
    - User ID: 100px
    - Operation: 300px

- TaskLogsTable:
  - Add fixed widths for all columns:
    - Submit time: 180px
    - Finish time: 180px
    - Duration: 120px
    - Channel: 100px
    - Platform: 120px
    - Type: 120px
    - Task ID: 200px
    - Status: 120px
    - Progress: 160px
    - Fail reason: 160px

- UsersTable:
  - Add fixed widths for all columns:
    - ID: 50px
    - Username: 100px
    - Group: 100px
    - Stats info: 280px
    - Invite info: 250px
    - Role: 120px
    - Status: 100px
    - Operation: 150px

These adjustments ensure better space utilization and consistent column sizing across all table components.
This commit is contained in:
Apple\Apple
2025-05-25 23:35:59 +08:00
parent f1c58b391a
commit 7acd318bba
7 changed files with 71 additions and 9 deletions

View File

@@ -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 ? (
<div>
@@ -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 ? (
<>{<span> {text} </span>}</>
@@ -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) {