mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* 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.
38 lines
1.3 KiB
TypeScript
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);
|