mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
typing data
This commit is contained in:
parent
88cb38adde
commit
7def403018
@ -1,8 +1,9 @@
|
||||
import { TimeRange, RawTimeRange } from './time';
|
||||
import { PluginMeta } from './plugin';
|
||||
import { TableData, TimeSeries } from './data';
|
||||
|
||||
export interface DataQueryResponse {
|
||||
data: any;
|
||||
data: TimeSeries[] | [TableData];
|
||||
}
|
||||
|
||||
export interface DataQuery {
|
||||
|
@ -162,14 +162,14 @@ export class DataPanel extends Component<Props, State> {
|
||||
|
||||
if (response.data.length > 0 && (response.data[0] as TableData).type === 'table') {
|
||||
return {
|
||||
tableData: response.data,
|
||||
timeSeries: [] as TimeSeries[],
|
||||
tableData: response.data[0] as TableData,
|
||||
timeSeries: null,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
timeSeries: response.data,
|
||||
tableData: {} as TableData,
|
||||
timeSeries: response.data as TimeSeries[],
|
||||
tableData: null,
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user