mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 18:13:32 -06:00
* Babel: Updates babel dependencies to latest version * Fixed problem introduced by babel where calling super with prefedefined this is not supported * fixing test * Fixed tests * Improve fix for QueryCtrl * Fixed more tests * Updated tests
25 lines
709 B
TypeScript
25 lines
709 B
TypeScript
import _ from 'lodash';
|
|
import { auto } from 'angular';
|
|
|
|
export class QueryCtrl {
|
|
target!: any;
|
|
datasource!: any;
|
|
panelCtrl!: any;
|
|
panel: any;
|
|
hasRawMode!: boolean;
|
|
error?: string | null;
|
|
isLastQuery: boolean;
|
|
|
|
constructor(public $scope: any, public $injector: auto.IInjectorService) {
|
|
this.panelCtrl = this.panelCtrl ?? $scope.ctrl.panelCtrl;
|
|
this.target = this.target ?? $scope.ctrl.target;
|
|
this.datasource = this.datasource ?? $scope.ctrl.datasource;
|
|
this.panel = this.panelCtrl?.panel ?? $scope.ctrl.panelCtrl.panel;
|
|
this.isLastQuery = _.indexOf(this.panel.targets, this.target) === this.panel.targets.length - 1;
|
|
}
|
|
|
|
refresh() {
|
|
this.panelCtrl.refresh();
|
|
}
|
|
}
|