import { DataSourcePlugin } from '@grafana/data'; import { MssqlConfigCtrl } from './config_ctrl'; import { MssqlDatasource } from './datasource'; import { MssqlQueryCtrl } from './query_ctrl'; import { MssqlQuery } from './types'; const defaultQuery = `SELECT as time, as text, as tags FROM WHERE $__timeFilter(time_column) ORDER BY 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) .setQueryCtrl(MssqlQueryCtrl) .setConfigCtrl(MssqlConfigCtrl) .setAnnotationQueryCtrl(MssqlAnnotationsQueryCtrl);