mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-12-27 07:34:12 +08:00
feat(logs): fixes #194
This commit is contained in:
parent
e935aedfcf
commit
b000f919fc
@ -34,17 +34,32 @@ export default () => {
|
||||
|
||||
const columns: ColumnDef<LogWithSeq>[] = [
|
||||
{
|
||||
accessorKey: 'Sequence',
|
||||
header: t('sequence'),
|
||||
accessorFn: (row) => row.seq,
|
||||
},
|
||||
{
|
||||
accessorKey: 'Type',
|
||||
header: t('type'),
|
||||
accessorFn: (row) => row.type,
|
||||
cell: ({ row }) => {
|
||||
const type = row.original.type
|
||||
|
||||
let className = ''
|
||||
|
||||
switch (type) {
|
||||
case 'error':
|
||||
className = 'text-error'
|
||||
break
|
||||
case 'warning':
|
||||
className = 'text-warning'
|
||||
break
|
||||
case 'info':
|
||||
className = 'text-info'
|
||||
break
|
||||
}
|
||||
|
||||
return <span class={className}>{`[${row.original.type}]`}</span>
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorKey: 'Payload',
|
||||
header: t('payload'),
|
||||
accessorFn: (row) => row.payload,
|
||||
},
|
||||
|
2
src/types/index.d.ts
vendored
2
src/types/index.d.ts
vendored
@ -106,7 +106,7 @@ export type Connection = ConnectionRawMessage & {
|
||||
}
|
||||
|
||||
export type Log = {
|
||||
type: string
|
||||
type: 'error' | 'warning' | 'info' | 'debug' | 'silent'
|
||||
payload: string
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user