diff --git a/web/src/constants/SnackbarConstants.js b/web/src/constants/SnackbarConstants.js index 0b84b764..05f79231 100644 --- a/web/src/constants/SnackbarConstants.js +++ b/web/src/constants/SnackbarConstants.js @@ -1,35 +1,56 @@ +import { closeSnackbar } from 'notistack'; +import { IconX } from '@tabler/icons-react'; +import { IconButton } from '@mui/material'; +const action = (snackbarId) => ( + <> + { + closeSnackbar(snackbarId); + }} + > + + + +); + 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: { diff --git a/web/src/views/Log/component/TableRow.js b/web/src/views/Log/component/TableRow.js index 3ba20bfb..212b7189 100644 --- a/web/src/views/Log/component/TableRow.js +++ b/web/src/views/Log/component/TableRow.js @@ -70,7 +70,7 @@ export default function LogTableRow({ item, userIsAdmin }) { {timestamp2string(item.created_at)} - {userIsAdmin && {(item.channel_id || '') + '(' + (item.channel?.name || '未知') + ')'}} + {userIsAdmin && {(item.channel_id || '') + ' ' + (item.channel?.name ? '(' + item.channel.name + ')' : '')}} {userIsAdmin && (