feat: 供应商列表 Base URL、API Key 和模型列表统一模型 ID 增加一键复制按钮
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Button, Table, Tag, Popconfirm, Space, Card } from 'tdesign-react'
|
||||
import { Button, Table, Tag, Popconfirm, Space, Card, Typography, MessagePlugin } from 'tdesign-react'
|
||||
import type { Provider, Model } from '@/types'
|
||||
import { ModelTable } from './ModelTable'
|
||||
import type { PrimaryTableCol } from 'tdesign-react/es/table/type'
|
||||
@@ -32,7 +32,28 @@ export function ProviderTable({
|
||||
{
|
||||
title: 'Base URL',
|
||||
colKey: 'baseUrl',
|
||||
ellipsis: true,
|
||||
cell: ({ row }) =>
|
||||
row.baseUrl ? (
|
||||
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, maxWidth: '100%' }}>
|
||||
<span
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
whiteSpace: 'nowrap',
|
||||
minWidth: 0,
|
||||
}}
|
||||
>
|
||||
{row.baseUrl}
|
||||
</span>
|
||||
<Typography.Text
|
||||
style={{ flexShrink: 0 }}
|
||||
copyable={{
|
||||
text: row.baseUrl,
|
||||
onCopy: () => MessagePlugin.success('已复制 Base URL'),
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
) : null,
|
||||
},
|
||||
{
|
||||
title: '协议',
|
||||
@@ -47,7 +68,28 @@ export function ProviderTable({
|
||||
{
|
||||
title: 'API Key',
|
||||
colKey: 'apiKey',
|
||||
ellipsis: true,
|
||||
cell: ({ row }) =>
|
||||
row.apiKey ? (
|
||||
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, maxWidth: '100%' }}>
|
||||
<span
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
whiteSpace: 'nowrap',
|
||||
minWidth: 0,
|
||||
}}
|
||||
>
|
||||
{row.apiKey}
|
||||
</span>
|
||||
<Typography.Text
|
||||
style={{ flexShrink: 0 }}
|
||||
copyable={{
|
||||
text: row.apiKey,
|
||||
onCopy: () => MessagePlugin.success('已复制 API Key'),
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
) : null,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
|
||||
Reference in New Issue
Block a user