PanelPluginNotFound.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Libraries
  2. import _ from 'lodash';
  3. import React, { PureComponent } from 'react';
  4. // Types
  5. import { PanelProps } from '@grafana/ui';
  6. import { PanelPlugin } from 'app/types';
  7. interface Props {
  8. pluginId: string;
  9. }
  10. class PanelPluginNotFound extends PureComponent<Props> {
  11. constructor(props) {
  12. super(props);
  13. }
  14. render() {
  15. const style = {
  16. display: 'flex',
  17. alignItems: 'center',
  18. textAlign: 'center' as 'center',
  19. height: '100%',
  20. };
  21. return (
  22. <div style={style}>
  23. <div className="alert alert-error" style={{ margin: '0 auto' }}>
  24. Panel plugin with id {this.props.pluginId} could not be found
  25. </div>
  26. </div>
  27. );
  28. }
  29. }
  30. export function getPanelPluginNotFound(id: string): PanelPlugin {
  31. const NotFound = class NotFound extends PureComponent<PanelProps> {
  32. render() {
  33. return <PanelPluginNotFound pluginId={id} />;
  34. }
  35. };
  36. return {
  37. id: id,
  38. name: id,
  39. sort: 100,
  40. module: '',
  41. baseUrl: '',
  42. dataFormats: [],
  43. info: {
  44. author: {
  45. name: '',
  46. },
  47. description: '',
  48. links: [],
  49. logos: {
  50. large: '',
  51. small: '',
  52. },
  53. screenshots: [],
  54. updated: '',
  55. version: '',
  56. },
  57. exports: {
  58. Panel: NotFound,
  59. },
  60. };
  61. }