module.tsx 510 B

123456789101112131415
  1. import { ReactPanelPlugin } from '@grafana/ui';
  2. import { TextPanelEditor } from './TextPanelEditor';
  3. import { TextPanel } from './TextPanel';
  4. import { TextOptions, defaults } from './types';
  5. export const reactPanel = new ReactPanelPlugin<TextOptions>(TextPanel, defaults);
  6. reactPanel.editor = TextPanelEditor;
  7. reactPanel.onPanelTypeChanged = (options: TextOptions, prevPluginId: string, prevOptions: any) => {
  8. if (prevPluginId === 'text') {
  9. return prevOptions as TextOptions;
  10. }
  11. return options;
  12. };