Files
grafana/public/app/plugins/datasource/influxdb/module.ts
kay delaney 2a47c315df Influx: Adds start page for logs in Explore (#17521)
* Influx: Adds start page for logs in Explore
Closes #17499

* Influx: Rebased with master and removed conditional display of cheat sheet in explore
Cheat sheet now displays during both Metrics and Logs mode, though this is only
temporary.
2019-06-12 14:01:48 +01:00

38 lines
1.3 KiB
TypeScript

import InfluxDatasource from './datasource';
import { InfluxQueryCtrl } from './query_ctrl';
import { InfluxLogsQueryField } from './components/InfluxLogsQueryField';
import InfluxStartPage from './components/InfluxStartPage';
import {
createChangeHandler,
createResetHandler,
PasswordFieldEnum,
} from '../../../features/datasources/utils/passwordHandlers';
import { DataSourcePlugin } from '@grafana/ui';
class InfluxConfigCtrl {
static templateUrl = 'partials/config.html';
current: any;
onPasswordReset: ReturnType<typeof createResetHandler>;
onPasswordChange: ReturnType<typeof createChangeHandler>;
constructor() {
this.onPasswordReset = createResetHandler(this, PasswordFieldEnum.Password);
this.onPasswordChange = createChangeHandler(this, PasswordFieldEnum.Password);
this.current.jsonData.httpMode = this.current.jsonData.httpMode || 'GET';
}
httpMode = [{ name: 'GET', value: 'GET' }, { name: 'POST', value: 'POST' }];
}
class InfluxAnnotationsQueryCtrl {
static templateUrl = 'partials/annotations.editor.html';
}
export const plugin = new DataSourcePlugin(InfluxDatasource)
.setConfigCtrl(InfluxConfigCtrl)
.setQueryCtrl(InfluxQueryCtrl)
.setAnnotationQueryCtrl(InfluxAnnotationsQueryCtrl)
.setExploreLogsQueryField(InfluxLogsQueryField)
.setExploreStartPage(InfluxStartPage);