Chore: move specific DataQuery props to loki/tsdb (#23086)

This commit is contained in:
Ryan McKinley 2020-03-25 22:30:22 -07:00 committed by GitHub
parent 27913289d3
commit 19123444a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 9 deletions

View File

@ -391,13 +391,6 @@ export interface DataQuery {
* For non mixed scenarios this is undefined.
*/
datasource?: string | null;
metric?: any;
/**
* For limiting result lines.
*/
maxLines?: number;
}
export interface DataQueryError {

View File

@ -42,6 +42,7 @@ export interface LokiQuery extends DataQuery {
reverse?: boolean;
legendFormat?: string;
valueWithRefId?: boolean;
maxLines?: number;
}
export interface LokiOptions extends DataSourceJsonData {

View File

@ -38,7 +38,7 @@ export default class OpenTsDatasource extends DataSourceApi<OpenTsdbQuery, OpenT
}
// Called once per panel (graph)
query(options: DataQueryRequest) {
query(options: DataQueryRequest<OpenTsdbQuery>) {
const start = this.convertToTSDBTime(options.rangeRaw.from, false, options.timezone);
const end = this.convertToTSDBTime(options.rangeRaw.to, true, options.timezone);
const qs: any[] = [];

View File

@ -1,6 +1,8 @@
import { DataQuery, DataSourceJsonData } from '@grafana/data';
export interface OpenTsdbQuery extends DataQuery {}
export interface OpenTsdbQuery extends DataQuery {
metric?: any;
}
export interface OpenTsdbOptions extends DataSourceJsonData {
tsdbVersion: number;