You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
946 B
33 lines
946 B
import { MssqlDatasource } from './datasource';
|
|
import { MssqlQueryCtrl } from './query_ctrl';
|
|
import { MssqlConfigCtrl } from './config_ctrl';
|
|
import { MssqlQuery } from './types';
|
|
import { DataSourcePlugin } from '@grafana/data';
|
|
|
|
const defaultQuery = `SELECT
|
|
<time_column> as time,
|
|
<text_column> as text,
|
|
<tags_column> as tags
|
|
FROM
|
|
<table name>
|
|
WHERE
|
|
$__timeFilter(time_column)
|
|
ORDER BY
|
|
<time_column> ASC`;
|
|
|
|
class MssqlAnnotationsQueryCtrl {
|
|
static templateUrl = 'partials/annotations.editor.html';
|
|
|
|
declare annotation: any;
|
|
|
|
/** @ngInject */
|
|
constructor($scope: any) {
|
|
this.annotation = $scope.ctrl.annotation;
|
|
this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
|
|
}
|
|
}
|
|
|
|
export const plugin = new DataSourcePlugin<MssqlDatasource, MssqlQuery>(MssqlDatasource)
|
|
.setQueryCtrl(MssqlQueryCtrl)
|
|
.setConfigCtrl(MssqlConfigCtrl)
|
|
.setAnnotationQueryCtrl(MssqlAnnotationsQueryCtrl);
|
|
|