Skip to content

Commit

Permalink
Set a minimum height for agent logs component elastic#89831
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Feb 17, 2021
1 parent b7f79b5 commit b12bf61
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ export const AgentLogsUI: React.FunctionComponent<AgentLogsProps> = memo(({ agen
[http.basePath, state.start, state.end, logStreamQuery]
);

const [logsPanelRef, { height: logPanelHeight }] = useMeasure<HTMLDivElement>();

const agentVersion = agent.local_metadata?.elastic?.agent?.version;
const isLogFeatureAvailable = useMemo(() => {
if (!agentVersion) {
Expand All @@ -199,6 +197,13 @@ export const AgentLogsUI: React.FunctionComponent<AgentLogsProps> = memo(({ agen
return semverGte(agentVersionWithPrerelease, '7.11.0');
}, [agentVersion]);

// Set absolute height on logs component (needed to render correctly in Safari)
// based on available height, or 600px, whichever is greater
const [logsPanelRef, { height: measuredlogPanelHeight }] = useMeasure<HTMLDivElement>();
const logPanelHeight = useMemo(() => Math.max(measuredlogPanelHeight, 600), [
measuredlogPanelHeight,
]);

if (!isLogFeatureAvailable) {
return (
<EuiCallOut
Expand Down

0 comments on commit b12bf61

Please sign in to comment.