module.tsx 506 B

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