Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React, { FC } from 'react';

import { EuiSpacer, EuiBasicTable } from '@elastic/eui';
import { EuiSpacer, EuiInMemoryTable } from '@elastic/eui';
// @ts-ignore
import { formatDate } from '@elastic/eui/lib/services/format';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -35,11 +35,13 @@ export const JobMessages: FC<JobMessagesProps> = ({ messages, loading, error })
width: `${theme.euiSizeL}`,
},
{
field: 'timestamp',
name: i18n.translate('xpack.ml.jobMessages.timeLabel', {
defaultMessage: 'Time',
}),
render: (message: any) => formatDate(message.timestamp, TIME_FORMAT),
render: (timestamp: number) => formatDate(timestamp, TIME_FORMAT),
width: '120px',
sortable: true,
},
{
field: 'node_name',
Expand All @@ -57,13 +59,22 @@ export const JobMessages: FC<JobMessagesProps> = ({ messages, loading, error })
},
];

const defaultSorting = {
sort: {
field: 'timestamp',
direction: 'asc',
},
};

return (
<>
<EuiSpacer size="s" />
<EuiBasicTable
<EuiInMemoryTable
className="job-messages-table"
items={messages}
columns={columns}
sorting={defaultSorting}
// @ts-ignore
compressed={true}
loading={loading}
error={error}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function jobAuditMessagesProvider(callWithRequest) {
body:
{
sort: [
{ timestamp: { order: 'asc' } },
{ timestamp: { order: 'desc' } },
{ job_id: { order: 'asc' } }
],
query
Expand Down