mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 09:16:36 +08:00
chore: make buttons tiny
This commit is contained in:
parent
d0965050a9
commit
a01d769a83
@ -325,7 +325,9 @@ const ChannelsTable = () => {
|
||||
newChannels[realIdx].response_time = time * 1000;
|
||||
newChannels[realIdx].test_time = Date.now() / 1000;
|
||||
setChannels(newChannels);
|
||||
showSuccess(t('channel.messages.test_success', { name, model, time, message }));
|
||||
showSuccess(
|
||||
t('channel.messages.test_success', { name, model, time, message })
|
||||
);
|
||||
} else {
|
||||
showError(message);
|
||||
}
|
||||
@ -350,7 +352,9 @@ const ChannelsTable = () => {
|
||||
const res = await API.delete(`/api/channel/disabled`);
|
||||
const { success, message, data } = res.data;
|
||||
if (success) {
|
||||
showSuccess(t('channel.messages.delete_disabled_success', { count: data }));
|
||||
showSuccess(
|
||||
t('channel.messages.delete_disabled_success', { count: data })
|
||||
);
|
||||
await refresh();
|
||||
} else {
|
||||
showError(message);
|
||||
@ -591,7 +595,7 @@ const ChannelsTable = () => {
|
||||
<Table.Cell>
|
||||
<div>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
positive
|
||||
onClick={() => {
|
||||
testChannel(
|
||||
@ -606,7 +610,7 @@ const ChannelsTable = () => {
|
||||
</Button>
|
||||
<Popup
|
||||
trigger={
|
||||
<Button size='small' negative>
|
||||
<Button size='tiny' negative>
|
||||
{t('channel.buttons.delete')}
|
||||
</Button>
|
||||
}
|
||||
@ -615,6 +619,7 @@ const ChannelsTable = () => {
|
||||
hoverable
|
||||
>
|
||||
<Button
|
||||
size={'tiny'}
|
||||
negative
|
||||
onClick={() => {
|
||||
manageChannel(channel.id, 'delete', idx);
|
||||
@ -624,7 +629,7 @@ const ChannelsTable = () => {
|
||||
</Button>
|
||||
</Popup>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
onClick={() => {
|
||||
manageChannel(
|
||||
channel.id,
|
||||
@ -638,7 +643,7 @@ const ChannelsTable = () => {
|
||||
: t('channel.buttons.enable')}
|
||||
</Button>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
as={Link}
|
||||
to={'/channel/edit/' + channel.id}
|
||||
>
|
||||
@ -654,16 +659,11 @@ const ChannelsTable = () => {
|
||||
<Table.Footer>
|
||||
<Table.Row>
|
||||
<Table.HeaderCell colSpan={showDetail ? '10' : '8'}>
|
||||
<Button
|
||||
size='small'
|
||||
as={Link}
|
||||
to='/channel/add'
|
||||
loading={loading}
|
||||
>
|
||||
<Button size='tiny' as={Link} to='/channel/add' loading={loading}>
|
||||
{t('channel.buttons.add')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
size='tiny'
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
testChannels('all');
|
||||
@ -672,7 +672,7 @@ const ChannelsTable = () => {
|
||||
{t('channel.buttons.test_all')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
size='tiny'
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
testChannels('disabled');
|
||||
@ -682,7 +682,7 @@ const ChannelsTable = () => {
|
||||
</Button>
|
||||
<Popup
|
||||
trigger={
|
||||
<Button size='small' loading={loading}>
|
||||
<Button size='tiny' loading={loading}>
|
||||
{t('channel.buttons.delete_disabled')}
|
||||
</Button>
|
||||
}
|
||||
@ -691,7 +691,7 @@ const ChannelsTable = () => {
|
||||
hoverable
|
||||
>
|
||||
<Button
|
||||
size='small'
|
||||
size='tiny'
|
||||
loading={loading}
|
||||
negative
|
||||
onClick={deleteAllDisabledChannels}
|
||||
@ -703,17 +703,17 @@ const ChannelsTable = () => {
|
||||
floated='right'
|
||||
activePage={activePage}
|
||||
onPageChange={onPaginationChange}
|
||||
size='small'
|
||||
size='tiny'
|
||||
siblingRange={1}
|
||||
totalPages={
|
||||
Math.ceil(channels.length / ITEMS_PER_PAGE) +
|
||||
(channels.length % ITEMS_PER_PAGE === 0 ? 1 : 0)
|
||||
}
|
||||
/>
|
||||
<Button size='small' onClick={refresh} loading={loading}>
|
||||
<Button size='tiny' onClick={refresh} loading={loading}>
|
||||
{t('channel.buttons.refresh')}
|
||||
</Button>
|
||||
<Button size='small' onClick={toggleShowDetail}>
|
||||
<Button size='tiny' onClick={toggleShowDetail}>
|
||||
{showDetail
|
||||
? t('channel.buttons.hide_detail')
|
||||
: t('channel.buttons.show_detail')}
|
||||
|
@ -278,7 +278,7 @@ const RedemptionsTable = () => {
|
||||
<Table.Cell>
|
||||
<div>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
positive
|
||||
onClick={async () => {
|
||||
if (await copy(redemption.key)) {
|
||||
@ -293,7 +293,7 @@ const RedemptionsTable = () => {
|
||||
</Button>
|
||||
<Popup
|
||||
trigger={
|
||||
<Button size='small' negative>
|
||||
<Button size='tiny' negative>
|
||||
{t('redemption.buttons.delete')}
|
||||
</Button>
|
||||
}
|
||||
@ -311,7 +311,7 @@ const RedemptionsTable = () => {
|
||||
</Button>
|
||||
</Popup>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
disabled={redemption.status === 3} // used
|
||||
onClick={() => {
|
||||
manageRedemption(
|
||||
@ -326,7 +326,7 @@ const RedemptionsTable = () => {
|
||||
: t('redemption.buttons.enable')}
|
||||
</Button>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
as={Link}
|
||||
to={'/redemption/edit/' + redemption.id}
|
||||
>
|
||||
@ -342,7 +342,12 @@ const RedemptionsTable = () => {
|
||||
<Table.Footer>
|
||||
<Table.Row>
|
||||
<Table.HeaderCell colSpan='7'>
|
||||
<Button size='small' as={Link} to='/redemption/add' loading={loading}>
|
||||
<Button
|
||||
size='small'
|
||||
as={Link}
|
||||
to='/redemption/add'
|
||||
loading={loading}
|
||||
>
|
||||
{t('redemption.buttons.add')}
|
||||
</Button>
|
||||
<Button size='small' onClick={refresh} loading={loading}>
|
||||
|
@ -415,9 +415,9 @@ const TokensTable = () => {
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
<div>
|
||||
<Button.Group color='green' size={'small'}>
|
||||
<Button.Group color='green' size={'mini'}>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'mini'}
|
||||
positive
|
||||
onClick={async () => await onCopy('', token.key)}
|
||||
>
|
||||
@ -430,9 +430,9 @@ const TokensTable = () => {
|
||||
trigger={<></>}
|
||||
/>
|
||||
</Button.Group>{' '}
|
||||
<Button.Group color='blue' size={'small'}>
|
||||
<Button.Group color='blue' size={'mini'}>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'mini'}
|
||||
positive
|
||||
onClick={() => onOpenLink('', token.key)}
|
||||
>
|
||||
@ -447,7 +447,7 @@ const TokensTable = () => {
|
||||
</Button.Group>{' '}
|
||||
<Popup
|
||||
trigger={
|
||||
<Button size='small' negative>
|
||||
<Button size='mini' negative>
|
||||
{t('token.buttons.delete')}
|
||||
</Button>
|
||||
}
|
||||
@ -456,6 +456,7 @@ const TokensTable = () => {
|
||||
hoverable
|
||||
>
|
||||
<Button
|
||||
size={'mini'}
|
||||
negative
|
||||
onClick={() => {
|
||||
manageToken(token.id, 'delete', idx);
|
||||
@ -465,7 +466,7 @@ const TokensTable = () => {
|
||||
</Button>
|
||||
</Popup>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'mini'}
|
||||
onClick={() => {
|
||||
manageToken(
|
||||
token.id,
|
||||
@ -479,7 +480,7 @@ const TokensTable = () => {
|
||||
: t('token.buttons.enable')}
|
||||
</Button>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'mini'}
|
||||
as={Link}
|
||||
to={'/token/edit/' + token.id}
|
||||
>
|
||||
|
@ -292,7 +292,7 @@ const UsersTable = () => {
|
||||
<Table.Cell>
|
||||
<div>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
positive
|
||||
onClick={() => {
|
||||
manageUser(user.username, 'promote', idx);
|
||||
@ -302,7 +302,7 @@ const UsersTable = () => {
|
||||
{t('user.buttons.promote')}
|
||||
</Button>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
color={'yellow'}
|
||||
onClick={() => {
|
||||
manageUser(user.username, 'demote', idx);
|
||||
@ -314,7 +314,7 @@ const UsersTable = () => {
|
||||
<Popup
|
||||
trigger={
|
||||
<Button
|
||||
size='small'
|
||||
size='tiny'
|
||||
negative
|
||||
disabled={user.role === 100}
|
||||
>
|
||||
@ -327,6 +327,7 @@ const UsersTable = () => {
|
||||
>
|
||||
<Button
|
||||
negative
|
||||
size={'tiny'}
|
||||
onClick={() => {
|
||||
manageUser(user.username, 'delete', idx);
|
||||
}}
|
||||
@ -335,7 +336,7 @@ const UsersTable = () => {
|
||||
</Button>
|
||||
</Popup>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
onClick={() => {
|
||||
manageUser(
|
||||
user.username,
|
||||
@ -350,7 +351,7 @@ const UsersTable = () => {
|
||||
: t('user.buttons.enable')}
|
||||
</Button>
|
||||
<Button
|
||||
size={'small'}
|
||||
size={'tiny'}
|
||||
as={Link}
|
||||
to={'/user/edit/' + user.id}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user