2016-01-14 14:37:04 +01:00
|
|
|
///<reference path="../../headers/common.d.ts" />
|
|
|
|
|
|
2016-02-01 12:42:10 +01:00
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
2016-02-02 12:52:43 +01:00
|
|
|
export class QueryCtrl {
|
2016-02-02 09:12:58 +01:00
|
|
|
target: any;
|
|
|
|
|
datasource: any;
|
|
|
|
|
panelCtrl: any;
|
|
|
|
|
panel: any;
|
2016-02-02 16:32:36 +01:00
|
|
|
hasRawMode: boolean;
|
2016-02-02 22:58:37 +01:00
|
|
|
error: string;
|
2017-09-08 11:43:29 +02:00
|
|
|
isLastQuery: boolean;
|
2016-02-02 09:12:58 +01:00
|
|
|
|
2017-09-21 16:40:18 +02:00
|
|
|
constructor(public $scope, public $injector) {
|
2016-02-02 09:12:58 +01:00
|
|
|
this.panel = this.panelCtrl.panel;
|
2017-09-08 11:43:29 +02:00
|
|
|
this.isLastQuery = _.indexOf(this.panel.targets, this.target) === (this.panel.targets.length - 1);
|
2016-02-02 09:12:58 +01:00
|
|
|
}
|
|
|
|
|
|
2016-02-02 12:52:43 +01:00
|
|
|
refresh() {
|
|
|
|
|
this.panelCtrl.refresh();
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-14 14:37:04 +01:00
|
|
|
}
|
|
|
|
|
|