🔖 chore: Optimize tips and display the name of the log channel.(#199)
This commit is contained in:
parent
df3b197b4b
commit
9bb90df5c1
@ -1,35 +1,56 @@
|
||||
import { closeSnackbar } from 'notistack';
|
||||
import { IconX } from '@tabler/icons-react';
|
||||
import { IconButton } from '@mui/material';
|
||||
const action = (snackbarId) => (
|
||||
<>
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
closeSnackbar(snackbarId);
|
||||
}}
|
||||
>
|
||||
<IconX stroke={1.5} size="1.25rem" />
|
||||
</IconButton>
|
||||
</>
|
||||
);
|
||||
|
||||
export const snackbarConstants = {
|
||||
Common: {
|
||||
ERROR: {
|
||||
variant: 'error',
|
||||
autoHideDuration: 5000,
|
||||
preventDuplicate: true
|
||||
preventDuplicate: true,
|
||||
action
|
||||
},
|
||||
WARNING: {
|
||||
variant: 'warning',
|
||||
autoHideDuration: 10000,
|
||||
preventDuplicate: true
|
||||
preventDuplicate: true,
|
||||
action
|
||||
},
|
||||
SUCCESS: {
|
||||
variant: 'success',
|
||||
autoHideDuration: 1500,
|
||||
preventDuplicate: true
|
||||
preventDuplicate: true,
|
||||
action
|
||||
},
|
||||
INFO: {
|
||||
variant: 'info',
|
||||
autoHideDuration: 3000,
|
||||
preventDuplicate: true
|
||||
preventDuplicate: true,
|
||||
action
|
||||
},
|
||||
NOTICE: {
|
||||
variant: 'info',
|
||||
autoHideDuration: 20000,
|
||||
preventDuplicate: true
|
||||
preventDuplicate: true,
|
||||
action
|
||||
},
|
||||
COPY: {
|
||||
variant: 'copy',
|
||||
persist: true,
|
||||
preventDuplicate: true,
|
||||
allowDownload: true
|
||||
allowDownload: true,
|
||||
action
|
||||
}
|
||||
},
|
||||
Mobile: {
|
||||
|
@ -70,7 +70,7 @@ export default function LogTableRow({ item, userIsAdmin }) {
|
||||
<TableRow tabIndex={item.id}>
|
||||
<TableCell>{timestamp2string(item.created_at)}</TableCell>
|
||||
|
||||
{userIsAdmin && <TableCell>{(item.channel_id || '') + '(' + (item.channel?.name || '未知') + ')'}</TableCell>}
|
||||
{userIsAdmin && <TableCell>{(item.channel_id || '') + ' ' + (item.channel?.name ? '(' + item.channel.name + ')' : '')}</TableCell>}
|
||||
{userIsAdmin && (
|
||||
<TableCell>
|
||||
<Label color="default" variant="outlined">
|
||||
|
Loading…
Reference in New Issue
Block a user