2017-12-20 12:33:33 +01:00
|
|
|
import { PostgresDatasource } from './datasource';
|
|
|
|
|
import { PostgresQueryCtrl } from './query_ctrl';
|
2018-08-15 09:48:06 +02:00
|
|
|
import { PostgresConfigCtrl } from './config_ctrl';
|
2017-10-10 15:19:14 +02:00
|
|
|
|
|
|
|
|
const defaultQuery = `SELECT
|
|
|
|
|
extract(epoch from time_column) AS time,
|
2017-10-18 18:10:01 +02:00
|
|
|
text_column as text,
|
|
|
|
|
tags_column as tags
|
2017-10-10 15:19:14 +02:00
|
|
|
FROM
|
|
|
|
|
metric_table
|
|
|
|
|
WHERE
|
|
|
|
|
$__timeFilter(time_column)
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
class PostgresAnnotationsQueryCtrl {
|
2017-12-20 12:33:33 +01:00
|
|
|
static templateUrl = 'partials/annotations.editor.html';
|
2017-10-10 15:19:14 +02:00
|
|
|
|
|
|
|
|
annotation: any;
|
|
|
|
|
|
2018-08-31 16:40:43 +02:00
|
|
|
/** @ngInject */
|
2017-10-10 15:19:14 +02:00
|
|
|
constructor() {
|
|
|
|
|
this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
PostgresDatasource,
|
|
|
|
|
PostgresDatasource as Datasource,
|
|
|
|
|
PostgresQueryCtrl as QueryCtrl,
|
|
|
|
|
PostgresConfigCtrl as ConfigCtrl,
|
2017-12-20 12:33:33 +01:00
|
|
|
PostgresAnnotationsQueryCtrl as AnnotationsQueryCtrl,
|
2017-10-10 15:19:14 +02:00
|
|
|
};
|