query_ctrl.ts 623 B

12345678910111213141516171819202122232425
  1. import _ from 'lodash';
  2. import { QueryCtrl } from 'app/plugins/sdk';
  3. import { Target } from './types';
  4. export class StackdriverQueryCtrl extends QueryCtrl {
  5. static templateUrl = 'partials/query.editor.html';
  6. templateSrv: any;
  7. /** @ngInject */
  8. constructor($scope, $injector, templateSrv) {
  9. super($scope, $injector);
  10. this.templateSrv = templateSrv;
  11. this.onQueryChange = this.onQueryChange.bind(this);
  12. this.onExecuteQuery = this.onExecuteQuery.bind(this);
  13. }
  14. onQueryChange(target: Target) {
  15. Object.assign(this.target, target);
  16. }
  17. onExecuteQuery() {
  18. this.$scope.ctrl.refresh();
  19. }
  20. }