ReactMigration: Migrate Prometheus config page to React (#20248)

* add basic components

* adding onchange handler for Prom settings

* move options outside component

* reorder imports

* Add missing setting
This commit is contained in:
Peter Holmberg
2019-11-08 10:02:51 +01:00
committed by GitHub
parent ba7049dd0f
commit dcfc74ef00
5 changed files with 153 additions and 89 deletions

View File

@@ -1,19 +1,19 @@
import { DataSourcePlugin } from '@grafana/data';
import { PrometheusDatasource } from './datasource';
import { PromQueryEditor } from './components/PromQueryEditor';
import { PrometheusConfigCtrl } from './config_ctrl';
import { PromQueryEditor } from './components/PromQueryEditor';
import PromCheatSheet from './components/PromCheatSheet';
import PromQueryField from './components/PromQueryField';
import { ConfigEditor } from './configuration/ConfigEditor';
class PrometheusAnnotationsQueryCtrl {
static templateUrl = 'partials/annotations.editor.html';
}
export {
PrometheusDatasource as Datasource,
PromQueryEditor as QueryEditor,
PrometheusConfigCtrl as ConfigCtrl,
PrometheusAnnotationsQueryCtrl as AnnotationsQueryCtrl,
PromQueryField as ExploreQueryField,
PromCheatSheet as ExploreStartPage,
};
export const plugin = new DataSourcePlugin(PrometheusDatasource)
.setQueryCtrl(PromQueryEditor)
.setConfigEditor(ConfigEditor)
.setExploreLogsQueryField(PromQueryField)
.setAnnotationQueryCtrl(PrometheusAnnotationsQueryCtrl)
.setExploreStartPage(PromCheatSheet);