Hide wallet name in logs for only a single wallet (#1305)
This commit is contained in:
parent
ec2383b998
commit
3cd9991aa9
|
@ -1,13 +1,13 @@
|
|||
import { timeSince } from '@/lib/time'
|
||||
import styles from './log-message.module.css'
|
||||
|
||||
export default function LogMessage ({ wallet, level, message, ts }) {
|
||||
export default function LogMessage ({ showWallet, wallet, level, message, ts }) {
|
||||
level = level.toLowerCase()
|
||||
const levelClassName = ['ok', 'success'].includes(level) ? 'text-success' : level === 'error' ? 'text-danger' : level === 'info' ? 'text-info' : ''
|
||||
return (
|
||||
<tr className={styles.line}>
|
||||
<td className={styles.timestamp}>{timeSince(new Date(ts))}</td>
|
||||
<td className={styles.wallet}>[{wallet}]</td>
|
||||
{showWallet ? <td className={styles.wallet}>[{wallet}]</td> : <td className='mx-1' />}
|
||||
<td className={`${styles.level} ${levelClassName}`}>{level === 'success' ? 'ok' : level}</td>
|
||||
<td>{message}</td>
|
||||
</tr>
|
||||
|
|
|
@ -30,7 +30,13 @@ export function WalletLogs ({ wallet, embedded }) {
|
|||
{logs.length === 0 && <div className='w-100 text-center'>empty</div>}
|
||||
<table>
|
||||
<tbody>
|
||||
{logs.map((log, i) => <LogMessage key={i} {...log} />)}
|
||||
{logs.map((log, i) => (
|
||||
<LogMessage
|
||||
key={i}
|
||||
showWallet={!wallet}
|
||||
{...log}
|
||||
/>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<div className='w-100 text-center'>------ start of logs ------</div>
|
||||
|
|
Loading…
Reference in New Issue