grafana/public/app/plugins/datasource/mysql/module.ts

36 lines
813 B
TypeScript
Raw Normal View History

2017-12-20 05:33:33 -06:00
import { MysqlDatasource } from './datasource';
import { MysqlQueryCtrl } from './query_ctrl';
2017-03-29 13:43:20 -05:00
class MysqlConfigCtrl {
2017-12-20 05:33:33 -06:00
static templateUrl = 'partials/config.html';
2017-03-29 15:54:07 -05:00
}
const defaultQuery = `SELECT
UNIX_TIMESTAMP(<time_column>) as time_sec,
<text_column> as text,
<tags_column> as tags
FROM <table name>
WHERE $__timeFilter(time_column)
ORDER BY <time_column> ASC
LIMIT 100
`;
class MysqlAnnotationsQueryCtrl {
2017-12-20 05:33:33 -06:00
static templateUrl = 'partials/annotations.editor.html';
annotation: any;
/** @ngInject */
constructor() {
this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
}
}
2017-03-29 13:43:20 -05:00
export {
MysqlDatasource,
MysqlDatasource as Datasource,
MysqlQueryCtrl as QueryCtrl,
MysqlConfigCtrl as ConfigCtrl,
2017-12-20 05:33:33 -06:00
MysqlAnnotationsQueryCtrl as AnnotationsQueryCtrl,
2017-03-29 13:43:20 -05:00
};