style: change the border radius of most components from full to lg size

This commit is contained in:
t0ng7u
2025-06-29 02:32:09 +08:00
parent cffade7210
commit e6949e611a
26 changed files with 147 additions and 386 deletions

View File

@@ -399,7 +399,6 @@ const LoginForm = () => {
placeholder={t('请输入您的用户名或邮箱地址')} placeholder={t('请输入您的用户名或邮箱地址')}
name="username" name="username"
size="large" size="large"
className="!rounded-md"
onChange={(value) => handleChange('username', value)} onChange={(value) => handleChange('username', value)}
prefix={<IconMail />} prefix={<IconMail />}
/> />
@@ -411,7 +410,6 @@ const LoginForm = () => {
name="password" name="password"
mode="password" mode="password"
size="large" size="large"
className="!rounded-md"
onChange={(value) => handleChange('password', value)} onChange={(value) => handleChange('password', value)}
prefix={<IconLock />} prefix={<IconLock />}
/> />

View File

@@ -113,7 +113,6 @@ const PasswordResetConfirm = () => {
label={t('邮箱')} label={t('邮箱')}
name="email" name="email"
size="large" size="large"
className="!rounded-md"
disabled={true} disabled={true}
prefix={<IconMail />} prefix={<IconMail />}
placeholder={email ? '' : t('等待获取邮箱信息...')} placeholder={email ? '' : t('等待获取邮箱信息...')}
@@ -125,7 +124,6 @@ const PasswordResetConfirm = () => {
label={t('新密码')} label={t('新密码')}
name="newPassword" name="newPassword"
size="large" size="large"
className="!rounded-md"
disabled={true} disabled={true}
prefix={<IconLock />} prefix={<IconLock />}
suffix={ suffix={

View File

@@ -102,7 +102,6 @@ const PasswordResetForm = () => {
placeholder={t('请输入您的邮箱地址')} placeholder={t('请输入您的邮箱地址')}
name="email" name="email"
size="large" size="large"
className="!rounded-md"
value={email} value={email}
onChange={handleChange} onChange={handleChange}
prefix={<IconMail />} prefix={<IconMail />}

View File

@@ -394,7 +394,6 @@ const RegisterForm = () => {
placeholder={t('请输入用户名')} placeholder={t('请输入用户名')}
name="username" name="username"
size="large" size="large"
className="!rounded-md"
onChange={(value) => handleChange('username', value)} onChange={(value) => handleChange('username', value)}
prefix={<IconUser />} prefix={<IconUser />}
/> />
@@ -406,7 +405,6 @@ const RegisterForm = () => {
name="password" name="password"
mode="password" mode="password"
size="large" size="large"
className="!rounded-md"
onChange={(value) => handleChange('password', value)} onChange={(value) => handleChange('password', value)}
prefix={<IconLock />} prefix={<IconLock />}
/> />
@@ -418,7 +416,6 @@ const RegisterForm = () => {
name="password2" name="password2"
mode="password" mode="password"
size="large" size="large"
className="!rounded-md"
onChange={(value) => handleChange('password2', value)} onChange={(value) => handleChange('password2', value)}
prefix={<IconLock />} prefix={<IconLock />}
/> />
@@ -432,7 +429,6 @@ const RegisterForm = () => {
name="email" name="email"
type="email" type="email"
size="large" size="large"
className="!rounded-md"
onChange={(value) => handleChange('email', value)} onChange={(value) => handleChange('email', value)}
prefix={<IconMail />} prefix={<IconMail />}
suffix={ suffix={
@@ -440,7 +436,6 @@ const RegisterForm = () => {
onClick={sendVerificationCode} onClick={sendVerificationCode}
loading={verificationCodeLoading} loading={verificationCodeLoading}
size="small" size="small"
className="!rounded-md mr-2"
> >
{t('获取验证码')} {t('获取验证码')}
</Button> </Button>
@@ -452,7 +447,6 @@ const RegisterForm = () => {
placeholder={t('输入验证码')} placeholder={t('输入验证码')}
name="verification_code" name="verification_code"
size="large" size="large"
className="!rounded-md"
onChange={(value) => handleChange('verification_code', value)} onChange={(value) => handleChange('verification_code', value)}
prefix={<IconKey />} prefix={<IconKey />}
/> />

View File

@@ -170,8 +170,8 @@ const NoticeModal = ({ visible, onClose, isMobile, defaultTab = 'inApp', unreadK
onCancel={onClose} onCancel={onClose}
footer={( footer={(
<div className="flex justify-end"> <div className="flex justify-end">
<Button type='secondary' className='!rounded-full' onClick={handleCloseTodayNotice}>{t('今日关闭')}</Button> <Button type='secondary' onClick={handleCloseTodayNotice}>{t('今日关闭')}</Button>
<Button type="primary" className='!rounded-full' onClick={onClose}>{t('关闭公告')}</Button> <Button type="primary" onClick={onClose}>{t('关闭公告')}</Button>
</div> </div>
)} )}
size={isMobile ? 'full-width' : 'large'} size={isMobile ? 'full-width' : 'large'}

View File

@@ -10,16 +10,6 @@ import {
getChannelIcon, getChannelIcon,
renderQuotaWithAmount renderQuotaWithAmount
} from '../../helpers/index.js'; } from '../../helpers/index.js';
import {
CheckCircle,
XCircle,
AlertCircle,
HelpCircle,
Coins,
Tags,
} from 'lucide-react';
import { CHANNEL_OPTIONS, ITEMS_PER_PAGE, MODEL_TABLE_PAGE_SIZE } from '../../constants/index.js'; import { CHANNEL_OPTIONS, ITEMS_PER_PAGE, MODEL_TABLE_PAGE_SIZE } from '../../constants/index.js';
import { import {
Button, Button,
@@ -50,12 +40,8 @@ import {
import EditChannel from '../../pages/Channel/EditChannel.js'; import EditChannel from '../../pages/Channel/EditChannel.js';
import { import {
IconTreeTriangleDown, IconTreeTriangleDown,
IconPlus,
IconSearch, IconSearch,
IconDelete,
IconMore, IconMore,
IconCopy,
IconSmallTriangleRight
} from '@douyinfe/semi-icons'; } from '@douyinfe/semi-icons';
import { loadChannelModels, isMobile, copy } from '../../helpers'; import { loadChannelModels, isMobile, copy } from '../../helpers';
import EditTagModal from '../../pages/Channel/EditTagModal.js'; import EditTagModal from '../../pages/Channel/EditTagModal.js';
@@ -91,7 +77,6 @@ const ChannelsTable = () => {
return ( return (
<Tag <Tag
color='light-blue' color='light-blue'
prefixIcon={<Tags size={14} />}
size='large' size='large'
shape='circle' shape='circle'
type='light' type='light'
@@ -105,25 +90,25 @@ const ChannelsTable = () => {
switch (status) { switch (status) {
case 1: case 1:
return ( return (
<Tag size='large' color='green' shape='circle' prefixIcon={<CheckCircle size={14} />}> <Tag size='large' color='green' shape='circle'>
{t('已启用')} {t('已启用')}
</Tag> </Tag>
); );
case 2: case 2:
return ( return (
<Tag size='large' color='red' shape='circle' prefixIcon={<XCircle size={14} />}> <Tag size='large' color='red' shape='circle'>
{t('已禁用')} {t('已禁用')}
</Tag> </Tag>
); );
case 3: case 3:
return ( return (
<Tag size='large' color='yellow' shape='circle' prefixIcon={<AlertCircle size={14} />}> <Tag size='large' color='yellow' shape='circle'>
{t('自动禁用')} {t('自动禁用')}
</Tag> </Tag>
); );
default: default:
return ( return (
<Tag size='large' color='grey' shape='circle' prefixIcon={<HelpCircle size={14} />}> <Tag size='large' color='grey' shape='circle'>
{t('未知状态')} {t('未知状态')}
</Tag> </Tag>
); );
@@ -346,7 +331,7 @@ const ChannelsTable = () => {
<div> <div>
<Space spacing={1}> <Space spacing={1}>
<Tooltip content={t('已用额度')}> <Tooltip content={t('已用额度')}>
<Tag color='white' type='ghost' size='large' shape='circle' prefixIcon={<Coins size={14} />}> <Tag color='white' type='ghost' size='large' shape='circle'>
{renderQuota(record.used_quota)} {renderQuota(record.used_quota)}
</Tag> </Tag>
</Tooltip> </Tooltip>
@@ -356,7 +341,6 @@ const ChannelsTable = () => {
type='ghost' type='ghost'
size='large' size='large'
shape='circle' shape='circle'
prefixIcon={<Coins size={14} />}
onClick={() => updateChannelBalance(record)} onClick={() => updateChannelBalance(record)}
> >
{renderQuotaWithAmount(record.balance)} {renderQuotaWithAmount(record.balance)}
@@ -368,7 +352,7 @@ const ChannelsTable = () => {
} else { } else {
return ( return (
<Tooltip content={t('已用额度')}> <Tooltip content={t('已用额度')}>
<Tag color='white' type='ghost' size='large' shape='circle' prefixIcon={<Coins size={14} />}> <Tag color='white' type='ghost' size='large' shape='circle'>
{renderQuota(record.used_quota)} {renderQuota(record.used_quota)}
</Tag> </Tag>
</Tooltip> </Tooltip>
@@ -492,7 +476,6 @@ const ChannelsTable = () => {
{ {
node: 'item', node: 'item',
name: t('删除'), name: t('删除'),
icon: <IconDelete />,
type: 'danger', type: 'danger',
onClick: () => { onClick: () => {
Modal.confirm({ Modal.confirm({
@@ -509,7 +492,6 @@ const ChannelsTable = () => {
{ {
node: 'item', node: 'item',
name: t('复制'), name: t('复制'),
icon: <IconCopy />,
type: 'primary', type: 'primary',
onClick: () => { onClick: () => {
Modal.confirm({ Modal.confirm({
@@ -524,7 +506,7 @@ const ChannelsTable = () => {
return ( return (
<Space wrap> <Space wrap>
<SplitButtonGroup <SplitButtonGroup
className="!rounded-full overflow-hidden" className="overflow-hidden"
aria-label={t('测试单个渠道操作项目组')} aria-label={t('测试单个渠道操作项目组')}
> >
<Button <Button
@@ -550,7 +532,6 @@ const ChannelsTable = () => {
theme='light' theme='light'
type='warning' type='warning'
size="small" size="small"
className="!rounded-full"
onClick={() => manageChannel(record.id, 'disable', record)} onClick={() => manageChannel(record.id, 'disable', record)}
> >
{t('禁用')} {t('禁用')}
@@ -560,7 +541,6 @@ const ChannelsTable = () => {
theme='light' theme='light'
type='secondary' type='secondary'
size="small" size="small"
className="!rounded-full"
onClick={() => manageChannel(record.id, 'enable', record)} onClick={() => manageChannel(record.id, 'enable', record)}
> >
{t('启用')} {t('启用')}
@@ -571,7 +551,6 @@ const ChannelsTable = () => {
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full"
onClick={() => { onClick={() => {
setEditingChannel(record); setEditingChannel(record);
setShowEdit(true); setShowEdit(true);
@@ -590,7 +569,6 @@ const ChannelsTable = () => {
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full"
/> />
</Dropdown> </Dropdown>
</Space> </Space>
@@ -603,7 +581,6 @@ const ChannelsTable = () => {
theme='light' theme='light'
type='secondary' type='secondary'
size="small" size="small"
className="!rounded-full"
onClick={() => manageTag(record.key, 'enable')} onClick={() => manageTag(record.key, 'enable')}
> >
{t('启用全部')} {t('启用全部')}
@@ -612,7 +589,6 @@ const ChannelsTable = () => {
theme='light' theme='light'
type='warning' type='warning'
size="small" size="small"
className="!rounded-full"
onClick={() => manageTag(record.key, 'disable')} onClick={() => manageTag(record.key, 'disable')}
> >
{t('禁用全部')} {t('禁用全部')}
@@ -621,7 +597,6 @@ const ChannelsTable = () => {
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full"
onClick={() => { onClick={() => {
setShowEditTag(true); setShowEditTag(true);
setEditingTag(record.key); setEditingTag(record.key);
@@ -694,21 +669,18 @@ const ChannelsTable = () => {
<Button <Button
theme="light" theme="light"
onClick={() => initDefaultColumns()} onClick={() => initDefaultColumns()}
className="!rounded-full"
> >
{t('重置')} {t('重置')}
</Button> </Button>
<Button <Button
theme="light" theme="light"
onClick={() => setShowColumnSelector(false)} onClick={() => setShowColumnSelector(false)}
className="!rounded-full"
> >
{t('取消')} {t('取消')}
</Button> </Button>
<Button <Button
type='primary' type='primary'
onClick={() => setShowColumnSelector(false)} onClick={() => setShowColumnSelector(false)}
className="!rounded-full"
> >
{t('确定')} {t('确定')}
</Button> </Button>
@@ -1508,7 +1480,7 @@ const ChannelsTable = () => {
disabled={!enableBatchDelete} disabled={!enableBatchDelete}
theme='light' theme='light'
type='danger' type='danger'
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
onClick={() => { onClick={() => {
Modal.confirm({ Modal.confirm({
title: t('确定是否要删除所选通道?'), title: t('确定是否要删除所选通道?'),
@@ -1526,7 +1498,7 @@ const ChannelsTable = () => {
theme='light' theme='light'
type='primary' type='primary'
onClick={() => setShowBatchSetTag(true)} onClick={() => setShowBatchSetTag(true)}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('批量设置标签')} {t('批量设置标签')}
</Button> </Button>
@@ -1541,7 +1513,7 @@ const ChannelsTable = () => {
size='small' size='small'
theme='light' theme='light'
type='warning' type='warning'
className="!rounded-full w-full" className="w-full"
onClick={() => { onClick={() => {
Modal.confirm({ Modal.confirm({
title: t('确定?'), title: t('确定?'),
@@ -1560,7 +1532,7 @@ const ChannelsTable = () => {
size='small' size='small'
theme='light' theme='light'
type='secondary' type='secondary'
className="!rounded-full w-full" className="w-full"
onClick={() => { onClick={() => {
Modal.confirm({ Modal.confirm({
title: t('确定?'), title: t('确定?'),
@@ -1579,7 +1551,7 @@ const ChannelsTable = () => {
size='small' size='small'
theme='light' theme='light'
type='danger' type='danger'
className="!rounded-full w-full" className="w-full"
onClick={() => { onClick={() => {
Modal.confirm({ Modal.confirm({
title: t('确定是否要删除禁用通道?'), title: t('确定是否要删除禁用通道?'),
@@ -1598,7 +1570,7 @@ const ChannelsTable = () => {
size='small' size='small'
theme='light' theme='light'
type='tertiary' type='tertiary'
className="!rounded-full w-full" className="w-full"
onClick={() => { onClick={() => {
Modal.confirm({ Modal.confirm({
title: t('确定是否要修复数据库一致性?'), title: t('确定是否要修复数据库一致性?'),
@@ -1615,7 +1587,7 @@ const ChannelsTable = () => {
</Dropdown.Menu> </Dropdown.Menu>
} }
> >
<Button size='small' theme='light' type='tertiary' className="!rounded-full w-full md:w-auto"> <Button size='small' theme='light' type='tertiary' className="w-full md:w-auto">
{t('批量操作')} {t('批量操作')}
</Button> </Button>
</Dropdown> </Dropdown>
@@ -1624,7 +1596,7 @@ const ChannelsTable = () => {
size='small' size='small'
theme='light' theme='light'
type='secondary' type='secondary'
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
onClick={() => setCompactMode(!compactMode)} onClick={() => setCompactMode(!compactMode)}
> >
{compactMode ? t('自适应列表') : t('紧凑列表')} {compactMode ? t('自适应列表') : t('紧凑列表')}
@@ -1713,8 +1685,7 @@ const ChannelsTable = () => {
size='small' size='small'
theme='light' theme='light'
type='primary' type='primary'
icon={<IconPlus />} className="w-full md:w-auto"
className="!rounded-full w-full md:w-auto"
onClick={() => { onClick={() => {
setEditingChannel({ setEditingChannel({
id: undefined, id: undefined,
@@ -1729,7 +1700,7 @@ const ChannelsTable = () => {
size='small' size='small'
theme='light' theme='light'
type='primary' type='primary'
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
onClick={refresh} onClick={refresh}
> >
{t('刷新')} {t('刷新')}
@@ -1740,7 +1711,7 @@ const ChannelsTable = () => {
theme='light' theme='light'
type='tertiary' type='tertiary'
onClick={() => setShowColumnSelector(true)} onClick={() => setShowColumnSelector(true)}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('列设置')} {t('列设置')}
</Button> </Button>
@@ -1764,7 +1735,6 @@ const ChannelsTable = () => {
field="searchKeyword" field="searchKeyword"
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('渠道ID名称密钥API地址')} placeholder={t('渠道ID名称密钥API地址')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -1775,7 +1745,6 @@ const ChannelsTable = () => {
field="searchModel" field="searchModel"
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('模型关键字')} placeholder={t('模型关键字')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -1789,7 +1758,7 @@ const ChannelsTable = () => {
{ label: t('选择分组'), value: null }, { label: t('选择分组'), value: null },
...groupOptions, ...groupOptions,
]} ]}
className="!rounded-full w-full" className="w-full"
showClear showClear
pure pure
onChange={() => { onChange={() => {
@@ -1805,7 +1774,7 @@ const ChannelsTable = () => {
type="primary" type="primary"
htmlType="submit" htmlType="submit"
loading={loading || searching} loading={loading || searching}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('查询')} {t('查询')}
</Button> </Button>
@@ -1821,7 +1790,7 @@ const ChannelsTable = () => {
}, 100); }, 100);
} }
}} }}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('重置')} {t('重置')}
</Button> </Button>
@@ -1917,7 +1886,6 @@ const ChannelsTable = () => {
value={batchSetTagValue} value={batchSetTagValue}
onChange={(v) => setBatchSetTagValue(v)} onChange={(v) => setBatchSetTagValue(v)}
size='large' size='large'
className="!rounded-full"
/> />
<div className="mt-4"> <div className="mt-4">
<Typography.Text type='secondary'> <Typography.Text type='secondary'>
@@ -1949,15 +1917,13 @@ const ChannelsTable = () => {
setModelSearchKeyword(v); setModelSearchKeyword(v);
setModelTablePage(1); setModelTablePage(1);
}} }}
className="!w-full !rounded-full" className="!w-full"
prefix={<IconSearch />} prefix={<IconSearch />}
showClear showClear
/> />
<Button <Button
theme='light' theme='light'
icon={<IconCopy />}
className="!rounded-full"
onClick={() => { onClick={() => {
if (selectedModelKeys.length === 0) { if (selectedModelKeys.length === 0) {
showError(t('请先选择模型!')); showError(t('请先选择模型!'));
@@ -1978,7 +1944,6 @@ const ChannelsTable = () => {
<Button <Button
theme='light' theme='light'
type='primary' type='primary'
className="!rounded-full"
onClick={() => { onClick={() => {
if (!currentTestChannel) return; if (!currentTestChannel) return;
const successKeys = currentTestChannel.models const successKeys = currentTestChannel.models
@@ -2008,7 +1973,6 @@ const ChannelsTable = () => {
<Button <Button
theme='light' theme='light'
type='warning' type='warning'
className="!rounded-full"
onClick={handleCloseModal} onClick={handleCloseModal}
> >
{t('停止测试')} {t('停止测试')}
@@ -2017,7 +1981,6 @@ const ChannelsTable = () => {
<Button <Button
theme='light' theme='light'
type='tertiary' type='tertiary'
className="!rounded-full"
onClick={handleCloseModal} onClick={handleCloseModal}
> >
{t('取消')} {t('取消')}
@@ -2026,7 +1989,6 @@ const ChannelsTable = () => {
<Button <Button
theme='light' theme='light'
type='primary' type='primary'
className="!rounded-full"
onClick={batchTestModels} onClick={batchTestModels}
loading={isBatchTesting} loading={isBatchTesting}
disabled={isBatchTesting} disabled={isBatchTesting}
@@ -2071,7 +2033,7 @@ const ChannelsTable = () => {
if (isTesting) { if (isTesting) {
return ( return (
<Tag size='large' color='blue' className="!rounded-full"> <Tag size='large' color='blue' shape='circle'>
{t('测试中')} {t('测试中')}
</Tag> </Tag>
); );
@@ -2079,7 +2041,7 @@ const ChannelsTable = () => {
if (!testResult) { if (!testResult) {
return ( return (
<Tag size='large' color='grey' className="!rounded-full"> <Tag size='large' color='grey' shape='circle'>
{t('未开始')} {t('未开始')}
</Tag> </Tag>
); );
@@ -2090,7 +2052,7 @@ const ChannelsTable = () => {
<Tag <Tag
size='large' size='large'
color={testResult.success ? 'green' : 'red'} color={testResult.success ? 'green' : 'red'}
className="!rounded-full" shape='circle'
> >
{testResult.success ? t('成功') : t('失败')} {testResult.success ? t('成功') : t('失败')}
</Tag> </Tag>
@@ -2112,11 +2074,9 @@ const ChannelsTable = () => {
<Button <Button
theme='light' theme='light'
type='primary' type='primary'
className="!rounded-full"
onClick={() => testChannel(currentTestChannel, record.model)} onClick={() => testChannel(currentTestChannel, record.model)}
loading={isTesting} loading={isTesting}
size='small' size='small'
icon={<IconSmallTriangleRight />}
> >
{t('测试')} {t('测试')}
</Button> </Button>

View File

@@ -47,7 +47,7 @@ import {
} from '@douyinfe/semi-illustrations'; } from '@douyinfe/semi-illustrations';
import { ITEMS_PER_PAGE } from '../../constants'; import { ITEMS_PER_PAGE } from '../../constants';
import Paragraph from '@douyinfe/semi-ui/lib/es/typography/paragraph'; import Paragraph from '@douyinfe/semi-ui/lib/es/typography/paragraph';
import { IconSetting, IconSearch, IconHelpCircle, IconDescend } from '@douyinfe/semi-icons'; import { IconSearch, IconHelpCircle } from '@douyinfe/semi-icons';
import { Route } from 'lucide-react'; import { Route } from 'lucide-react';
import { useTableCompactMode } from '../../hooks/useTableCompactMode'; import { useTableCompactMode } from '../../hooks/useTableCompactMode';
@@ -696,21 +696,18 @@ const LogsTable = () => {
<Button <Button
theme='light' theme='light'
onClick={() => initDefaultColumns()} onClick={() => initDefaultColumns()}
className='!rounded-full'
> >
{t('重置')} {t('重置')}
</Button> </Button>
<Button <Button
theme='light' theme='light'
onClick={() => setShowColumnSelector(false)} onClick={() => setShowColumnSelector(false)}
className='!rounded-full'
> >
{t('取消')} {t('取消')}
</Button> </Button>
<Button <Button
type='primary' type='primary'
onClick={() => setShowColumnSelector(false)} onClick={() => setShowColumnSelector(false)}
className='!rounded-full'
> >
{t('确定')} {t('确定')}
</Button> </Button>
@@ -1221,10 +1218,10 @@ const LogsTable = () => {
size='large' size='large'
style={{ style={{
padding: 15, padding: 15,
borderRadius: '9999px',
fontWeight: 500, fontWeight: 500,
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)', boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
}} }}
className='!rounded-lg'
> >
{t('消耗额度')}: {renderQuota(stat.quota)} {t('消耗额度')}: {renderQuota(stat.quota)}
</Tag> </Tag>
@@ -1233,10 +1230,10 @@ const LogsTable = () => {
size='large' size='large'
style={{ style={{
padding: 15, padding: 15,
borderRadius: '9999px',
fontWeight: 500, fontWeight: 500,
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)', boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
}} }}
className='!rounded-lg'
> >
RPM: {stat.rpm} RPM: {stat.rpm}
</Tag> </Tag>
@@ -1247,9 +1244,9 @@ const LogsTable = () => {
padding: 15, padding: 15,
border: 'none', border: 'none',
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)', boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
borderRadius: '9999px',
fontWeight: 500, fontWeight: 500,
}} }}
className='!rounded-lg'
> >
TPM: {stat.tpm} TPM: {stat.tpm}
</Tag> </Tag>
@@ -1258,8 +1255,7 @@ const LogsTable = () => {
<Button <Button
theme='light' theme='light'
type='secondary' type='secondary'
icon={<IconDescend />} className="w-full md:w-auto"
className="!rounded-full w-full md:w-auto"
onClick={() => setCompactMode(!compactMode)} onClick={() => setCompactMode(!compactMode)}
> >
{compactMode ? t('自适应列表') : t('紧凑列表')} {compactMode ? t('自适应列表') : t('紧凑列表')}
@@ -1299,7 +1295,6 @@ const LogsTable = () => {
field='token_name' field='token_name'
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('令牌名称')} placeholder={t('令牌名称')}
className='!rounded-full'
showClear showClear
pure pure
/> />
@@ -1308,7 +1303,6 @@ const LogsTable = () => {
field='model_name' field='model_name'
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('模型名称')} placeholder={t('模型名称')}
className='!rounded-full'
showClear showClear
pure pure
/> />
@@ -1317,7 +1311,6 @@ const LogsTable = () => {
field='group' field='group'
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('分组')} placeholder={t('分组')}
className='!rounded-full'
showClear showClear
pure pure
/> />
@@ -1328,7 +1321,6 @@ const LogsTable = () => {
field='channel' field='channel'
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('渠道 ID')} placeholder={t('渠道 ID')}
className='!rounded-full'
showClear showClear
pure pure
/> />
@@ -1336,7 +1328,6 @@ const LogsTable = () => {
field='username' field='username'
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('用户名称')} placeholder={t('用户名称')}
className='!rounded-full'
showClear showClear
pure pure
/> />
@@ -1351,7 +1342,7 @@ const LogsTable = () => {
<Form.Select <Form.Select
field='logType' field='logType'
placeholder={t('日志类型')} placeholder={t('日志类型')}
className='!rounded-full w-full sm:w-auto min-w-[120px]' className='w-full sm:w-auto min-w-[120px]'
showClear showClear
pure pure
onChange={() => { onChange={() => {
@@ -1387,7 +1378,6 @@ const LogsTable = () => {
type='primary' type='primary'
htmlType='submit' htmlType='submit'
loading={loading} loading={loading}
className='!rounded-full'
> >
{t('查询')} {t('查询')}
</Button> </Button>
@@ -1402,16 +1392,13 @@ const LogsTable = () => {
}, 100); }, 100);
} }
}} }}
className='!rounded-full'
> >
{t('重置')} {t('重置')}
</Button> </Button>
<Button <Button
theme='light' theme='light'
type='tertiary' type='tertiary'
icon={<IconSetting />}
onClick={() => setShowColumnSelector(true)} onClick={() => setShowColumnSelector(true)}
className='!rounded-full'
> >
{t('列设置')} {t('列设置')}
</Button> </Button>

View File

@@ -59,8 +59,6 @@ import { ITEMS_PER_PAGE } from '../../constants';
import { import {
IconEyeOpened, IconEyeOpened,
IconSearch, IconSearch,
IconSetting,
IconDescend
} from '@douyinfe/semi-icons'; } from '@douyinfe/semi-icons';
import { useTableCompactMode } from '../../hooks/useTableCompactMode'; import { useTableCompactMode } from '../../hooks/useTableCompactMode';
@@ -517,7 +515,6 @@ const LogsTable = () => {
setModalImageUrl(text); setModalImageUrl(text);
setIsModalOpenurl(true); setIsModalOpenurl(true);
}} }}
className="!rounded-full"
> >
{t('查看图片')} {t('查看图片')}
</Button> </Button>
@@ -735,21 +732,18 @@ const LogsTable = () => {
<Button <Button
theme="light" theme="light"
onClick={() => initDefaultColumns()} onClick={() => initDefaultColumns()}
className="!rounded-full"
> >
{t('重置')} {t('重置')}
</Button> </Button>
<Button <Button
theme="light" theme="light"
onClick={() => setShowColumnSelector(false)} onClick={() => setShowColumnSelector(false)}
className="!rounded-full"
> >
{t('取消')} {t('取消')}
</Button> </Button>
<Button <Button
type='primary' type='primary'
onClick={() => setShowColumnSelector(false)} onClick={() => setShowColumnSelector(false)}
className="!rounded-full"
> >
{t('确定')} {t('确定')}
</Button> </Button>
@@ -827,8 +821,7 @@ const LogsTable = () => {
<Button <Button
theme='light' theme='light'
type='secondary' type='secondary'
icon={<IconDescend />} className="w-full md:w-auto"
className="!rounded-full w-full md:w-auto"
onClick={() => setCompactMode(!compactMode)} onClick={() => setCompactMode(!compactMode)}
> >
{compactMode ? t('自适应列表') : t('紧凑列表')} {compactMode ? t('自适应列表') : t('紧凑列表')}
@@ -867,7 +860,6 @@ const LogsTable = () => {
field='mj_id' field='mj_id'
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('任务 ID')} placeholder={t('任务 ID')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -878,7 +870,6 @@ const LogsTable = () => {
field='channel_id' field='channel_id'
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('渠道 ID')} placeholder={t('渠道 ID')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -893,7 +884,6 @@ const LogsTable = () => {
type='primary' type='primary'
htmlType='submit' htmlType='submit'
loading={loading} loading={loading}
className="!rounded-full"
> >
{t('查询')} {t('查询')}
</Button> </Button>
@@ -908,16 +898,13 @@ const LogsTable = () => {
}, 100); }, 100);
} }
}} }}
className="!rounded-full"
> >
{t('重置')} {t('重置')}
</Button> </Button>
<Button <Button
theme='light' theme='light'
type='tertiary' type='tertiary'
icon={<IconSetting />}
onClick={() => setShowColumnSelector(true)} onClick={() => setShowColumnSelector(true)}
className="!rounded-full"
> >
{t('列设置')} {t('列设置')}
</Button> </Button>

View File

@@ -161,6 +161,7 @@ const ModelPricing = () => {
<Tag <Tag
color='blue' color='blue'
size='large' size='large'
shape='circle'
onClick={() => { onClick={() => {
setSelectedGroup(group); setSelectedGroup(group);
showInfo( showInfo(
@@ -170,7 +171,7 @@ const ModelPricing = () => {
}), }),
); );
}} }}
className="cursor-pointer hover:opacity-80 transition-opacity !rounded-full" className="cursor-pointer hover:opacity-80 transition-opacity"
> >
{group} {group}
</Tag> </Tag>
@@ -404,7 +405,6 @@ const ModelPricing = () => {
<Input <Input
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('模糊搜索模型名称')} placeholder={t('模糊搜索模型名称')}
className="!rounded-lg"
onCompositionStart={handleCompositionStart} onCompositionStart={handleCompositionStart}
onCompositionEnd={handleCompositionEnd} onCompositionEnd={handleCompositionEnd}
onChange={handleChange} onChange={handleChange}
@@ -418,7 +418,7 @@ const ModelPricing = () => {
icon={<IconCopy />} icon={<IconCopy />}
onClick={() => copyText(selectedRowKeys)} onClick={() => copyText(selectedRowKeys)}
disabled={selectedRowKeys.length === 0} disabled={selectedRowKeys.length === 0}
className="!rounded-lg !bg-blue-500 hover:!bg-blue-600 text-white" className="!bg-blue-500 hover:!bg-blue-600 text-white"
size="large" size="large"
> >
{t('复制选中模型')} {t('复制选中模型')}
@@ -477,13 +477,6 @@ const ModelPricing = () => {
}} }}
bodyStyle={{ padding: 0 }} bodyStyle={{ padding: 0 }}
> >
{/* 装饰性背景元素 */}
<div className="absolute inset-0 overflow-hidden">
<div className="absolute -top-10 -right-10 w-40 h-40 bg-white opacity-5 rounded-full"></div>
<div className="absolute -bottom-16 -left-16 w-48 h-48 bg-white opacity-3 rounded-full"></div>
<div className="absolute top-1/2 right-1/4 w-24 h-24 bg-yellow-400 opacity-10 rounded-full"></div>
</div>
<div className="relative p-6 sm:p-8" style={{ color: 'white' }}> <div className="relative p-6 sm:p-8" style={{ color: 'white' }}>
<div className="flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4 lg:gap-6"> <div className="flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4 lg:gap-6">
<div className="flex items-start"> <div className="flex items-start">

View File

@@ -8,14 +8,7 @@ import {
renderQuota renderQuota
} from '../../helpers'; } from '../../helpers';
import { import { Ticket } from 'lucide-react';
CheckCircle,
XCircle,
Minus,
HelpCircle,
Coins,
Ticket
} from 'lucide-react';
import { ITEMS_PER_PAGE } from '../../constants'; import { ITEMS_PER_PAGE } from '../../constants';
import { import {
@@ -37,16 +30,8 @@ import {
IllustrationNoResultDark IllustrationNoResultDark
} from '@douyinfe/semi-illustrations'; } from '@douyinfe/semi-illustrations';
import { import {
IconPlus,
IconCopy,
IconSearch, IconSearch,
IconEyeOpened,
IconEdit,
IconDelete,
IconStop,
IconPlay,
IconMore, IconMore,
IconDescend
} from '@douyinfe/semi-icons'; } from '@douyinfe/semi-icons';
import EditRedemption from '../../pages/Redemption/EditRedemption'; import EditRedemption from '../../pages/Redemption/EditRedemption';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -68,31 +53,31 @@ const RedemptionsTable = () => {
const renderStatus = (status, record) => { const renderStatus = (status, record) => {
if (isExpired(record)) { if (isExpired(record)) {
return ( return (
<Tag color='orange' size='large' shape='circle' prefixIcon={<Minus size={14} />}>{t('已过期')}</Tag> <Tag color='orange' size='large' shape='circle'>{t('已过期')}</Tag>
); );
} }
switch (status) { switch (status) {
case 1: case 1:
return ( return (
<Tag color='green' size='large' shape='circle' prefixIcon={<CheckCircle size={14} />}> <Tag color='green' size='large' shape='circle'>
{t('未使用')} {t('未使用')}
</Tag> </Tag>
); );
case 2: case 2:
return ( return (
<Tag color='red' size='large' shape='circle' prefixIcon={<XCircle size={14} />}> <Tag color='red' size='large' shape='circle'>
{t('已禁用')} {t('已禁用')}
</Tag> </Tag>
); );
case 3: case 3:
return ( return (
<Tag color='grey' size='large' shape='circle' prefixIcon={<Minus size={14} />}> <Tag color='grey' size='large' shape='circle'>
{t('已使用')} {t('已使用')}
</Tag> </Tag>
); );
default: default:
return ( return (
<Tag color='black' size='large' shape='circle' prefixIcon={<HelpCircle size={14} />}> <Tag color='black' size='large' shape='circle'>
{t('未知状态')} {t('未知状态')}
</Tag> </Tag>
); );
@@ -122,7 +107,7 @@ const RedemptionsTable = () => {
render: (text, record, index) => { render: (text, record, index) => {
return ( return (
<div> <div>
<Tag size={'large'} color={'grey'} shape='circle' prefixIcon={<Coins size={14} />}> <Tag size={'large'} color={'grey'} shape='circle'>
{renderQuota(parseInt(text))} {renderQuota(parseInt(text))}
</Tag> </Tag>
</div> </div>
@@ -160,7 +145,6 @@ const RedemptionsTable = () => {
{ {
node: 'item', node: 'item',
name: t('删除'), name: t('删除'),
icon: <IconDelete />,
type: 'danger', type: 'danger',
onClick: () => { onClick: () => {
Modal.confirm({ Modal.confirm({
@@ -180,7 +164,6 @@ const RedemptionsTable = () => {
moreMenuItems.push({ moreMenuItems.push({
node: 'item', node: 'item',
name: t('禁用'), name: t('禁用'),
icon: <IconStop />,
type: 'warning', type: 'warning',
onClick: () => { onClick: () => {
manageRedemption(record.id, 'disable', record); manageRedemption(record.id, 'disable', record);
@@ -190,7 +173,6 @@ const RedemptionsTable = () => {
moreMenuItems.push({ moreMenuItems.push({
node: 'item', node: 'item',
name: t('启用'), name: t('启用'),
icon: <IconPlay />,
type: 'secondary', type: 'secondary',
onClick: () => { onClick: () => {
manageRedemption(record.id, 'enable', record); manageRedemption(record.id, 'enable', record);
@@ -203,21 +185,17 @@ const RedemptionsTable = () => {
<Space> <Space>
<Popover content={record.key} style={{ padding: 20 }} position='top'> <Popover content={record.key} style={{ padding: 20 }} position='top'>
<Button <Button
icon={<IconEyeOpened />}
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full"
> >
{t('查看')} {t('查看')}
</Button> </Button>
</Popover> </Popover>
<Button <Button
icon={<IconCopy />}
theme='light' theme='light'
type='secondary' type='secondary'
size="small" size="small"
className="!rounded-full"
onClick={async () => { onClick={async () => {
await copyText(record.key); await copyText(record.key);
}} }}
@@ -225,11 +203,9 @@ const RedemptionsTable = () => {
{t('复制')} {t('复制')}
</Button> </Button>
<Button <Button
icon={<IconEdit />}
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full"
onClick={() => { onClick={() => {
setEditingRedemption(record); setEditingRedemption(record);
setShowEdit(true); setShowEdit(true);
@@ -244,11 +220,10 @@ const RedemptionsTable = () => {
menu={moreMenuItems} menu={moreMenuItems}
> >
<Button <Button
icon={<IconMore />}
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full" icon={<IconMore />}
/> />
</Dropdown> </Dropdown>
</Space> </Space>
@@ -451,8 +426,7 @@ const RedemptionsTable = () => {
<Button <Button
theme='light' theme='light'
type='secondary' type='secondary'
icon={<IconDescend />} className="w-full md:w-auto"
className="!rounded-full w-full md:w-auto"
onClick={() => setCompactMode(!compactMode)} onClick={() => setCompactMode(!compactMode)}
> >
{compactMode ? t('自适应列表') : t('紧凑列表')} {compactMode ? t('自适应列表') : t('紧凑列表')}
@@ -468,8 +442,7 @@ const RedemptionsTable = () => {
<Button <Button
theme='light' theme='light'
type='primary' type='primary'
icon={<IconPlus />} className="w-full sm:w-auto"
className="!rounded-full w-full sm:w-auto"
onClick={() => { onClick={() => {
setEditingRedemption({ setEditingRedemption({
id: undefined, id: undefined,
@@ -481,8 +454,7 @@ const RedemptionsTable = () => {
</Button> </Button>
<Button <Button
type='warning' type='warning'
icon={<IconCopy />} className="w-full sm:w-auto"
className="!rounded-full w-full sm:w-auto"
onClick={async () => { onClick={async () => {
if (selectedKeys.length === 0) { if (selectedKeys.length === 0) {
showError(t('请至少选择一个兑换码!')); showError(t('请至少选择一个兑换码!'));
@@ -501,8 +473,7 @@ const RedemptionsTable = () => {
</div> </div>
<Button <Button
type='danger' type='danger'
icon={<IconDelete />} className="w-full sm:w-auto"
className="!rounded-full w-full sm:w-auto"
onClick={() => { onClick={() => {
Modal.confirm({ Modal.confirm({
title: t('确定清除所有失效兑换码?'), title: t('确定清除所有失效兑换码?'),
@@ -546,7 +517,6 @@ const RedemptionsTable = () => {
field="searchKeyword" field="searchKeyword"
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('关键字(id或者名称)')} placeholder={t('关键字(id或者名称)')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -556,7 +526,7 @@ const RedemptionsTable = () => {
type="primary" type="primary"
htmlType="submit" htmlType="submit"
loading={loading || searching} loading={loading || searching}
className="!rounded-full flex-1 md:flex-initial md:w-auto" className="flex-1 md:flex-initial md:w-auto"
> >
{t('查询')} {t('查询')}
</Button> </Button>
@@ -572,7 +542,7 @@ const RedemptionsTable = () => {
}, 100); }, 100);
} }
}} }}
className="!rounded-full flex-1 md:flex-initial md:w-auto" className="flex-1 md:flex-initial md:w-auto"
> >
{t('重置')} {t('重置')}
</Button> </Button>

View File

@@ -47,8 +47,6 @@ import { ITEMS_PER_PAGE } from '../../constants';
import { import {
IconEyeOpened, IconEyeOpened,
IconSearch, IconSearch,
IconSetting,
IconDescend
} from '@douyinfe/semi-icons'; } from '@douyinfe/semi-icons';
import { useTableCompactMode } from '../../hooks/useTableCompactMode'; import { useTableCompactMode } from '../../hooks/useTableCompactMode';
@@ -600,21 +598,18 @@ const LogsTable = () => {
<Button <Button
theme="light" theme="light"
onClick={() => initDefaultColumns()} onClick={() => initDefaultColumns()}
className="!rounded-full"
> >
{t('重置')} {t('重置')}
</Button> </Button>
<Button <Button
theme="light" theme="light"
onClick={() => setShowColumnSelector(false)} onClick={() => setShowColumnSelector(false)}
className="!rounded-full"
> >
{t('取消')} {t('取消')}
</Button> </Button>
<Button <Button
type='primary' type='primary'
onClick={() => setShowColumnSelector(false)} onClick={() => setShowColumnSelector(false)}
className="!rounded-full"
> >
{t('确定')} {t('确定')}
</Button> </Button>
@@ -684,8 +679,7 @@ const LogsTable = () => {
<Button <Button
theme='light' theme='light'
type='secondary' type='secondary'
icon={<IconDescend />} className="w-full md:w-auto"
className="!rounded-full w-full md:w-auto"
onClick={() => setCompactMode(!compactMode)} onClick={() => setCompactMode(!compactMode)}
> >
{compactMode ? t('自适应列表') : t('紧凑列表')} {compactMode ? t('自适应列表') : t('紧凑列表')}
@@ -724,7 +718,6 @@ const LogsTable = () => {
field='task_id' field='task_id'
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('任务 ID')} placeholder={t('任务 ID')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -735,7 +728,6 @@ const LogsTable = () => {
field='channel_id' field='channel_id'
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('渠道 ID')} placeholder={t('渠道 ID')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -750,7 +742,6 @@ const LogsTable = () => {
type='primary' type='primary'
htmlType='submit' htmlType='submit'
loading={loading} loading={loading}
className="!rounded-full"
> >
{t('查询')} {t('查询')}
</Button> </Button>
@@ -765,16 +756,13 @@ const LogsTable = () => {
}, 100); }, 100);
} }
}} }}
className="!rounded-full"
> >
{t('重置')} {t('重置')}
</Button> </Button>
<Button <Button
theme='light' theme='light'
type='tertiary' type='tertiary'
icon={<IconSetting />}
onClick={() => setShowColumnSelector(true)} onClick={() => setShowColumnSelector(true)}
className="!rounded-full"
> >
{t('列设置')} {t('列设置')}
</Button> </Button>

View File

@@ -1,4 +1,4 @@
import React, { useEffect, useState, useMemo } from 'react'; import React, { useEffect, useState } from 'react';
import { import {
API, API,
copy, copy,
@@ -9,7 +9,6 @@ import {
renderQuota, renderQuota,
getQuotaPerUnit getQuotaPerUnit
} from '../../helpers'; } from '../../helpers';
import { ITEMS_PER_PAGE } from '../../constants'; import { ITEMS_PER_PAGE } from '../../constants';
import { import {
Button, Button,
@@ -29,32 +28,12 @@ import {
IllustrationNoResult, IllustrationNoResult,
IllustrationNoResultDark IllustrationNoResultDark
} from '@douyinfe/semi-illustrations'; } from '@douyinfe/semi-illustrations';
import { import {
CheckCircle,
Shield,
XCircle,
Clock,
Gauge,
HelpCircle,
Infinity,
Coins,
Key
} from 'lucide-react';
import {
IconPlus,
IconCopy,
IconSearch, IconSearch,
IconTreeTriangleDown, IconTreeTriangleDown,
IconEyeOpened,
IconEdit,
IconDelete,
IconStop,
IconPlay,
IconMore, IconMore,
IconDescend
} from '@douyinfe/semi-icons'; } from '@douyinfe/semi-icons';
import { Key } from 'lucide-react';
import EditToken from '../../pages/Token/EditToken'; import EditToken from '../../pages/Token/EditToken';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useTableCompactMode } from '../../hooks/useTableCompactMode'; import { useTableCompactMode } from '../../hooks/useTableCompactMode';
@@ -73,38 +52,38 @@ const TokensTable = () => {
case 1: case 1:
if (model_limits_enabled) { if (model_limits_enabled) {
return ( return (
<Tag color='green' size='large' shape='circle' prefixIcon={<Shield size={14} />}> <Tag color='green' size='large' shape='circle' >
{t('已启用:限制模型')} {t('已启用:限制模型')}
</Tag> </Tag>
); );
} else { } else {
return ( return (
<Tag color='green' size='large' shape='circle' prefixIcon={<CheckCircle size={14} />}> <Tag color='green' size='large' shape='circle' >
{t('已启用')} {t('已启用')}
</Tag> </Tag>
); );
} }
case 2: case 2:
return ( return (
<Tag color='red' size='large' shape='circle' prefixIcon={<XCircle size={14} />}> <Tag color='red' size='large' shape='circle' >
{t('已禁用')} {t('已禁用')}
</Tag> </Tag>
); );
case 3: case 3:
return ( return (
<Tag color='yellow' size='large' shape='circle' prefixIcon={<Clock size={14} />}> <Tag color='yellow' size='large' shape='circle' >
{t('已过期')} {t('已过期')}
</Tag> </Tag>
); );
case 4: case 4:
return ( return (
<Tag color='grey' size='large' shape='circle' prefixIcon={<Gauge size={14} />}> <Tag color='grey' size='large' shape='circle' >
{t('已耗尽')} {t('已耗尽')}
</Tag> </Tag>
); );
default: default:
return ( return (
<Tag color='black' size='large' shape='circle' prefixIcon={<HelpCircle size={14} />}> <Tag color='black' size='large' shape='circle' >
{t('未知状态')} {t('未知状态')}
</Tag> </Tag>
); );
@@ -137,7 +116,7 @@ const TokensTable = () => {
render: (text, record, index) => { render: (text, record, index) => {
return ( return (
<div> <div>
<Tag size={'large'} color={'grey'} shape='circle' prefixIcon={<Coins size={14} />}> <Tag size={'large'} color={'grey'} shape='circle' >
{renderQuota(parseInt(text))} {renderQuota(parseInt(text))}
</Tag> </Tag>
</div> </div>
@@ -164,7 +143,7 @@ const TokensTable = () => {
return ( return (
<div> <div>
{record.unlimited_quota ? ( {record.unlimited_quota ? (
<Tag size={'large'} color={'white'} shape='circle' prefixIcon={<Infinity size={14} />}> <Tag size={'large'} color={'white'} shape='circle' >
{t('无限制')} {t('无限制')}
</Tag> </Tag>
) : ( ) : (
@@ -172,7 +151,6 @@ const TokensTable = () => {
size={'large'} size={'large'}
color={getQuotaColor(parseInt(text))} color={getQuotaColor(parseInt(text))}
shape='circle' shape='circle'
prefixIcon={<Coins size={14} />}
> >
{renderQuota(parseInt(text))} {renderQuota(parseInt(text))}
</Tag> </Tag>
@@ -238,7 +216,6 @@ const TokensTable = () => {
{ {
node: 'item', node: 'item',
name: t('查看'), name: t('查看'),
icon: <IconEyeOpened />,
onClick: () => { onClick: () => {
Modal.info({ Modal.info({
title: t('令牌详情'), title: t('令牌详情'),
@@ -250,7 +227,6 @@ const TokensTable = () => {
{ {
node: 'item', node: 'item',
name: t('删除'), name: t('删除'),
icon: <IconDelete />,
type: 'danger', type: 'danger',
onClick: () => { onClick: () => {
Modal.confirm({ Modal.confirm({
@@ -271,7 +247,6 @@ const TokensTable = () => {
moreMenuItems.push({ moreMenuItems.push({
node: 'item', node: 'item',
name: t('禁用'), name: t('禁用'),
icon: <IconStop />,
type: 'warning', type: 'warning',
onClick: () => { onClick: () => {
manageToken(record.id, 'disable', record); manageToken(record.id, 'disable', record);
@@ -281,7 +256,6 @@ const TokensTable = () => {
moreMenuItems.push({ moreMenuItems.push({
node: 'item', node: 'item',
name: t('启用'), name: t('启用'),
icon: <IconPlay />,
type: 'secondary', type: 'secondary',
onClick: () => { onClick: () => {
manageToken(record.id, 'enable', record); manageToken(record.id, 'enable', record);
@@ -292,7 +266,7 @@ const TokensTable = () => {
return ( return (
<Space wrap> <Space wrap>
<SplitButtonGroup <SplitButtonGroup
className="!rounded-full overflow-hidden" className="overflow-hidden"
aria-label={t('项目操作按钮组')} aria-label={t('项目操作按钮组')}
> >
<Button <Button
@@ -331,11 +305,9 @@ const TokensTable = () => {
</SplitButtonGroup> </SplitButtonGroup>
<Button <Button
icon={<IconCopy />}
theme='light' theme='light'
type='secondary' type='secondary'
size="small" size="small"
className="!rounded-full"
onClick={async (text) => { onClick={async (text) => {
await copyText('sk-' + record.key); await copyText('sk-' + record.key);
}} }}
@@ -344,11 +316,9 @@ const TokensTable = () => {
</Button> </Button>
<Button <Button
icon={<IconEdit />}
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full"
onClick={() => { onClick={() => {
setEditingToken(record); setEditingToken(record);
setShowEdit(true); setShowEdit(true);
@@ -367,7 +337,6 @@ const TokensTable = () => {
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full"
/> />
</Dropdown> </Dropdown>
</Space> </Space>
@@ -621,8 +590,7 @@ const TokensTable = () => {
<Button <Button
theme="light" theme="light"
type="secondary" type="secondary"
icon={<IconDescend />} className="w-full md:w-auto"
className="!rounded-full w-full md:w-auto"
onClick={() => setCompactMode(!compactMode)} onClick={() => setCompactMode(!compactMode)}
> >
{compactMode ? t('自适应列表') : t('紧凑列表')} {compactMode ? t('自适应列表') : t('紧凑列表')}
@@ -637,8 +605,7 @@ const TokensTable = () => {
<Button <Button
theme="light" theme="light"
type="primary" type="primary"
icon={<IconPlus />} className="flex-1 md:flex-initial"
className="!rounded-full flex-1 md:flex-initial"
onClick={() => { onClick={() => {
setEditingToken({ setEditingToken({
id: undefined, id: undefined,
@@ -651,8 +618,7 @@ const TokensTable = () => {
<Button <Button
theme="light" theme="light"
type="warning" type="warning"
icon={<IconCopy />} className="flex-1 md:flex-initial"
className="!rounded-full flex-1 md:flex-initial"
onClick={() => { onClick={() => {
if (selectedKeys.length === 0) { if (selectedKeys.length === 0) {
showError(t('请至少选择一个令牌!')); showError(t('请至少选择一个令牌!'));
@@ -667,7 +633,6 @@ const TokensTable = () => {
<Button <Button
type="primary" type="primary"
theme="solid" theme="solid"
icon={<IconCopy />}
onClick={async () => { onClick={async () => {
let content = ''; let content = '';
for (let i = 0; i < selectedKeys.length; i++) { for (let i = 0; i < selectedKeys.length; i++) {
@@ -682,7 +647,6 @@ const TokensTable = () => {
</Button> </Button>
<Button <Button
theme="light" theme="light"
icon={<IconCopy />}
onClick={async () => { onClick={async () => {
let content = ''; let content = '';
for (let i = 0; i < selectedKeys.length; i++) { for (let i = 0; i < selectedKeys.length; i++) {
@@ -704,8 +668,7 @@ const TokensTable = () => {
<Button <Button
theme="light" theme="light"
type="danger" type="danger"
icon={<IconDelete />} className="w-full md:w-auto"
className="!rounded-full w-full md:w-auto"
onClick={() => { onClick={() => {
if (selectedKeys.length === 0) { if (selectedKeys.length === 0) {
showError(t('请至少选择一个令牌!')); showError(t('请至少选择一个令牌!'));
@@ -743,7 +706,6 @@ const TokensTable = () => {
field="searchKeyword" field="searchKeyword"
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('搜索关键字')} placeholder={t('搜索关键字')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -753,7 +715,6 @@ const TokensTable = () => {
field="searchToken" field="searchToken"
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('密钥')} placeholder={t('密钥')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -763,7 +724,7 @@ const TokensTable = () => {
type="primary" type="primary"
htmlType="submit" htmlType="submit"
loading={loading || searching} loading={loading || searching}
className="!rounded-full flex-1 md:flex-initial md:w-auto" className="flex-1 md:flex-initial md:w-auto"
> >
{t('查询')} {t('查询')}
</Button> </Button>
@@ -778,7 +739,7 @@ const TokensTable = () => {
}, 100); }, 100);
} }
}} }}
className="!rounded-full flex-1 md:flex-initial md:w-auto" className="flex-1 md:flex-initial md:w-auto"
> >
{t('重置')} {t('重置')}
</Button> </Button>

View File

@@ -34,17 +34,9 @@ import {
IllustrationNoResultDark IllustrationNoResultDark
} from '@douyinfe/semi-illustrations'; } from '@douyinfe/semi-illustrations';
import { import {
IconPlus,
IconSearch, IconSearch,
IconEdit,
IconDelete,
IconStop,
IconPlay,
IconMore,
IconUserAdd, IconUserAdd,
IconArrowUp, IconMore,
IconArrowDown,
IconDescend
} from '@douyinfe/semi-icons'; } from '@douyinfe/semi-icons';
import { ITEMS_PER_PAGE } from '../../constants'; import { ITEMS_PER_PAGE } from '../../constants';
import AddUser from '../../pages/User/AddUser'; import AddUser from '../../pages/User/AddUser';
@@ -127,7 +119,7 @@ const UsersTable = () => {
<Tooltip content={remark} position="top" showArrow> <Tooltip content={remark} position="top" showArrow>
<Tag color='white' size='large' shape='circle' className="!text-xs"> <Tag color='white' size='large' shape='circle' className="!text-xs">
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<div className="w-2 h-2 rounded-full flex-shrink-0" style={{ backgroundColor: '#10b981' }} /> <div className="w-2 h-2 flex-shrink-0" style={{ backgroundColor: '#10b981' }} />
{displayRemark} {displayRemark}
</div> </div>
</Tag> </Tag>
@@ -221,7 +213,6 @@ const UsersTable = () => {
{ {
node: 'item', node: 'item',
name: t('提升'), name: t('提升'),
icon: <IconArrowUp />,
type: 'warning', type: 'warning',
onClick: () => { onClick: () => {
Modal.confirm({ Modal.confirm({
@@ -236,7 +227,6 @@ const UsersTable = () => {
{ {
node: 'item', node: 'item',
name: t('降级'), name: t('降级'),
icon: <IconArrowDown />,
type: 'secondary', type: 'secondary',
onClick: () => { onClick: () => {
Modal.confirm({ Modal.confirm({
@@ -251,7 +241,6 @@ const UsersTable = () => {
{ {
node: 'item', node: 'item',
name: t('注销'), name: t('注销'),
icon: <IconDelete />,
type: 'danger', type: 'danger',
onClick: () => { onClick: () => {
Modal.confirm({ Modal.confirm({
@@ -272,7 +261,6 @@ const UsersTable = () => {
moreMenuItems.splice(-1, 0, { moreMenuItems.splice(-1, 0, {
node: 'item', node: 'item',
name: t('禁用'), name: t('禁用'),
icon: <IconStop />,
type: 'warning', type: 'warning',
onClick: () => { onClick: () => {
manageUser(record.id, 'disable', record); manageUser(record.id, 'disable', record);
@@ -282,7 +270,6 @@ const UsersTable = () => {
moreMenuItems.splice(-1, 0, { moreMenuItems.splice(-1, 0, {
node: 'item', node: 'item',
name: t('启用'), name: t('启用'),
icon: <IconPlay />,
type: 'secondary', type: 'secondary',
onClick: () => { onClick: () => {
manageUser(record.id, 'enable', record); manageUser(record.id, 'enable', record);
@@ -294,11 +281,9 @@ const UsersTable = () => {
return ( return (
<Space> <Space>
<Button <Button
icon={<IconEdit />}
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full"
onClick={() => { onClick={() => {
setEditingUser(record); setEditingUser(record);
setShowEditUser(true); setShowEditUser(true);
@@ -312,11 +297,10 @@ const UsersTable = () => {
menu={moreMenuItems} menu={moreMenuItems}
> >
<Button <Button
icon={<IconMore />}
theme='light' theme='light'
type='tertiary' type='tertiary'
size="small" size="small"
className="!rounded-full" icon={<IconMore />}
/> />
</Dropdown> </Dropdown>
</Space> </Space>
@@ -538,8 +522,7 @@ const UsersTable = () => {
<Button <Button
theme='light' theme='light'
type='secondary' type='secondary'
icon={<IconDescend />} className="w-full md:w-auto"
className="!rounded-full w-full md:w-auto"
onClick={() => setCompactMode(!compactMode)} onClick={() => setCompactMode(!compactMode)}
> >
{compactMode ? t('自适应列表') : t('紧凑列表')} {compactMode ? t('自适应列表') : t('紧凑列表')}
@@ -554,8 +537,7 @@ const UsersTable = () => {
<Button <Button
theme='light' theme='light'
type='primary' type='primary'
icon={<IconPlus />} className="w-full md:w-auto"
className="!rounded-full w-full md:w-auto"
onClick={() => { onClick={() => {
setShowAddUser(true); setShowAddUser(true);
}} }}
@@ -584,7 +566,6 @@ const UsersTable = () => {
field="searchKeyword" field="searchKeyword"
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={t('支持搜索用户的 ID、用户名、显示名称和邮箱地址')} placeholder={t('支持搜索用户的 ID、用户名、显示名称和邮箱地址')}
className="!rounded-full"
showClear showClear
pure pure
/> />
@@ -601,7 +582,7 @@ const UsersTable = () => {
searchUsers(1, pageSize); searchUsers(1, pageSize);
}, 100); }, 100);
}} }}
className="!rounded-full w-full" className="w-full"
showClear showClear
pure pure
/> />
@@ -611,7 +592,7 @@ const UsersTable = () => {
type="primary" type="primary"
htmlType="submit" htmlType="submit"
loading={loading || searching} loading={loading || searching}
className="!rounded-full flex-1 md:flex-initial md:w-auto" className="flex-1 md:flex-initial md:w-auto"
> >
{t('查询')} {t('查询')}
</Button> </Button>
@@ -627,7 +608,7 @@ const UsersTable = () => {
}, 100); }, 100);
} }
}} }}
className="!rounded-full flex-1 md:flex-initial md:w-auto" className="flex-1 md:flex-initial md:w-auto"
> >
{t('重置')} {t('重置')}
</Button> </Button>
@@ -689,7 +670,7 @@ const UsersTable = () => {
style={{ padding: 30 }} style={{ padding: 30 }}
/> />
} }
className="rounded-xl overflow-hidden" className="overflow-hidden"
size="middle" size="middle"
/> />
</Card> </Card>

View File

@@ -456,7 +456,7 @@
"创建新的令牌": "Create New Token", "创建新的令牌": "Create New Token",
"令牌分组,默认为用户的分组": "Token group, default is the your's group", "令牌分组,默认为用户的分组": "Token group, default is the your's group",
"IP白名单": "IP whitelist", "IP白名单": "IP whitelist",
"注意,令牌的额度仅用于限制令牌本身的最大额度使用量,实际的使用受到账户的剩余额度限制": "Note that the quota of the token is only used to limit the maximum quota usage of the token itself, and the actual usage is limited by the remaining quota of the account.", "令牌的额度仅用于限制令牌本身的最大额度使用量,实际的使用受到账户的剩余额度限制": "The quota of the token is only used to limit the maximum quota usage of the token itself, and the actual usage is limited by the remaining quota of the account",
"无限额度": "Unlimited quota", "无限额度": "Unlimited quota",
"更新令牌信息": "Update Token Information", "更新令牌信息": "Update Token Information",
"请输入充值码!": "Please enter the recharge code!", "请输入充值码!": "Please enter the recharge code!",
@@ -1746,7 +1746,7 @@
"请先选择模型!": "Please select a model first!", "请先选择模型!": "Please select a model first!",
"已复制 ${count} 个模型": "Copied ${count} models", "已复制 ${count} 个模型": "Copied ${count} models",
"复制失败,请手动复制": "Copy failed, please copy manually", "复制失败,请手动复制": "Copy failed, please copy manually",
"快捷设置": "Quick settings", "过期时间快捷设置": "Expiration time quick settings",
"批量创建时会在名称后自动添加随机后缀": "When creating in batches, a random suffix will be automatically added to the name", "批量创建时会在名称后自动添加随机后缀": "When creating in batches, a random suffix will be automatically added to the name",
"额度必须大于0": "Quota must be greater than 0", "额度必须大于0": "Quota must be greater than 0",
"生成数量必须大于0": "Generation quantity must be greater than 0", "生成数量必须大于0": "Generation quantity must be greater than 0",

View File

@@ -43,6 +43,7 @@ code {
/* ==================== 导航和侧边栏样式 ==================== */ /* ==================== 导航和侧边栏样式 ==================== */
/* 导航项样式 */ /* 导航项样式 */
.semi-input-textarea-wrapper,
.semi-navigation-sub-title, .semi-navigation-sub-title,
.semi-chat-inputBox-sendButton, .semi-chat-inputBox-sendButton,
.semi-page-item, .semi-page-item,
@@ -53,7 +54,7 @@ code {
.semi-select, .semi-select,
.semi-button, .semi-button,
.semi-datepicker-range-input { .semi-datepicker-range-input {
border-radius: 9999px !important; border-radius: 10px !important;
} }
.semi-navigation-item { .semi-navigation-item {

View File

@@ -457,7 +457,6 @@ const EditChannel = (props) => {
<Space> <Space>
<Button <Button
theme="solid" theme="solid"
className="!rounded-full"
onClick={submit} onClick={submit}
icon={<IconSave />} icon={<IconSave />}
> >
@@ -465,7 +464,6 @@ const EditChannel = (props) => {
</Button> </Button>
<Button <Button
theme="light" theme="light"
className="!rounded-full"
type="primary" type="primary"
onClick={handleCancel} onClick={handleCancel}
icon={<IconClose />} icon={<IconClose />}
@@ -479,7 +477,7 @@ const EditChannel = (props) => {
onCancel={() => handleCancel()} onCancel={() => handleCancel()}
> >
<Spin spinning={loading}> <Spin spinning={loading}>
<div className="p-6"> <div className="p-2">
<Card className="!rounded-2xl shadow-sm border-0 mb-6"> <Card className="!rounded-2xl shadow-sm border-0 mb-6">
{/* Header: Basic Info */} {/* Header: Basic Info */}
<div className="flex items-center mb-2"> <div className="flex items-center mb-2">
@@ -505,7 +503,6 @@ const EditChannel = (props) => {
filter filter
searchPosition='dropdown' searchPosition='dropdown'
placeholder={t('请选择渠道类型')} placeholder={t('请选择渠道类型')}
className="!rounded-lg"
/> />
</div> </div>
@@ -520,7 +517,6 @@ const EditChannel = (props) => {
}} }}
value={inputs.name} value={inputs.name}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
@@ -537,7 +533,6 @@ const EditChannel = (props) => {
value={inputs.key} value={inputs.key}
autosize={{ minRows: 6, maxRows: 6 }} autosize={{ minRows: 6, maxRows: 6 }}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
) : ( ) : (
<> <>
@@ -566,7 +561,6 @@ const EditChannel = (props) => {
autosize={{ minRows: 10 }} autosize={{ minRows: 10 }}
value={inputs.key} value={inputs.key}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg font-mono"
/> />
) : ( ) : (
<Input <Input
@@ -578,7 +572,6 @@ const EditChannel = (props) => {
}} }}
value={inputs.key} value={inputs.key}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
)} )}
</> </>
@@ -627,7 +620,6 @@ const EditChannel = (props) => {
</Text> </Text>
</div> </div>
} }
className='!rounded-lg'
/> />
)} )}
@@ -646,7 +638,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('base_url', value)} onChange={(value) => handleInputChange('base_url', value)}
value={inputs.base_url} value={inputs.base_url}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
<div> <div>
@@ -657,7 +648,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('other', value)} onChange={(value) => handleInputChange('other', value)}
value={inputs.other} value={inputs.other}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
</> </>
@@ -678,7 +668,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('base_url', value)} onChange={(value) => handleInputChange('base_url', value)}
value={inputs.base_url} value={inputs.base_url}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
</> </>
@@ -701,7 +690,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('base_url', value)} onChange={(value) => handleInputChange('base_url', value)}
value={inputs.base_url} value={inputs.base_url}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
<Text type="tertiary" className="mt-1 text-xs"> <Text type="tertiary" className="mt-1 text-xs">
{t('对于官方渠道new-api已经内置地址除非是第三方代理站点或者Azure的特殊接入地址否则不需要填写')} {t('对于官方渠道new-api已经内置地址除非是第三方代理站点或者Azure的特殊接入地址否则不需要填写')}
@@ -718,7 +706,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('base_url', value)} onChange={(value) => handleInputChange('base_url', value)}
value={inputs.base_url} value={inputs.base_url}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
)} )}
@@ -734,7 +721,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('base_url', value)} onChange={(value) => handleInputChange('base_url', value)}
value={inputs.base_url} value={inputs.base_url}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
)} )}
@@ -769,7 +755,6 @@ const EditChannel = (props) => {
value={inputs.models} value={inputs.models}
autoComplete='new-password' autoComplete='new-password'
optionList={modelOptions} optionList={modelOptions}
className="!rounded-lg"
/> />
</div> </div>
@@ -777,14 +762,12 @@ const EditChannel = (props) => {
<Button <Button
type='primary' type='primary'
onClick={() => handleInputChange('models', basicModels)} onClick={() => handleInputChange('models', basicModels)}
className="!rounded-lg"
> >
{t('填入相关模型')} {t('填入相关模型')}
</Button> </Button>
<Button <Button
type='secondary' type='secondary'
onClick={() => handleInputChange('models', fullModels)} onClick={() => handleInputChange('models', fullModels)}
className="!rounded-lg"
> >
{t('填入所有模型')} {t('填入所有模型')}
</Button> </Button>
@@ -792,7 +775,6 @@ const EditChannel = (props) => {
<Button <Button
type='tertiary' type='tertiary'
onClick={() => fetchUpstreamModelList('models')} onClick={() => fetchUpstreamModelList('models')}
className="!rounded-lg"
> >
{t('获取模型列表')} {t('获取模型列表')}
</Button> </Button>
@@ -800,7 +782,6 @@ const EditChannel = (props) => {
<Button <Button
type='warning' type='warning'
onClick={() => handleInputChange('models', [])} onClick={() => handleInputChange('models', [])}
className="!rounded-lg"
> >
{t('清除所有模型')} {t('清除所有模型')}
</Button> </Button>
@@ -818,7 +799,6 @@ const EditChannel = (props) => {
showError(t('复制失败')); showError(t('复制失败'));
} }
}} }}
className="!rounded-lg"
> >
{t('复制所有模型')} {t('复制所有模型')}
</Button> </Button>
@@ -842,7 +822,6 @@ const EditChannel = (props) => {
placeholder={t('输入自定义模型名称')} placeholder={t('输入自定义模型名称')}
value={customModel} value={customModel}
onChange={(value) => setCustomModel(value.trim())} onChange={(value) => setCustomModel(value.trim())}
className="!rounded-lg"
/> />
</div> </div>
@@ -858,7 +837,6 @@ const EditChannel = (props) => {
autosize autosize
value={inputs.model_mapping} value={inputs.model_mapping}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg font-mono"
/> />
<Text <Text
className="!text-semi-color-primary cursor-pointer mt-1 block" className="!text-semi-color-primary cursor-pointer mt-1 block"
@@ -875,7 +853,6 @@ const EditChannel = (props) => {
placeholder={t('不填则为模型列表第一个')} placeholder={t('不填则为模型列表第一个')}
onChange={(value) => handleInputChange('test_model', value)} onChange={(value) => handleInputChange('test_model', value)}
value={inputs.test_model} value={inputs.test_model}
className="!rounded-lg"
/> />
</div> </div>
</div> </div>
@@ -909,7 +886,6 @@ const EditChannel = (props) => {
value={inputs.groups} value={inputs.groups}
autoComplete='new-password' autoComplete='new-password'
optionList={groupOptions} optionList={groupOptions}
className="!rounded-lg"
/> />
</div> </div>
@@ -922,7 +898,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('other', value)} onChange={(value) => handleInputChange('other', value)}
value={inputs.other} value={inputs.other}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
)} )}
@@ -943,7 +918,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('other', value)} onChange={(value) => handleInputChange('other', value)}
value={inputs.other} value={inputs.other}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg font-mono"
/> />
<Text <Text
className="!text-semi-color-primary cursor-pointer mt-1 block" className="!text-semi-color-primary cursor-pointer mt-1 block"
@@ -963,7 +937,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('other', value)} onChange={(value) => handleInputChange('other', value)}
value={inputs.other} value={inputs.other}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
)} )}
@@ -977,7 +950,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('other', value)} onChange={(value) => handleInputChange('other', value)}
value={inputs.other} value={inputs.other}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
)} )}
@@ -991,7 +963,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('other', value)} onChange={(value) => handleInputChange('other', value)}
value={inputs.other} value={inputs.other}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
)} )}
@@ -1004,7 +975,6 @@ const EditChannel = (props) => {
onChange={(value) => handleInputChange('tag', value)} onChange={(value) => handleInputChange('tag', value)}
value={inputs.tag} value={inputs.tag}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
@@ -1023,7 +993,6 @@ const EditChannel = (props) => {
}} }}
value={inputs.priority} value={inputs.priority}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
@@ -1042,7 +1011,6 @@ const EditChannel = (props) => {
}} }}
value={inputs.weight} value={inputs.weight}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg"
/> />
</div> </div>
@@ -1058,7 +1026,6 @@ const EditChannel = (props) => {
autosize autosize
value={inputs.setting} value={inputs.setting}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg font-mono"
/> />
<div className="flex gap-2 mt-1"> <div className="flex gap-2 mt-1">
<Text <Text
@@ -1097,7 +1064,6 @@ const EditChannel = (props) => {
autosize autosize
value={inputs.param_override} value={inputs.param_override}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg font-mono"
/> />
</div> </div>
@@ -1109,7 +1075,6 @@ const EditChannel = (props) => {
placeholder={t('请输入组织org-xxx')} placeholder={t('请输入组织org-xxx')}
onChange={(value) => handleInputChange('openai_organization', value)} onChange={(value) => handleInputChange('openai_organization', value)}
value={inputs.openai_organization} value={inputs.openai_organization}
className="!rounded-lg"
/> />
<Text type="tertiary" className="mt-1 text-xs"> <Text type="tertiary" className="mt-1 text-xs">
{t('组织,可选,不填则为默认组织')} {t('组织,可选,不填则为默认组织')}
@@ -1142,7 +1107,6 @@ const EditChannel = (props) => {
autosize autosize
value={inputs.status_code_mapping} value={inputs.status_code_mapping}
autoComplete='new-password' autoComplete='new-password'
className="!rounded-lg font-mono"
/> />
<Text <Text
className="!text-semi-color-primary cursor-pointer mt-1 block" className="!text-semi-color-primary cursor-pointer mt-1 block"

View File

@@ -283,7 +283,6 @@ const EditTagModal = (props) => {
<Space> <Space>
<Button <Button
theme="solid" theme="solid"
className="!rounded-full"
onClick={handleSave} onClick={handleSave}
loading={loading} loading={loading}
icon={<IconSave />} icon={<IconSave />}
@@ -292,7 +291,6 @@ const EditTagModal = (props) => {
</Button> </Button>
<Button <Button
theme="light" theme="light"
className="!rounded-full"
type="primary" type="primary"
onClick={handleClose} onClick={handleClose}
icon={<IconClose />} icon={<IconClose />}
@@ -305,7 +303,7 @@ const EditTagModal = (props) => {
closeIcon={null} closeIcon={null}
> >
<Spin spinning={loading}> <Spin spinning={loading}>
<div className="p-6"> <div className="p-2">
<Card className="!rounded-2xl shadow-sm border-0 mb-6"> <Card className="!rounded-2xl shadow-sm border-0 mb-6">
{/* Header: Tag Info */} {/* Header: Tag Info */}
<div className="flex items-center mb-2"> <div className="flex items-center mb-2">
@@ -331,7 +329,6 @@ const EditTagModal = (props) => {
value={inputs.new_tag} value={inputs.new_tag}
onChange={(value) => setInputs({ ...inputs, new_tag: value })} onChange={(value) => setInputs({ ...inputs, new_tag: value })}
placeholder={t('请输入新标签,留空则解散标签')} placeholder={t('请输入新标签,留空则解散标签')}
className="!rounded-lg"
/> />
</div> </div>
</div> </div>
@@ -366,7 +363,6 @@ const EditTagModal = (props) => {
onChange={(value) => handleInputChange('models', value)} onChange={(value) => handleInputChange('models', value)}
value={inputs.models} value={inputs.models}
optionList={modelOptions} optionList={modelOptions}
className="!rounded-lg"
/> />
</div> </div>
@@ -380,7 +376,6 @@ const EditTagModal = (props) => {
placeholder={t('输入自定义模型名称')} placeholder={t('输入自定义模型名称')}
value={customModel} value={customModel}
onChange={(value) => setCustomModel(value.trim())} onChange={(value) => setCustomModel(value.trim())}
className="!rounded-lg"
/> />
</div> </div>
@@ -392,7 +387,6 @@ const EditTagModal = (props) => {
onChange={(value) => handleInputChange('model_mapping', value)} onChange={(value) => handleInputChange('model_mapping', value)}
autosize autosize
value={inputs.model_mapping} value={inputs.model_mapping}
className="!rounded-lg font-mono"
/> />
<Space className="mt-2"> <Space className="mt-2">
<Text <Text
@@ -442,7 +436,6 @@ const EditTagModal = (props) => {
onChange={(value) => handleInputChange('groups', value)} onChange={(value) => handleInputChange('groups', value)}
value={inputs.groups} value={inputs.groups}
optionList={groupOptions} optionList={groupOptions}
className="!rounded-lg"
/> />
</div> </div>
</div> </div>

View File

@@ -149,6 +149,7 @@ const Home = () => {
type="primary" type="primary"
onClick={handleCopyBaseURL} onClick={handleCopyBaseURL}
icon={<IconCopy />} icon={<IconCopy />}
className="!rounded-full"
/> />
</div> </div>
} }

View File

@@ -162,7 +162,6 @@ const EditRedemption = (props) => {
<Space> <Space>
<Button <Button
theme="solid" theme="solid"
className="!rounded-full"
onClick={() => formApiRef.current?.submitForm()} onClick={() => formApiRef.current?.submitForm()}
icon={<IconSave />} icon={<IconSave />}
loading={loading} loading={loading}
@@ -171,7 +170,6 @@ const EditRedemption = (props) => {
</Button> </Button>
<Button <Button
theme="light" theme="light"
className="!rounded-full"
type="primary" type="primary"
onClick={handleCancel} onClick={handleCancel}
icon={<IconClose />} icon={<IconClose />}
@@ -191,7 +189,7 @@ const EditRedemption = (props) => {
onSubmit={submit} onSubmit={submit}
> >
{({ values }) => ( {({ values }) => (
<div className="p-6 space-y-6"> <div className="p-2">
<Card className="!rounded-2xl shadow-sm border-0 mb-6"> <Card className="!rounded-2xl shadow-sm border-0 mb-6">
{/* Header: Basic Info */} {/* Header: Basic Info */}
<div className="flex items-center mb-2"> <div className="flex items-center mb-2">

View File

@@ -230,7 +230,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
render: (text, record) => ( render: (text, record) => (
<Tag <Tag
color={record.color} color={record.color}
className="!rounded-full" shape='circle'
style={{ maxWidth: '280px' }} style={{ maxWidth: '280px' }}
> >
{text} {text}
@@ -277,7 +277,6 @@ const SettingsAPIInfo = ({ options, refresh }) => {
theme='light' theme='light'
type='tertiary' type='tertiary'
size='small' size='small'
className="!rounded-full"
onClick={() => handleEditApi(record)} onClick={() => handleEditApi(record)}
> >
{t('编辑')} {t('编辑')}
@@ -287,7 +286,6 @@ const SettingsAPIInfo = ({ options, refresh }) => {
type='danger' type='danger'
theme='light' theme='light'
size='small' size='small'
className="!rounded-full"
onClick={() => handleDeleteApi(record)} onClick={() => handleDeleteApi(record)}
> >
{t('删除')} {t('删除')}
@@ -327,7 +325,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
theme='light' theme='light'
type='primary' type='primary'
icon={<Plus size={14} />} icon={<Plus size={14} />}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
onClick={handleAddApi} onClick={handleAddApi}
> >
{t('添加API')} {t('添加API')}
@@ -338,7 +336,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
theme='light' theme='light'
onClick={handleBatchDelete} onClick={handleBatchDelete}
disabled={selectedRowKeys.length === 0} disabled={selectedRowKeys.length === 0}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`} {t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`}
</Button> </Button>
@@ -348,7 +346,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
loading={loading} loading={loading}
disabled={!hasChanges} disabled={!hasChanges}
type='secondary' type='secondary'
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('保存设置')} {t('保存设置')}
</Button> </Button>
@@ -430,7 +428,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
style={{ padding: 30 }} style={{ padding: 30 }}
/> />
} }
className="rounded-xl overflow-hidden" className="overflow-hidden"
/> />
</Form.Section> </Form.Section>
@@ -441,7 +439,6 @@ const SettingsAPIInfo = ({ options, refresh }) => {
onCancel={() => setShowApiModal(false)} onCancel={() => setShowApiModal(false)}
okText={t('保存')} okText={t('保存')}
cancelText={t('取消')} cancelText={t('取消')}
className="rounded-xl"
confirmLoading={modalLoading} confirmLoading={modalLoading}
> >
<Form layout='vertical' initValues={apiForm} key={editingApi ? editingApi.id : 'new'}> <Form layout='vertical' initValues={apiForm} key={editingApi ? editingApi.id : 'new'}>
@@ -495,7 +492,6 @@ const SettingsAPIInfo = ({ options, refresh }) => {
okText={t('确认删除')} okText={t('确认删除')}
cancelText={t('取消')} cancelText={t('取消')}
type="warning" type="warning"
className="rounded-xl"
okButtonProps={{ okButtonProps={{
type: 'danger', type: 'danger',
theme: 'solid' theme: 'solid'

View File

@@ -155,7 +155,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
theme='light' theme='light'
type='tertiary' type='tertiary'
size='small' size='small'
className="!rounded-full"
onClick={() => handleEditAnnouncement(record)} onClick={() => handleEditAnnouncement(record)}
> >
{t('编辑')} {t('编辑')}
@@ -165,7 +164,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
type='danger' type='danger'
theme='light' theme='light'
size='small' size='small'
className="!rounded-full"
onClick={() => handleDeleteAnnouncement(record)} onClick={() => handleDeleteAnnouncement(record)}
> >
{t('删除')} {t('删除')}
@@ -365,7 +363,7 @@ const SettingsAnnouncements = ({ options, refresh }) => {
theme='light' theme='light'
type='primary' type='primary'
icon={<Plus size={14} />} icon={<Plus size={14} />}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
onClick={handleAddAnnouncement} onClick={handleAddAnnouncement}
> >
{t('添加公告')} {t('添加公告')}
@@ -376,7 +374,7 @@ const SettingsAnnouncements = ({ options, refresh }) => {
theme='light' theme='light'
onClick={handleBatchDelete} onClick={handleBatchDelete}
disabled={selectedRowKeys.length === 0} disabled={selectedRowKeys.length === 0}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`} {t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`}
</Button> </Button>
@@ -386,7 +384,7 @@ const SettingsAnnouncements = ({ options, refresh }) => {
loading={loading} loading={loading}
disabled={!hasChanges} disabled={!hasChanges}
type='secondary' type='secondary'
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('保存设置')} {t('保存设置')}
</Button> </Button>
@@ -471,7 +469,7 @@ const SettingsAnnouncements = ({ options, refresh }) => {
style={{ padding: 30 }} style={{ padding: 30 }}
/> />
} }
className="rounded-xl overflow-hidden" className="overflow-hidden"
/> />
</Form.Section> </Form.Section>
@@ -482,7 +480,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
onCancel={() => setShowAnnouncementModal(false)} onCancel={() => setShowAnnouncementModal(false)}
okText={t('保存')} okText={t('保存')}
cancelText={t('取消')} cancelText={t('取消')}
className="rounded-xl"
confirmLoading={modalLoading} confirmLoading={modalLoading}
> >
<Form <Form
@@ -543,7 +540,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
okText={t('确认删除')} okText={t('确认删除')}
cancelText={t('取消')} cancelText={t('取消')}
type="warning" type="warning"
className="rounded-xl"
okButtonProps={{ okButtonProps={{
type: 'danger', type: 'danger',
theme: 'solid' theme: 'solid'
@@ -566,7 +562,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
onCancel={() => setShowContentModal(false)} onCancel={() => setShowContentModal(false)}
okText={t('确定')} okText={t('确定')}
cancelText={t('取消')} cancelText={t('取消')}
className="rounded-xl"
width={800} width={800}
> >
<TextArea <TextArea

View File

@@ -98,7 +98,6 @@ const SettingsFAQ = ({ options, refresh }) => {
theme='light' theme='light'
type='tertiary' type='tertiary'
size='small' size='small'
className="!rounded-full"
onClick={() => handleEditFaq(record)} onClick={() => handleEditFaq(record)}
> >
{t('编辑')} {t('编辑')}
@@ -108,7 +107,6 @@ const SettingsFAQ = ({ options, refresh }) => {
type='danger' type='danger'
theme='light' theme='light'
size='small' size='small'
className="!rounded-full"
onClick={() => handleDeleteFaq(record)} onClick={() => handleDeleteFaq(record)}
> >
{t('删除')} {t('删除')}
@@ -297,7 +295,7 @@ const SettingsFAQ = ({ options, refresh }) => {
theme='light' theme='light'
type='primary' type='primary'
icon={<Plus size={14} />} icon={<Plus size={14} />}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
onClick={handleAddFaq} onClick={handleAddFaq}
> >
{t('添加问答')} {t('添加问答')}
@@ -308,7 +306,7 @@ const SettingsFAQ = ({ options, refresh }) => {
theme='light' theme='light'
onClick={handleBatchDelete} onClick={handleBatchDelete}
disabled={selectedRowKeys.length === 0} disabled={selectedRowKeys.length === 0}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`} {t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`}
</Button> </Button>
@@ -318,7 +316,7 @@ const SettingsFAQ = ({ options, refresh }) => {
loading={loading} loading={loading}
disabled={!hasChanges} disabled={!hasChanges}
type='secondary' type='secondary'
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('保存设置')} {t('保存设置')}
</Button> </Button>
@@ -397,7 +395,7 @@ const SettingsFAQ = ({ options, refresh }) => {
style={{ padding: 30 }} style={{ padding: 30 }}
/> />
} }
className="rounded-xl overflow-hidden" className="overflow-hidden"
/> />
</Form.Section> </Form.Section>
@@ -408,7 +406,6 @@ const SettingsFAQ = ({ options, refresh }) => {
onCancel={() => setShowFaqModal(false)} onCancel={() => setShowFaqModal(false)}
okText={t('保存')} okText={t('保存')}
cancelText={t('取消')} cancelText={t('取消')}
className="rounded-xl"
confirmLoading={modalLoading} confirmLoading={modalLoading}
width={800} width={800}
> >
@@ -444,7 +441,6 @@ const SettingsFAQ = ({ options, refresh }) => {
okText={t('确认删除')} okText={t('确认删除')}
cancelText={t('取消')} cancelText={t('取消')}
type="warning" type="warning"
className="rounded-xl"
okButtonProps={{ okButtonProps={{
type: 'danger', type: 'danger',
theme: 'solid' theme: 'solid'

View File

@@ -101,7 +101,6 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
theme='light' theme='light'
type='tertiary' type='tertiary'
size='small' size='small'
className="!rounded-full"
onClick={() => handleEditGroup(record)} onClick={() => handleEditGroup(record)}
> >
{t('编辑')} {t('编辑')}
@@ -111,7 +110,6 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
type='danger' type='danger'
theme='light' theme='light'
size='small' size='small'
className="!rounded-full"
onClick={() => handleDeleteGroup(record)} onClick={() => handleDeleteGroup(record)}
> >
{t('删除')} {t('删除')}
@@ -314,7 +312,7 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
theme='light' theme='light'
type='primary' type='primary'
icon={<Plus size={14} />} icon={<Plus size={14} />}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
onClick={handleAddGroup} onClick={handleAddGroup}
> >
{t('添加分类')} {t('添加分类')}
@@ -325,7 +323,7 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
theme='light' theme='light'
onClick={handleBatchDelete} onClick={handleBatchDelete}
disabled={selectedRowKeys.length === 0} disabled={selectedRowKeys.length === 0}
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`} {t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`}
</Button> </Button>
@@ -335,7 +333,7 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
loading={loading} loading={loading}
disabled={!hasChanges} disabled={!hasChanges}
type='secondary' type='secondary'
className="!rounded-full w-full md:w-auto" className="w-full md:w-auto"
> >
{t('保存设置')} {t('保存设置')}
</Button> </Button>
@@ -413,7 +411,7 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
style={{ padding: 30 }} style={{ padding: 30 }}
/> />
} }
className="rounded-xl overflow-hidden" className="overflow-hidden"
/> />
</Form.Section> </Form.Section>
@@ -424,7 +422,6 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
onCancel={() => setShowUptimeModal(false)} onCancel={() => setShowUptimeModal(false)}
okText={t('保存')} okText={t('保存')}
cancelText={t('取消')} cancelText={t('取消')}
className="rounded-xl"
confirmLoading={modalLoading} confirmLoading={modalLoading}
width={600} width={600}
> >
@@ -467,7 +464,6 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
okText={t('确认删除')} okText={t('确认删除')}
cancelText={t('取消')} cancelText={t('取消')}
type="warning" type="warning"
className="rounded-xl"
okButtonProps={{ okButtonProps={{
type: 'danger', type: 'danger',
theme: 'solid' theme: 'solid'

View File

@@ -9,7 +9,6 @@ import {
renderQuotaWithPrompt, renderQuotaWithPrompt,
} from '../../helpers'; } from '../../helpers';
import { import {
Banner,
Button, Button,
SideSheet, SideSheet,
Space, Space,
@@ -27,7 +26,7 @@ import {
IconLink, IconLink,
IconSave, IconSave,
IconClose, IconClose,
IconPlusCircle, IconKey,
} from '@douyinfe/semi-icons'; } from '@douyinfe/semi-icons';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { StatusContext } from '../../context/Status'; import { StatusContext } from '../../context/Status';
@@ -37,11 +36,11 @@ const { Text, Title } = Typography;
const EditToken = (props) => { const EditToken = (props) => {
const { t } = useTranslation(); const { t } = useTranslation();
const [statusState, statusDispatch] = useContext(StatusContext); const [statusState, statusDispatch] = useContext(StatusContext);
const [isEdit, setIsEdit] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const formApiRef = useRef(null); const formApiRef = useRef(null);
const [models, setModels] = useState([]); const [models, setModels] = useState([]);
const [groups, setGroups] = useState([]); const [groups, setGroups] = useState([]);
const isEdit = props.editingToken.id !== undefined;
const getInitValues = () => ({ const getInitValues = () => ({
name: '', name: '',
@@ -136,10 +135,6 @@ const EditToken = (props) => {
setLoading(false); setLoading(false);
}; };
useEffect(() => {
setIsEdit(props.editingToken.id !== undefined);
}, [props.editingToken.id]);
useEffect(() => { useEffect(() => {
if (formApiRef.current) { if (formApiRef.current) {
if (!isEdit) { if (!isEdit) {
@@ -150,7 +145,7 @@ const EditToken = (props) => {
} }
loadModels(); loadModels();
loadGroups(); loadGroups();
}, [isEdit]); }, [props.editingToken.id]);
const generateRandomSuffix = () => { const generateRandomSuffix = () => {
const characters = const characters =
@@ -262,7 +257,7 @@ const EditToken = (props) => {
<Space> <Space>
<Button <Button
theme='solid' theme='solid'
className='!rounded-full' className='!rounded-lg'
onClick={() => formApiRef.current?.submitForm()} onClick={() => formApiRef.current?.submitForm()}
icon={<IconSave />} icon={<IconSave />}
loading={loading} loading={loading}
@@ -271,7 +266,7 @@ const EditToken = (props) => {
</Button> </Button>
<Button <Button
theme='light' theme='light'
className='!rounded-full' className='!rounded-lg'
type='primary' type='primary'
onClick={handleCancel} onClick={handleCancel}
icon={<IconClose />} icon={<IconClose />}
@@ -292,12 +287,12 @@ const EditToken = (props) => {
onSubmit={submit} onSubmit={submit}
> >
{({ values }) => ( {({ values }) => (
<div className='p-6 space-y-6'> <div className='p-2'>
{/* 基本信息 */} {/* 基本信息 */}
<Card className='!rounded-2xl shadow-sm border-0'> <Card className='!rounded-2xl shadow-sm border-0'>
<div className='flex items-center mb-2'> <div className='flex items-center mb-2'>
<Avatar size='small' color='blue' className='mr-2 shadow-md'> <Avatar size='small' color='blue' className='mr-2 shadow-md'>
<IconPlusCircle size={16} /> <IconKey size={16} />
</Avatar> </Avatar>
<div> <div>
<Text className='text-lg font-medium'>{t('基本信息')}</Text> <Text className='text-lg font-medium'>{t('基本信息')}</Text>
@@ -322,33 +317,36 @@ const EditToken = (props) => {
placeholder={t('令牌分组,默认为用户的分组')} placeholder={t('令牌分组,默认为用户的分组')}
optionList={groups} optionList={groups}
renderOptionItem={renderGroupOption} renderOptionItem={renderGroupOption}
showClear
style={{ width: '100%' }}
/> />
) : ( ) : (
<Form.Select <Form.Select
placeholder={t('管理员未设置用户可选分组')} placeholder={t('管理员未设置用户可选分组')}
disabled disabled
label={t('令牌分组')} label={t('令牌分组')}
style={{ width: '100%' }}
/> />
)} )}
</Col> </Col>
<Col span={10}> <Col xs={24} sm={24} md={24} lg={10} xl={10}>
<Form.DatePicker <Form.DatePicker
field='expired_time' field='expired_time'
label={t('过期时间')} label={t('过期时间')}
type='dateTime' type='dateTime'
placeholder={t('请选择过期时间')} placeholder={t('请选择过期时间')}
style={{ width: '100%' }}
rules={[{ required: true, message: t('请选择过期时间') }]} rules={[{ required: true, message: t('请选择过期时间') }]}
showClear
style={{ width: '100%' }}
/> />
</Col> </Col>
<Col span={14} className='flex flex-col justify-end'> <Col xs={24} sm={24} md={24} lg={14} xl={14}>
<Form.Slot label={t('快捷设置')}> <Form.Slot label={t('过期时间快捷设置')}>
<Space wrap> <Space wrap>
<Button <Button
theme='light' theme='light'
type='primary' type='primary'
onClick={() => setExpiredTime(0, 0, 0, 0)} onClick={() => setExpiredTime(0, 0, 0, 0)}
className='!rounded-full'
> >
{t('永不过期')} {t('永不过期')}
</Button> </Button>
@@ -356,7 +354,6 @@ const EditToken = (props) => {
theme='light' theme='light'
type='tertiary' type='tertiary'
onClick={() => setExpiredTime(1, 0, 0, 0)} onClick={() => setExpiredTime(1, 0, 0, 0)}
className='!rounded-full'
> >
{t('一个月')} {t('一个月')}
</Button> </Button>
@@ -364,7 +361,6 @@ const EditToken = (props) => {
theme='light' theme='light'
type='tertiary' type='tertiary'
onClick={() => setExpiredTime(0, 1, 0, 0)} onClick={() => setExpiredTime(0, 1, 0, 0)}
className='!rounded-full'
> >
{t('一天')} {t('一天')}
</Button> </Button>
@@ -372,7 +368,6 @@ const EditToken = (props) => {
theme='light' theme='light'
type='tertiary' type='tertiary'
onClick={() => setExpiredTime(0, 0, 1, 0)} onClick={() => setExpiredTime(0, 0, 1, 0)}
className='!rounded-full'
> >
{t('一小时')} {t('一小时')}
</Button> </Button>
@@ -387,6 +382,7 @@ const EditToken = (props) => {
min={1} min={1}
extraText={t('批量创建时会在名称后自动添加随机后缀')} extraText={t('批量创建时会在名称后自动添加随机后缀')}
rules={[{ required: true, message: t('请输入新建数量') }]} rules={[{ required: true, message: t('请输入新建数量') }]}
style={{ width: '100%' }}
/> />
</Col> </Col>
)} )}
@@ -405,7 +401,7 @@ const EditToken = (props) => {
</div> </div>
</div> </div>
<Row gutter={12}> <Row gutter={12}>
<Col span={10}> <Col span={24}>
<Form.AutoComplete <Form.AutoComplete
field='remain_quota' field='remain_quota'
label={t('额度')} label={t('额度')}
@@ -424,15 +420,15 @@ const EditToken = (props) => {
]} ]}
/> />
</Col> </Col>
<Col span={14} className='flex justify-end'> <Col span={24}>
<Form.Switch field='unlimited_quota' label={t('无限额度')} size='large' /> <Form.Switch
field='unlimited_quota'
label={t('无限额度')}
size='large'
extraText={t('令牌的额度仅用于限制令牌本身的最大额度使用量,实际的使用受到账户的剩余额度限制')}
/>
</Col> </Col>
</Row> </Row>
<Banner
type='warning'
description={t('注意,令牌的额度仅用于限制令牌本身的最大额度使用量,实际的使用受到账户的剩余额度限制。')}
className='mb-4 !rounded-lg'
/>
</Card> </Card>
{/* 访问限制 */} {/* 访问限制 */}
@@ -452,8 +448,11 @@ const EditToken = (props) => {
field='allow_ips' field='allow_ips'
label={t('IP白名单')} label={t('IP白名单')}
placeholder={t('允许的IP一行一个不填写则不限制')} placeholder={t('允许的IP一行一个不填写则不限制')}
rows={4} autosize
rows={1}
extraText={t('请勿过度信任此功能IP可能被伪造')} extraText={t('请勿过度信任此功能IP可能被伪造')}
showClear
style={{ width: '100%' }}
/> />
</Col> </Col>
<Col span={24}> <Col span={24}>
@@ -465,6 +464,8 @@ const EditToken = (props) => {
optionList={models} optionList={models}
maxTagCount={3} maxTagCount={3}
extraText={t('非必要,不建议启用模型限制')} extraText={t('非必要,不建议启用模型限制')}
showClear
style={{ width: '100%' }}
/> />
</Col> </Col>
</Row> </Row>

View File

@@ -73,7 +73,6 @@ const AddUser = (props) => {
<Space> <Space>
<Button <Button
theme="solid" theme="solid"
className="!rounded-full"
onClick={() => formApiRef.current?.submitForm()} onClick={() => formApiRef.current?.submitForm()}
icon={<IconSave />} icon={<IconSave />}
loading={loading} loading={loading}
@@ -82,7 +81,6 @@ const AddUser = (props) => {
</Button> </Button>
<Button <Button
theme="light" theme="light"
className="!rounded-full"
type="primary" type="primary"
onClick={handleCancel} onClick={handleCancel}
icon={<IconClose />} icon={<IconClose />}
@@ -106,7 +104,7 @@ const AddUser = (props) => {
formApiRef.current?.scrollToError(); formApiRef.current?.scrollToError();
}} }}
> >
<div className="p-6 space-y-6"> <div className="p-2">
<Card className="!rounded-2xl shadow-sm border-0"> <Card className="!rounded-2xl shadow-sm border-0">
<div className="flex items-center mb-2"> <div className="flex items-center mb-2">
<Avatar size="small" color="blue" className="mr-2 shadow-md"> <Avatar size="small" color="blue" className="mr-2 shadow-md">
@@ -124,13 +122,17 @@ const AddUser = (props) => {
field='username' field='username'
label={t('用户名')} label={t('用户名')}
placeholder={t('请输入用户名')} placeholder={t('请输入用户名')}
rules={[{ required: true, message: t('请输入用户名') }]} /> rules={[{ required: true, message: t('请输入用户名') }]}
showClear
/>
</Col> </Col>
<Col span={24}> <Col span={24}>
<Form.Input <Form.Input
field='display_name' field='display_name'
label={t('显示名称')} label={t('显示名称')}
placeholder={t('请输入显示名称')} /> placeholder={t('请输入显示名称')}
showClear
/>
</Col> </Col>
<Col span={24}> <Col span={24}>
<Form.Input <Form.Input
@@ -138,13 +140,17 @@ const AddUser = (props) => {
label={t('密码')} label={t('密码')}
type='password' type='password'
placeholder={t('请输入密码')} placeholder={t('请输入密码')}
rules={[{ required: true, message: t('请输入密码') }]} /> rules={[{ required: true, message: t('请输入密码') }]}
showClear
/>
</Col> </Col>
<Col span={24}> <Col span={24}>
<Form.Input <Form.Input
field='remark' field='remark'
label={t('备注')} label={t('备注')}
placeholder={t('请输入备注(仅管理员可见)')} /> placeholder={t('请输入备注(仅管理员可见)')}
showClear
/>
</Col> </Col>
</Row> </Row>
</Card> </Card>

View File

@@ -142,7 +142,6 @@ const EditUser = (props) => {
<Space> <Space>
<Button <Button
theme='solid' theme='solid'
className='!rounded-full'
onClick={() => formApiRef.current?.submitForm()} onClick={() => formApiRef.current?.submitForm()}
icon={<IconSave />} icon={<IconSave />}
loading={loading} loading={loading}
@@ -151,7 +150,6 @@ const EditUser = (props) => {
</Button> </Button>
<Button <Button
theme='light' theme='light'
className='!rounded-full'
type='primary' type='primary'
onClick={handleCancel} onClick={handleCancel}
icon={<IconClose />} icon={<IconClose />}
@@ -171,7 +169,7 @@ const EditUser = (props) => {
onSubmit={submit} onSubmit={submit}
> >
{({ values }) => ( {({ values }) => (
<div className='p-6 space-y-6'> <div className='p-2'>
{/* 基本信息 */} {/* 基本信息 */}
<Card className='!rounded-2xl shadow-sm border-0'> <Card className='!rounded-2xl shadow-sm border-0'>
<div className='flex items-center mb-2'> <div className='flex items-center mb-2'>