module.ts 984 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ///<reference path="../../../headers/common.d.ts" />
  2. import {PostgresDatasource} from './datasource';
  3. import {PostgresQueryCtrl} from './query_ctrl';
  4. class PostgresConfigCtrl {
  5. static templateUrl = 'partials/config.html';
  6. current: any;
  7. /** @ngInject **/
  8. constructor($scope) {
  9. this.current.jsonData.sslmode = this.current.jsonData.sslmode || 'require';
  10. }
  11. }
  12. const defaultQuery = `SELECT
  13. extract(epoch from time_column) AS time,
  14. text_column as text,
  15. tags_column as tags
  16. FROM
  17. metric_table
  18. WHERE
  19. $__timeFilter(time_column)
  20. `;
  21. class PostgresAnnotationsQueryCtrl {
  22. static templateUrl = 'partials/annotations.editor.html';
  23. annotation: any;
  24. /** @ngInject **/
  25. constructor() {
  26. this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
  27. }
  28. }
  29. export {
  30. PostgresDatasource,
  31. PostgresDatasource as Datasource,
  32. PostgresQueryCtrl as QueryCtrl,
  33. PostgresConfigCtrl as ConfigCtrl,
  34. PostgresAnnotationsQueryCtrl as AnnotationsQueryCtrl,
  35. };