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