style: 修复前端 UI 细节问题
- 供应商/模型/统计表格增加列宽约束和 ellipsis 省略号 - 修复主题切换按钮在暗色侧边栏中不可见 - 表格添加 scroll 属性防止窄屏溢出 - 自定义表格空状态提示文案
This commit is contained in:
@@ -18,6 +18,7 @@ export function ModelTable({ providerId, onAdd, onEdit }: ModelTableProps) {
|
||||
title: '模型名称',
|
||||
dataIndex: 'modelName',
|
||||
key: 'modelName',
|
||||
ellipsis: { showTitle: true },
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
@@ -70,6 +71,7 @@ export function ModelTable({ providerId, onAdd, onEdit }: ModelTableProps) {
|
||||
loading={isLoading}
|
||||
pagination={false}
|
||||
size="small"
|
||||
locale={{ emptyText: '暂无模型,点击上方按钮添加' }}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Button, Table, Tag, Popconfirm, Space, Card } from 'antd';
|
||||
import { Button, Table, Tag, Popconfirm, Space, Card, Tooltip } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import type { Provider, Model } from '@/types';
|
||||
import { ModelTable } from './ModelTable';
|
||||
@@ -33,17 +33,26 @@ export function ProviderTable({
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
width: 180,
|
||||
ellipsis: { showTitle: true },
|
||||
},
|
||||
{
|
||||
title: 'Base URL',
|
||||
dataIndex: 'baseUrl',
|
||||
key: 'baseUrl',
|
||||
ellipsis: { showTitle: true },
|
||||
},
|
||||
{
|
||||
title: 'API Key',
|
||||
dataIndex: 'apiKey',
|
||||
key: 'apiKey',
|
||||
render: (key: string | null | undefined) => maskApiKey(key),
|
||||
width: 120,
|
||||
ellipsis: { showTitle: true },
|
||||
render: (key: string | null | undefined) => (
|
||||
<Tooltip title={maskApiKey(key)}>
|
||||
<span>{maskApiKey(key)}</span>
|
||||
</Tooltip>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
@@ -101,6 +110,8 @@ export function ProviderTable({
|
||||
),
|
||||
}}
|
||||
pagination={false}
|
||||
scroll={{ x: 840 }}
|
||||
locale={{ emptyText: '暂无供应商,点击上方按钮添加' }}
|
||||
/>
|
||||
</Card>
|
||||
);
|
||||
|
||||
@@ -40,22 +40,29 @@ export function StatsTable({
|
||||
title: '供应商',
|
||||
dataIndex: 'providerId',
|
||||
key: 'providerId',
|
||||
width: 180,
|
||||
ellipsis: { showTitle: true },
|
||||
render: (id: string) => providerMap.get(id) ?? id,
|
||||
},
|
||||
{
|
||||
title: '模型',
|
||||
dataIndex: 'modelName',
|
||||
key: 'modelName',
|
||||
width: 250,
|
||||
ellipsis: { showTitle: true },
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
dataIndex: 'date',
|
||||
key: 'date',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '请求数',
|
||||
dataIndex: 'requestCount',
|
||||
key: 'requestCount',
|
||||
width: 100,
|
||||
align: 'right',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -89,6 +96,8 @@ export function StatsTable({
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
pagination={{ pageSize: 20 }}
|
||||
scroll={{ x: 650 }}
|
||||
locale={{ emptyText: '暂无统计数据' }}
|
||||
/>
|
||||
</Card>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user