module.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. import { PanelPlugin } from '@grafana/data';
  2. import { TextPanel } from './TextPanel';
  3. import { TextPanelEditor } from './TextPanelEditor';
  4. import { defaultPanelOptions, PanelOptions, TextMode } from './models.gen';
  5. import { textPanelMigrationHandler } from './textPanelMigrationHandler';
  6. export const plugin = new PanelPlugin<PanelOptions>(TextPanel)
  7. .setPanelOptions((builder) => {
  8. builder
  9. .addRadio({
  10. path: 'mode',
  11. name: 'Mode',
  12. description: 'text mode of the panel',
  13. settings: {
  14. options: [
  15. { value: TextMode.Markdown, label: 'Markdown' },
  16. { value: TextMode.HTML, label: 'HTML' },
  17. ],
  18. },
  19. defaultValue: defaultPanelOptions.mode,
  20. })
  21. .addCustomEditor({
  22. id: 'content',
  23. path: 'content',
  24. name: 'Content',
  25. description: 'Content of the panel',
  26. editor: TextPanelEditor,
  27. defaultValue: defaultPanelOptions.content,
  28. });
  29. })
  30. .setMigrationHandler(textPanelMigrationHandler);