Explorar o código

Merge pull request #15352 from grafana/fixed-missing-graph-time-axis

Fixed missing time axis on graph due to width not being passed
Torkel Ödegaard %!s(int64=6) %!d(string=hai) anos
pai
achega
ba2f698b81

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

@@ -220,6 +220,7 @@ export class Explore extends React.PureComponent<ExploreProps> {
                             {supportsTable && <TableContainer exploreId={exploreId} onClickCell={this.onClickLabel} />}
                             {supportsLogs && (
                               <LogsContainer
+                                width={width}
                                 exploreId={exploreId}
                                 onChangeTime={this.onChangeTime}
                                 onClickLabel={this.onClickLabel}

+ 3 - 0
public/app/features/explore/Logs.tsx

@@ -51,6 +51,7 @@ function renderMetaItem(value: any, kind: LogsMetaKind) {
 
 interface Props {
   data?: LogsModel;
+  width: number;
   exploreId: string;
   highlighterExpressions: string[];
   loading: boolean;
@@ -165,6 +166,7 @@ export default class Logs extends PureComponent<Props, State> {
       range,
       scanning,
       scanRange,
+      width,
     } = this.props;
 
     if (!data) {
@@ -215,6 +217,7 @@ export default class Logs extends PureComponent<Props, State> {
           <Graph
             data={timeSeries}
             height={100}
+            width={width}
             range={range}
             id={`explore-logs-graph-${exploreId}`}
             onChangeTime={this.props.onChangeTime}

+ 3 - 0
public/app/features/explore/LogsContainer.tsx

@@ -25,6 +25,7 @@ interface LogsContainerProps {
   scanRange?: RawTimeRange;
   showingLogs: boolean;
   toggleLogs: typeof toggleLogs;
+  width: number;
 }
 
 export class LogsContainer extends PureComponent<LogsContainerProps> {
@@ -46,6 +47,7 @@ export class LogsContainer extends PureComponent<LogsContainerProps> {
       showingLogs,
       scanning,
       scanRange,
+      width,
     } = this.props;
 
     return (
@@ -63,6 +65,7 @@ export class LogsContainer extends PureComponent<LogsContainerProps> {
           range={range}
           scanning={scanning}
           scanRange={scanRange}
+          width={width}
         />
       </Panel>
     );