module.ts 937 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { PostgresDatasource } from './datasource';
  2. import { PostgresQueryCtrl } from './query_ctrl';
  3. class PostgresConfigCtrl {
  4. static templateUrl = 'partials/config.html';
  5. current: any;
  6. /** @ngInject **/
  7. constructor($scope) {
  8. this.current.jsonData.sslmode = this.current.jsonData.sslmode || 'verify-full';
  9. }
  10. }
  11. const defaultQuery = `SELECT
  12. extract(epoch from time_column) AS time,
  13. text_column as text,
  14. tags_column as tags
  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. };