Skip to content

Commit

Permalink
[Fleet] Fix logs useless rerender (elastic#155305)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet authored Apr 19, 2023
1 parent eda5b15 commit befd429
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import semverCoerce from 'semver/functions/coerce';
import { createStateContainerReactHelpers } from '@kbn/kibana-utils-plugin/public';
import { RedirectAppLinks } from '@kbn/kibana-react-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { LogStream } from '@kbn/infra-plugin/public';
import { LogStream, type LogStreamProps } from '@kbn/infra-plugin/public';

import type { Agent, AgentPolicy } from '../../../../../types';
import { useLink, useStartServices } from '../../../../../hooks';
Expand All @@ -50,6 +50,11 @@ const DatePickerFlexItem = styled(EuiFlexItem)`
max-width: 312px;
`;

const LOG_VIEW_SETTINGS: LogStreamProps['logView'] = {
type: 'log-view-reference',
logViewId: 'default',
};

export interface AgentLogsProps {
agent: Agent;
agentPolicy?: AgentPolicy;
Expand Down Expand Up @@ -350,7 +355,7 @@ export const AgentLogsUI: React.FunctionComponent<AgentLogsProps> = memo(
<EuiFlexItem>
<EuiPanel paddingSize="none" panelRef={logsPanelRef} grow={false}>
<LogStream
logView={{ type: 'log-view-reference', logViewId: 'default' }}
logView={LOG_VIEW_SETTINGS}
height={logPanelHeight}
startTimestamp={dateRangeTimestamps.start}
endTimestamp={dateRangeTimestamps.end}
Expand Down

0 comments on commit befd429

Please sign in to comment.