module.ts 971 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. constructor($scope) {
  8. this.current.jsonData.sslmode = this.current.jsonData.sslmode || 'require';
  9. }
  10. }
  11. const defaultQuery = `SELECT
  12. extract(epoch from time_column) AS time,
  13. title_column as title,
  14. description_column as text
  15. FROM
  16. metric_table
  17. WHERE
  18. $__timeFilter(time_column)
  19. `;
  20. class PostgresAnnotationsQueryCtrl {
  21. static templateUrl = 'partials/annotations.editor.html';
  22. annotation: any;
  23. /** @ngInject **/
  24. constructor() {
  25. this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
  26. }
  27. }
  28. export {
  29. PostgresDatasource,
  30. PostgresDatasource as Datasource,
  31. PostgresQueryCtrl as QueryCtrl,
  32. PostgresConfigCtrl as ConfigCtrl,
  33. PostgresAnnotationsQueryCtrl as AnnotationsQueryCtrl,
  34. };