mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
18 lines
809 B
TypeScript
18 lines
809 B
TypeScript
import { DashboardLoadedEvent, DataSourcePlugin } from '@grafana/data';
|
|
import { getAppEvents } from '@grafana/runtime';
|
|
|
|
import LokiCheatSheet from './components/LokiCheatSheet';
|
|
import LokiQueryEditorByApp from './components/LokiQueryEditorByApp';
|
|
import { ConfigEditor } from './configuration/ConfigEditor';
|
|
import { LokiDatasource } from './datasource';
|
|
import { onDashboardLoadedHandler } from './tracking';
|
|
import { LokiQuery } from './types';
|
|
|
|
export const plugin = new DataSourcePlugin(LokiDatasource)
|
|
.setQueryEditor(LokiQueryEditorByApp)
|
|
.setConfigEditor(ConfigEditor)
|
|
.setQueryEditorHelp(LokiCheatSheet);
|
|
|
|
// Subscribe to on dashboard loaded event so that we can track plugin adoption
|
|
getAppEvents().subscribe<DashboardLoadedEvent<LokiQuery>>(DashboardLoadedEvent, onDashboardLoadedHandler);
|