|
@@ -56,13 +56,13 @@ const FieldHighlight = onClick => props => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
interface RowProps {
|
|
interface RowProps {
|
|
|
- allRows: LogRow[];
|
|
|
|
|
highlighterExpressions?: string[];
|
|
highlighterExpressions?: string[];
|
|
|
row: LogRow;
|
|
row: LogRow;
|
|
|
showDuplicates: boolean;
|
|
showDuplicates: boolean;
|
|
|
showLabels: boolean | null; // Tristate: null means auto
|
|
showLabels: boolean | null; // Tristate: null means auto
|
|
|
showLocalTime: boolean;
|
|
showLocalTime: boolean;
|
|
|
showUtc: boolean;
|
|
showUtc: boolean;
|
|
|
|
|
+ getRows: () => LogRow[];
|
|
|
onClickLabel?: (label: string, value: string) => void;
|
|
onClickLabel?: (label: string, value: string) => void;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -107,11 +107,12 @@ class Row extends PureComponent<RowProps, RowState> {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
onClickHighlight = (fieldText: string) => {
|
|
onClickHighlight = (fieldText: string) => {
|
|
|
- const { allRows } = this.props;
|
|
|
|
|
|
|
+ const { getRows } = this.props;
|
|
|
const { parser } = this.state;
|
|
const { parser } = this.state;
|
|
|
|
|
|
|
|
const fieldMatch = fieldText.match(parser.fieldRegex);
|
|
const fieldMatch = fieldText.match(parser.fieldRegex);
|
|
|
if (fieldMatch) {
|
|
if (fieldMatch) {
|
|
|
|
|
+ const allRows = getRows();
|
|
|
// Build value-agnostic row matcher based on the field label
|
|
// Build value-agnostic row matcher based on the field label
|
|
|
const fieldLabel = fieldMatch[1];
|
|
const fieldLabel = fieldMatch[1];
|
|
|
const fieldValue = fieldMatch[2];
|
|
const fieldValue = fieldMatch[2];
|
|
@@ -151,7 +152,7 @@ class Row extends PureComponent<RowProps, RowState> {
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
const {
|
|
const {
|
|
|
- allRows,
|
|
|
|
|
|
|
+ getRows,
|
|
|
highlighterExpressions,
|
|
highlighterExpressions,
|
|
|
onClickLabel,
|
|
onClickLabel,
|
|
|
row,
|
|
row,
|
|
@@ -193,7 +194,7 @@ class Row extends PureComponent<RowProps, RowState> {
|
|
|
)}
|
|
)}
|
|
|
{showLabels && (
|
|
{showLabels && (
|
|
|
<div className="logs-row__labels">
|
|
<div className="logs-row__labels">
|
|
|
- <LogLabels allRows={allRows} labels={row.uniqueLabels} onClickLabel={onClickLabel} />
|
|
|
|
|
|
|
+ <LogLabels getRows={getRows} labels={row.uniqueLabels} onClickLabel={onClickLabel} />
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
|
<div className="logs-row__message" onMouseEnter={this.onMouseOverMessage} onMouseLeave={this.onMouseOutMessage}>
|
|
<div className="logs-row__message" onMouseEnter={this.onMouseOverMessage} onMouseLeave={this.onMouseOutMessage}>
|
|
@@ -416,6 +417,9 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
|
|
|
|
|
|
|
|
const scanText = scanRange ? `Scanning ${rangeUtil.describeTimeRange(scanRange)}` : 'Scanning...';
|
|
const scanText = scanRange ? `Scanning ${rangeUtil.describeTimeRange(scanRange)}` : 'Scanning...';
|
|
|
|
|
|
|
|
|
|
+ // React profiler becomes unusable if we pass all rows to all rows and their labels, using getter instead
|
|
|
|
|
+ const getRows = () => processedRows;
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div className="logs-panel">
|
|
<div className="logs-panel">
|
|
|
<div className="logs-panel-graph">
|
|
<div className="logs-panel-graph">
|
|
@@ -473,7 +477,7 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
|
|
|
firstRows.map(row => (
|
|
firstRows.map(row => (
|
|
|
<Row
|
|
<Row
|
|
|
key={row.key + row.duplicates}
|
|
key={row.key + row.duplicates}
|
|
|
- allRows={processedRows}
|
|
|
|
|
|
|
+ getRows={getRows}
|
|
|
highlighterExpressions={highlighterExpressions}
|
|
highlighterExpressions={highlighterExpressions}
|
|
|
row={row}
|
|
row={row}
|
|
|
showDuplicates={showDuplicates}
|
|
showDuplicates={showDuplicates}
|
|
@@ -489,7 +493,7 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
|
|
|
lastRows.map(row => (
|
|
lastRows.map(row => (
|
|
|
<Row
|
|
<Row
|
|
|
key={row.key + row.duplicates}
|
|
key={row.key + row.duplicates}
|
|
|
- allRows={processedRows}
|
|
|
|
|
|
|
+ getRows={getRows}
|
|
|
row={row}
|
|
row={row}
|
|
|
showDuplicates={showDuplicates}
|
|
showDuplicates={showDuplicates}
|
|
|
showLabels={showLabels}
|
|
showLabels={showLabels}
|