query_ctrl.ts 554 B

1234567891011121314151617181920212223
  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. /** @ngInject */
  7. constructor($scope, $injector) {
  8. super($scope, $injector);
  9. this.onQueryChange = this.onQueryChange.bind(this);
  10. this.onExecuteQuery = this.onExecuteQuery.bind(this);
  11. }
  12. onQueryChange(target: Target) {
  13. Object.assign(this.target, target);
  14. }
  15. onExecuteQuery() {
  16. this.$scope.ctrl.refresh();
  17. }
  18. }