Files
grafana/public/app/plugins/datasource/loki/LokiAnnotationsQueryCtrl.tsx
Ivana Huckova 350dcb999a Loki: Add line limit for annotations (#31183)
* Add line limit to Annotation query editor

* Refactor to keep type consistent
2021-02-16 13:27:17 +01:00

21 lines
589 B
TypeScript

import { LokiQuery } from './types';
/**
* Just a simple wrapper for a react component that is actually implementing the query editor.
*/
export class LokiAnnotationsQueryCtrl {
static templateUrl = 'partials/annotations.editor.html';
annotation: any;
/** @ngInject */
constructor() {
this.annotation.target = this.annotation.target || {};
this.onQueryChange = this.onQueryChange.bind(this);
}
onQueryChange(query: LokiQuery) {
this.annotation.expr = query.expr;
this.annotation.maxLines = query.maxLines;
this.annotation.instant = query.instant;
}
}