LokiAnnotationsQueryCtrl.tsx 654 B

123456789101112131415161718192021
  1. import { LokiQuery } from './types';
  2. /**
  3. * Just a simple wrapper for a react component that is actually implementing the query editor.
  4. */
  5. export class LokiAnnotationsQueryCtrl {
  6. static templateUrl = 'partials/annotations.editor.html';
  7. declare annotation: any;
  8. /** @ngInject */
  9. constructor($scope: any) {
  10. this.annotation = $scope.ctrl.annotation;
  11. this.annotation.target = this.annotation.target || {};
  12. this.onQueryChange = this.onQueryChange.bind(this);
  13. }
  14. onQueryChange(query: LokiQuery) {
  15. this.annotation.expr = query.expr;
  16. this.annotation.maxLines = query.maxLines;
  17. this.annotation.instant = query.instant;
  18. }
  19. }