|
|
@ -1,6 +1,7 @@ |
|
|
|
import React, { PureComponent } from 'react'; |
|
|
|
import React, { PureComponent } from 'react'; |
|
|
|
import { css } from 'emotion'; |
|
|
|
import { css } from 'emotion'; |
|
|
|
import { capitalize } from 'lodash'; |
|
|
|
import { capitalize } from 'lodash'; |
|
|
|
|
|
|
|
import memoizeOne from 'memoize-one'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
|
rangeUtil, |
|
|
|
rangeUtil, |
|
|
@ -91,7 +92,6 @@ interface State { |
|
|
|
logsSortOrder: LogsSortOrder | null; |
|
|
|
logsSortOrder: LogsSortOrder | null; |
|
|
|
isFlipping: boolean; |
|
|
|
isFlipping: boolean; |
|
|
|
showDetectedFields: string[]; |
|
|
|
showDetectedFields: string[]; |
|
|
|
hasUnescapedContent: boolean; |
|
|
|
|
|
|
|
forceEscape: boolean; |
|
|
|
forceEscape: boolean; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -106,7 +106,6 @@ export class UnthemedLogs extends PureComponent<Props, State> { |
|
|
|
logsSortOrder: null, |
|
|
|
logsSortOrder: null, |
|
|
|
isFlipping: false, |
|
|
|
isFlipping: false, |
|
|
|
showDetectedFields: [], |
|
|
|
showDetectedFields: [], |
|
|
|
hasUnescapedContent: this.props.logRows.some((r) => r.hasUnescapedContent), |
|
|
|
|
|
|
|
forceEscape: false, |
|
|
|
forceEscape: false, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -226,6 +225,10 @@ export class UnthemedLogs extends PureComponent<Props, State> { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkUnescapedContent = memoizeOne((logRows: LogRowModel[]) => { |
|
|
|
|
|
|
|
return !!logRows.some((r) => r.hasUnescapedContent); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const { |
|
|
|
const { |
|
|
|
logRows, |
|
|
|
logRows, |
|
|
@ -256,7 +259,6 @@ export class UnthemedLogs extends PureComponent<Props, State> { |
|
|
|
logsSortOrder, |
|
|
|
logsSortOrder, |
|
|
|
isFlipping, |
|
|
|
isFlipping, |
|
|
|
showDetectedFields, |
|
|
|
showDetectedFields, |
|
|
|
hasUnescapedContent, |
|
|
|
|
|
|
|
forceEscape, |
|
|
|
forceEscape, |
|
|
|
} = this.state; |
|
|
|
} = this.state; |
|
|
|
|
|
|
|
|
|
|
@ -285,6 +287,7 @@ export class UnthemedLogs extends PureComponent<Props, State> { |
|
|
|
const scanText = scanRange ? `Scanning ${rangeUtil.describeTimeRange(scanRange)}` : 'Scanning...'; |
|
|
|
const scanText = scanRange ? `Scanning ${rangeUtil.describeTimeRange(scanRange)}` : 'Scanning...'; |
|
|
|
const series = logsSeries ? logsSeries : []; |
|
|
|
const series = logsSeries ? logsSeries : []; |
|
|
|
const styles = getStyles(theme); |
|
|
|
const styles = getStyles(theme); |
|
|
|
|
|
|
|
const hasUnescapedContent = this.checkUnescapedContent(logRows); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|