PanelPluginNotFound.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. info: {
  43. author: {
  44. name: '',
  45. },
  46. description: '',
  47. links: [],
  48. logos: {
  49. large: '',
  50. small: '',
  51. },
  52. screenshots: [],
  53. updated: '',
  54. version: '',
  55. },
  56. exports: {
  57. Panel: NotFound,
  58. },
  59. };
  60. }