Преглед на файлове

remove all query empty related code. root cause of the problem was to fix hasNonEmptyQuery

Erik Sundell преди 7 години
родител
ревизия
9c8bd34787
променени са 2 файла, в които са добавени 2 реда и са изтрити 15 реда
  1. 0 2
      public/app/features/explore/Explore.tsx
  2. 2 13
      public/app/features/explore/Logs.tsx

+ 0 - 2
public/app/features/explore/Explore.tsx

@@ -840,7 +840,6 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
     const tableLoading = queryTransactions.some(qt => qt.resultType === 'Table' && !qt.done);
     const logsLoading = queryTransactions.some(qt => qt.resultType === 'Logs' && !qt.done);
     const loading = queryTransactions.some(qt => !qt.done);
-    const queryEmpty = queryTransactions.some(qt => qt.resultType === 'Logs' && qt.done && qt.result.length === 0);
 
     return (
       <div className={exploreClass} ref={this.getRef}>
@@ -973,7 +972,6 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
                           range={range}
                           scanning={scanning}
                           scanRange={scanRange}
-                          queryEmpty={queryEmpty}
                         />
                       </Panel>
                     )}

+ 2 - 13
public/app/features/explore/Logs.tsx

@@ -140,7 +140,6 @@ interface LogsProps {
   range?: RawTimeRange;
   scanning?: boolean;
   scanRange?: RawTimeRange;
-  queryEmpty: boolean;
   onChangeTime?: (range: RawTimeRange) => void;
   onClickLabel?: (label: string, value: string) => void;
   onStartScanning?: () => void;
@@ -240,17 +239,7 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
   };
 
   render() {
-    const {
-      className = '',
-      data,
-      loading = false,
-      onClickLabel,
-      position,
-      range,
-      scanning,
-      scanRange,
-      queryEmpty,
-    } = this.props;
+    const { className = '', data, loading = false, onClickLabel, position, range, scanning, scanRange } = this.props;
     const { dedup, deferLogs, hiddenLogLevels, renderAll, showLocalTime, showUtc } = this.state;
     let { showLabels } = this.state;
     const hasData = data && data.rows && data.rows.length > 0;
@@ -369,7 +358,7 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
           {hasData && deferLogs && <span>Rendering {dedupedData.rows.length} rows...</span>}
         </div>
         {!loading &&
-          queryEmpty &&
+          !hasData &&
           !scanning && (
             <div className="logs-nodata">
               No logs found.