2022-12-08 11:28:40 +01:00
|
|
|
import { DashboardLoadedEvent, DataSourcePlugin } from '@grafana/data';
|
|
|
|
|
import { getAppEvents } from '@grafana/runtime';
|
2022-04-22 14:33:13 +01:00
|
|
|
|
2020-12-04 14:29:40 +00:00
|
|
|
import { QueryEditor } from './components/QueryEditor';
|
2022-04-22 14:33:13 +01:00
|
|
|
import { ConfigEditor } from './configuration/ConfigEditor';
|
|
|
|
|
import { ElasticDatasource } from './datasource';
|
2022-12-08 11:28:40 +01:00
|
|
|
import { onDashboardLoadedHandler } from './tracking';
|
|
|
|
|
import { ElasticsearchQuery } from './types';
|
2016-02-03 16:31:07 +01:00
|
|
|
|
2022-05-31 09:26:40 +01:00
|
|
|
export const plugin = new DataSourcePlugin(ElasticDatasource).setQueryEditor(QueryEditor).setConfigEditor(ConfigEditor);
|
2022-12-08 11:28:40 +01:00
|
|
|
|
|
|
|
|
// Subscribe to on dashboard loaded event so that we can track plugin adoption
|
|
|
|
|
getAppEvents().subscribe<DashboardLoadedEvent<ElasticsearchQuery>>(DashboardLoadedEvent, onDashboardLoadedHandler);
|