Commit d9d84f45 by Erik Sundell

only make it possible to scan for older logs if there is at least one non failing selector

parent 5641f453
......@@ -836,6 +836,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
const graphLoading = queryTransactions.some(qt => qt.resultType === 'Graph' && !qt.done);
const tableLoading = queryTransactions.some(qt => qt.resultType === 'Table' && !qt.done);
const logsLoading = queryTransactions.some(qt => qt.resultType === 'Logs' && !qt.done);
const logExpressionExists = queryTransactions.some(qt => qt.resultType === 'Logs' && qt.query.expr && !qt.error);
const loading = queryTransactions.some(qt => !qt.done);
return (
......@@ -969,6 +970,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
range={range}
scanning={scanning}
scanRange={scanRange}
logExpressionExists={logExpressionExists}
/>
</Panel>
)}
......
......@@ -140,6 +140,7 @@ interface LogsProps {
range?: RawTimeRange;
scanning?: boolean;
scanRange?: RawTimeRange;
logExpressionExists?: boolean;
onChangeTime?: (range: RawTimeRange) => void;
onClickLabel?: (label: string, value: string) => void;
onStartScanning?: () => void;
......@@ -239,7 +240,17 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
};
render() {
const { className = '', data, loading = false, onClickLabel, position, range, scanning, scanRange } = this.props;
const {
className = '',
data,
loading = false,
onClickLabel,
position,
range,
scanning,
scanRange,
logExpressionExists,
} = this.props;
const { dedup, deferLogs, hiddenLogLevels, renderAll, showLocalTime, showUtc } = this.state;
let { showLabels } = this.state;
const hasData = data && data.rows && data.rows.length > 0;
......@@ -357,7 +368,8 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
))}
{hasData && deferLogs && <span>Rendering {dedupedData.rows.length} rows...</span>}
</div>
{!loading &&
{logExpressionExists &&
!loading &&
!hasData &&
!scanning && (
<div className="logs-nodata">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment