module.ts 938 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ///<reference path="../../../headers/common.d.ts" />
  2. import {MssqlDatasource} from './datasource';
  3. import {MssqlQueryCtrl} from './query_ctrl';
  4. class MssqlConfigCtrl {
  5. static templateUrl = 'partials/config.html';
  6. }
  7. const defaultQuery = `SELECT TOP 100
  8. DATEDIFF(second, {d '1970-01-01'}, DATEADD(second,DATEDIFF(second,GETDATE(),GETUTCDATE()),<time_column>) ) as time_sec,
  9. <text_column> as text,
  10. <tags_column> as tags
  11. FROM <table name>
  12. WHERE $__timeFilter(time_column)
  13. ORDER BY <time_column> ASC
  14. `;
  15. class MssqlAnnotationsQueryCtrl {
  16. static templateUrl = 'partials/annotations.editor.html';
  17. annotation: any;
  18. /** @ngInject **/
  19. constructor() {
  20. this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
  21. }
  22. }
  23. export {
  24. MssqlDatasource,
  25. MssqlDatasource as Datasource,
  26. MssqlQueryCtrl as QueryCtrl,
  27. MssqlConfigCtrl as ConfigCtrl,
  28. MssqlAnnotationsQueryCtrl as AnnotationsQueryCtrl,
  29. };