2021-02-16 06:27:17 -06:00
|
|
|
import { LokiQuery } from './types';
|
2019-09-10 04:04:44 -05:00
|
|
|
/**
|
|
|
|
* Just a simple wrapper for a react component that is actually implementing the query editor.
|
|
|
|
*/
|
|
|
|
export class LokiAnnotationsQueryCtrl {
|
|
|
|
static templateUrl = 'partials/annotations.editor.html';
|
2021-04-23 02:48:35 -05:00
|
|
|
declare annotation: any;
|
2019-09-10 04:04:44 -05:00
|
|
|
|
|
|
|
/** @ngInject */
|
2021-04-23 02:48:35 -05:00
|
|
|
constructor($scope: any) {
|
|
|
|
this.annotation = $scope.ctrl.annotation;
|
2019-09-10 04:04:44 -05:00
|
|
|
this.annotation.target = this.annotation.target || {};
|
|
|
|
this.onQueryChange = this.onQueryChange.bind(this);
|
|
|
|
}
|
|
|
|
|
2021-02-16 06:27:17 -06:00
|
|
|
onQueryChange(query: LokiQuery) {
|
|
|
|
this.annotation.expr = query.expr;
|
|
|
|
this.annotation.maxLines = query.maxLines;
|
|
|
|
this.annotation.instant = query.instant;
|
2019-09-10 04:04:44 -05:00
|
|
|
}
|
|
|
|
}
|