mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import _ from 'lodash';
|
|
import { QueryCtrl } from 'app/plugins/sdk';
|
|
import './query_aggregation_ctrl';
|
|
import './query_filter_ctrl';
|
|
import { StackdriverPicker } from './components/StackdriverPicker';
|
|
import { react2AngularDirective } from 'app/core/utils/react2angular';
|
|
import { registerAngularDirectives } from './angular_wrappers';
|
|
import { Target } from './types';
|
|
|
|
export class StackdriverQueryCtrl extends QueryCtrl {
|
|
static templateUrl = 'partials/query.editor.html';
|
|
templateSrv: any;
|
|
uiSegmentSrv: any;
|
|
|
|
/** @ngInject */
|
|
constructor($scope, $injector, templateSrv, uiSegmentSrv) {
|
|
super($scope, $injector);
|
|
this.templateSrv = templateSrv;
|
|
this.uiSegmentSrv = uiSegmentSrv;
|
|
react2AngularDirective('stackdriverPicker', StackdriverPicker, [
|
|
'options',
|
|
'onChange',
|
|
'selected',
|
|
'searchable',
|
|
'className',
|
|
'placeholder',
|
|
'groupName',
|
|
['templateVariables', { watchDepth: 'reference' }],
|
|
]);
|
|
registerAngularDirectives();
|
|
this.handleQueryChange = this.handleQueryChange.bind(this);
|
|
this.handleExecuteQuery = this.handleExecuteQuery.bind(this);
|
|
}
|
|
|
|
handleQueryChange(target: Target) {
|
|
Object.assign(this.target, target);
|
|
}
|
|
|
|
handleExecuteQuery() {
|
|
this.$scope.ctrl.refresh();
|
|
}
|
|
}
|