mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logs Panel: Performance issue while scrolling within panel in safari (#74694)
* adding contain:strict to let browsers know the layout of logs panel can be rendered independently * add new prop to allow LogRow component to contain content
This commit is contained in:
parent
5c31c7096c
commit
4f5728233c
@ -1,3 +1,4 @@
|
|||||||
|
import { cx } from '@emotion/css';
|
||||||
import memoizeOne from 'memoize-one';
|
import memoizeOne from 'memoize-one';
|
||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
|
|
||||||
@ -53,6 +54,11 @@ export interface Props extends Themeable2 {
|
|||||||
isFilterLabelActive?: (key: string, value: string, refId?: string) => Promise<boolean>;
|
isFilterLabelActive?: (key: string, value: string, refId?: string) => Promise<boolean>;
|
||||||
pinnedRowId?: string;
|
pinnedRowId?: string;
|
||||||
containerRendered?: boolean;
|
containerRendered?: boolean;
|
||||||
|
/**
|
||||||
|
* If false or undefined, the `contain:strict` css property will be added to the wrapping `<table>` for performance reasons.
|
||||||
|
* Any overflowing content will be clipped at the table boundary.
|
||||||
|
*/
|
||||||
|
overflowingContent?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
@ -128,7 +134,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
|
|||||||
const keyMaker = new UniqueKeyMaker();
|
const keyMaker = new UniqueKeyMaker();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<table className={styles.logsRowsTable}>
|
<table className={cx(styles.logsRowsTable, this.props.overflowingContent ? '' : styles.logsRowsTableContain)}>
|
||||||
<tbody>
|
<tbody>
|
||||||
{hasData &&
|
{hasData &&
|
||||||
firstRows.map((row) => (
|
firstRows.map((row) => (
|
||||||
|
@ -74,6 +74,9 @@ export const getLogRowStyles = memoizeOne((theme: GrafanaTheme2) => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
${!scrollableLogsContainer && `margin-bottom: ${theme.spacing(2.25)};`}
|
${!scrollableLogsContainer && `margin-bottom: ${theme.spacing(2.25)};`}
|
||||||
`,
|
`,
|
||||||
|
logsRowsTableContain: css`
|
||||||
|
contain: strict;
|
||||||
|
`,
|
||||||
highlightBackground: css`
|
highlightBackground: css`
|
||||||
background-color: ${tinycolor(theme.colors.info.transparent).setAlpha(0.25).toString()};
|
background-color: ${tinycolor(theme.colors.info.transparent).setAlpha(0.25).toString()};
|
||||||
`,
|
`,
|
||||||
|
@ -552,6 +552,7 @@ export const LogRowContextModal: React.FunctionComponent<LogRowContextModalProps
|
|||||||
onUnpinLine={() => setSticky(false)}
|
onUnpinLine={() => setSticky(false)}
|
||||||
onPinLine={() => setSticky(true)}
|
onPinLine={() => setSticky(true)}
|
||||||
pinnedRowId={sticky ? row.uid : undefined}
|
pinnedRowId={sticky ? row.uid : undefined}
|
||||||
|
overflowingContent={true}
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user