| 1234567891011121314151617181920212223242526272829303132 |
- import { Column } from 'react-data-grid'
- import { TimestampInfo } from 'ui-patterns/TimestampInfo'
- import type { LogData } from '../Logs.types'
- import { extractEdgeFunctionName } from '../Logs.utils'
- import { ResponseCodeFormatter, RowLayout, TextFormatter } from '../LogsFormatters'
- import { defaultRenderCell } from './DefaultPreviewColumnRenderer'
- const columns: Column<LogData>[] = [
- {
- name: 'functions-edge-first-column',
- key: 'functions-edge-first-column',
- renderHeaderCell: () => null,
- renderCell: (props) => {
- if (!props.row.status_code && !props.row.method) {
- return defaultRenderCell(props)
- }
- const functionName = extractEdgeFunctionName(props.row.pathname)
- return (
- <RowLayout>
- <TimestampInfo utcTimestamp={props.row.timestamp!} />
- <ResponseCodeFormatter value={String(props.row.status_code)} />
- <TextFormatter value={String(props.row.method)} />
- {functionName && <TextFormatter value={functionName} />}
- <TextFormatter value={String(props.row.id)} />
- </RowLayout>
- )
- },
- },
- ]
- export default columns
|