2017-12-20 05:33:33 -06:00
|
|
|
import _ from 'lodash';
|
2019-07-18 01:03:04 -05:00
|
|
|
import { auto } from 'angular';
|
2016-02-01 05:42:10 -06:00
|
|
|
|
2016-02-02 05:52:43 -06:00
|
|
|
export class QueryCtrl {
|
2016-02-02 02:12:58 -06:00
|
|
|
target: any;
|
|
|
|
datasource: any;
|
|
|
|
panelCtrl: any;
|
|
|
|
panel: any;
|
2016-02-02 09:32:36 -06:00
|
|
|
hasRawMode: boolean;
|
2020-07-08 04:05:20 -05:00
|
|
|
error?: string | null;
|
2017-09-08 04:43:29 -05:00
|
|
|
isLastQuery: boolean;
|
2016-02-02 02:12:58 -06:00
|
|
|
|
2019-07-18 01:03:04 -05:00
|
|
|
constructor(public $scope: any, public $injector: auto.IInjectorService) {
|
2016-02-02 02:12:58 -06:00
|
|
|
this.panel = this.panelCtrl.panel;
|
2017-12-21 01:39:31 -06:00
|
|
|
this.isLastQuery = _.indexOf(this.panel.targets, this.target) === this.panel.targets.length - 1;
|
2016-02-02 02:12:58 -06:00
|
|
|
}
|
|
|
|
|
2016-02-02 05:52:43 -06:00
|
|
|
refresh() {
|
|
|
|
this.panelCtrl.refresh();
|
|
|
|
}
|
2016-01-14 07:37:04 -06:00
|
|
|
}
|