PanelPluginNotFound.tsx 1.2 KB

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