mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
InfluxDB: convert config editor to react (#20282)
* convert config editor to react * tests and some cleanup * test * snaps * updating per comments * remove anonymous funcs, remove config from state * remove unecessaries
This commit is contained in:
committed by
Torkel Ödegaard
parent
de9ea829a4
commit
eadf324062
@@ -2,35 +2,15 @@ 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/data';
|
||||
|
||||
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' }];
|
||||
}
|
||||
import ConfigEditor from './components/ConfigEditor';
|
||||
|
||||
class InfluxAnnotationsQueryCtrl {
|
||||
static templateUrl = 'partials/annotations.editor.html';
|
||||
}
|
||||
|
||||
export const plugin = new DataSourcePlugin(InfluxDatasource)
|
||||
.setConfigCtrl(InfluxConfigCtrl)
|
||||
.setConfigEditor(ConfigEditor)
|
||||
.setQueryCtrl(InfluxQueryCtrl)
|
||||
.setAnnotationQueryCtrl(InfluxAnnotationsQueryCtrl)
|
||||
.setExploreLogsQueryField(InfluxLogsQueryField)
|
||||
|
||||
Reference in New Issue
Block a user