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

24 lines
707 B
TypeScript
Raw Normal View History

import { react2AngularDirective } from 'app/core/utils/react2angular';
import { AnnotationQueryEditor } from './components/AnnotationQueryEditor';
2018-09-27 21:17:35 +08:00
export class StackdriverAnnotationsQueryCtrl {
static templateUrl = 'partials/annotations.editor.html';
annotation: any;
constructor() {
this.annotation.target = this.annotation.target || {};
2018-12-29 02:45:24 +08:00
this.handleQueryChange = this.handleQueryChange.bind(this);
react2AngularDirective('annotationQueryEditor', AnnotationQueryEditor, [
'target',
'onQueryChange',
'onExecuteQuery',
['datasource', { watchDepth: 'reference' }],
]);
2018-12-29 02:45:24 +08:00
}
handleQueryChange(target) {
Object.assign(this.annotation.target, target);
2018-09-27 21:17:35 +08:00
}
}