RenderingWarnings.tsx 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import React from 'react';
  2. import { Alert } from '@grafana/ui';
  3. export interface Props {
  4. variant?: 'info' | 'error';
  5. }
  6. const actionMessage = 'Please contact your Grafana administrator to install the plugin.';
  7. const NoRendererInfoMessage = (): JSX.Element => {
  8. return (
  9. <>
  10. <>To generate PDF reports, you must install the </>
  11. <a
  12. href="https://grafana.com/grafana/plugins/grafana-image-renderer"
  13. target="_blank"
  14. rel="noopener noreferrer"
  15. className="external-link"
  16. >
  17. Grafana Image Renderer
  18. </a>
  19. <> plugin.</>
  20. </>
  21. );
  22. };
  23. export const NoRendererInfoBox = ({ variant = 'info' }: Props): JSX.Element => {
  24. return (
  25. <Alert title="Image renderer plugin not installed" severity={variant}>
  26. <NoRendererInfoMessage /> <br />
  27. {actionMessage}
  28. </Alert>
  29. );
  30. };
  31. const OldRendererInfoMessage = (): JSX.Element => {
  32. return (
  33. <>
  34. <>To generate CSV files, you must update the </>
  35. <a
  36. href="https://grafana.com/grafana/plugins/grafana-image-renderer"
  37. target="_blank"
  38. rel="noopener noreferrer"
  39. className="external-link"
  40. >
  41. Grafana Image Renderer
  42. </a>
  43. <> plugin.</>
  44. </>
  45. );
  46. };
  47. export const OldRendererInfoBox = (): JSX.Element => {
  48. return (
  49. <Alert title="You are using an old version of the image renderer plugin" severity="warning">
  50. <OldRendererInfoMessage /> <br />
  51. {actionMessage}
  52. </Alert>
  53. );
  54. };