module.ts 894 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. ///<reference path="../../../headers/common.d.ts" />
  2. import {MysqlDatasource} from './datasource';
  3. import {MysqlQueryCtrl} from './query_ctrl';
  4. class MysqlConfigCtrl {
  5. static templateUrl = 'partials/config.html';
  6. }
  7. const defaultQuery = `SELECT
  8. UNIX_TIMESTAMP(<time_column>) as time_sec,
  9. <title_column> as title,
  10. <text_column> as text,
  11. <tags_column> as tags
  12. FROM <table name>
  13. WHERE $__timeFilter(time_column)
  14. ORDER BY <time_column> ASC
  15. LIMIT 100
  16. `;
  17. class MysqlAnnotationsQueryCtrl {
  18. static templateUrl = 'partials/annotations.editor.html';
  19. annotation: any;
  20. /** @ngInject **/
  21. constructor() {
  22. this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
  23. }
  24. }
  25. export {
  26. MysqlDatasource,
  27. MysqlDatasource as Datasource,
  28. MysqlQueryCtrl as QueryCtrl,
  29. MysqlConfigCtrl as ConfigCtrl,
  30. MysqlAnnotationsQueryCtrl as AnnotationsQueryCtrl,
  31. };