grafana/public/app/plugins/datasource/stackdriver/query_ctrl.ts
kay delaney 7985aa1e57
Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements (#18544)
* Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements
- Introduces dynamic imports for built-in plugins
- Uses dynamic imports for various packages (rst2html, brace)
- Introduces route-based dynamic imports
- Splits angular and moment into separate bundles
2019-09-03 09:29:02 +01:00

26 lines
767 B
TypeScript

import { QueryCtrl } from 'app/plugins/sdk';
import { StackdriverQuery } from './types';
import { TemplateSrv } from 'app/features/templating/template_srv';
import { auto } from 'angular';
export class StackdriverQueryCtrl extends QueryCtrl {
static templateUrl = 'partials/query.editor.html';
templateSrv: TemplateSrv;
/** @ngInject */
constructor($scope: any, $injector: auto.IInjectorService, templateSrv: TemplateSrv) {
super($scope, $injector);
this.templateSrv = templateSrv;
this.onQueryChange = this.onQueryChange.bind(this);
this.onExecuteQuery = this.onExecuteQuery.bind(this);
}
onQueryChange(target: StackdriverQuery) {
Object.assign(this.target, target);
}
onExecuteQuery() {
this.$scope.ctrl.refresh();
}
}