module.tsx 778 B

123456789101112131415161718192021222324
  1. import { PanelPlugin } from '@grafana/data';
  2. import { NewsPanel } from './NewsPanel';
  3. import { DEFAULT_FEED_URL } from './constants';
  4. import { PanelOptions, defaultPanelOptions } from './models.gen';
  5. export const plugin = new PanelPlugin<PanelOptions>(NewsPanel).setPanelOptions((builder) => {
  6. builder
  7. .addTextInput({
  8. path: 'feedUrl',
  9. name: 'URL',
  10. description: 'Supports RSS and Atom feeds',
  11. settings: {
  12. placeholder: DEFAULT_FEED_URL,
  13. },
  14. defaultValue: defaultPanelOptions.feedUrl,
  15. })
  16. .addBooleanSwitch({
  17. path: 'showImage',
  18. name: 'Show image',
  19. description: 'Controls if the news item social (og:image) image is shown above text content',
  20. defaultValue: defaultPanelOptions.showImage,
  21. });
  22. });