grafana/public/app/plugins/datasource/stackdriver/query_ctrl.ts

26 lines
704 B
TypeScript
Raw Normal View History

import _ from 'lodash';
2018-09-04 19:21:02 +08:00
import { QueryCtrl } from 'app/plugins/sdk';
import './query_filter_ctrl';
import { registerAngularDirectives } from './angular_wrappers';
2018-12-22 06:07:46 +08:00
import { Target } from './types';
2018-09-04 19:21:02 +08:00
export class StackdriverQueryCtrl extends QueryCtrl {
static templateUrl = 'partials/query.editor.html';
2018-09-04 19:21:02 +08:00
/** @ngInject */
2018-12-22 06:28:21 +08:00
constructor($scope, $injector) {
2018-09-04 19:21:02 +08:00
super($scope, $injector);
registerAngularDirectives();
2018-12-22 06:07:46 +08:00
this.handleQueryChange = this.handleQueryChange.bind(this);
this.handleExecuteQuery = this.handleExecuteQuery.bind(this);
2018-12-13 07:16:48 +08:00
}
2018-12-19 21:19:27 +08:00
handleQueryChange(target: Target) {
Object.assign(this.target, target);
2018-12-13 07:16:48 +08:00
}
2018-12-19 21:19:27 +08:00
handleExecuteQuery() {
this.$scope.ctrl.refresh();
2018-09-13 17:02:31 +08:00
}
2018-09-04 19:21:02 +08:00
}