2017-03-30 02:43:20 +08:00
|
|
|
///<reference path="../../../headers/common.d.ts" />
|
|
|
|
|
2017-12-19 23:06:54 +08:00
|
|
|
import { MysqlDatasource } from "./datasource";
|
|
|
|
import { MysqlQueryCtrl } from "./query_ctrl";
|
2017-03-30 02:43:20 +08:00
|
|
|
|
2017-03-30 19:46:46 +08:00
|
|
|
class MysqlConfigCtrl {
|
2017-12-19 23:06:54 +08:00
|
|
|
static templateUrl = "partials/config.html";
|
2017-03-30 04:54:07 +08:00
|
|
|
}
|
|
|
|
|
2017-05-23 04:18:20 +08: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-19 23:06:54 +08:00
|
|
|
static templateUrl = "partials/annotations.editor.html";
|
2017-05-23 04:18:20 +08:00
|
|
|
|
|
|
|
annotation: any;
|
|
|
|
|
|
|
|
/** @ngInject **/
|
|
|
|
constructor() {
|
|
|
|
this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-30 02:43:20 +08:00
|
|
|
export {
|
|
|
|
MysqlDatasource,
|
|
|
|
MysqlDatasource as Datasource,
|
|
|
|
MysqlQueryCtrl as QueryCtrl,
|
2017-03-30 19:46:46 +08:00
|
|
|
MysqlConfigCtrl as ConfigCtrl,
|
2017-12-19 23:06:54 +08:00
|
|
|
MysqlAnnotationsQueryCtrl as AnnotationsQueryCtrl
|
2017-03-30 02:43:20 +08:00
|
|
|
};
|