plugins.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import { ComponentClass } from 'react';
  2. import { PanelProps, PanelOptionsProps } from './panel';
  3. export interface PluginExports {
  4. Datasource?: any;
  5. QueryCtrl?: any;
  6. ConfigCtrl?: any;
  7. AnnotationsQueryCtrl?: any;
  8. ExploreQueryField?: any;
  9. ExploreStartPage?: any;
  10. // Panel plugin
  11. PanelCtrl?;
  12. PanelComponent?: ComponentClass<PanelProps>;
  13. PanelOptionsComponent: ComponentClass<PanelOptionsProps>;
  14. }
  15. export interface PanelPlugin {
  16. id: string;
  17. name: string;
  18. meta: any;
  19. hideFromList: boolean;
  20. module: string;
  21. baseUrl: string;
  22. info: any;
  23. sort: number;
  24. exports?: PluginExports;
  25. }
  26. export interface PluginMeta {
  27. id: string;
  28. name: string;
  29. info: PluginMetaInfo;
  30. includes: PluginInclude[];
  31. // Datasource-specific
  32. metrics?: boolean;
  33. logs?: boolean;
  34. explore?: boolean;
  35. annotations?: boolean;
  36. }
  37. export interface PluginInclude {
  38. type: string;
  39. name: string;
  40. path: string;
  41. }
  42. export interface PluginMetaInfo {
  43. author: {
  44. name: string;
  45. url: string;
  46. };
  47. description: string;
  48. links: string[];
  49. logos: {
  50. large: string;
  51. small: string;
  52. };
  53. screenshots: string;
  54. updated: string;
  55. version: string;
  56. }
  57. export interface Plugin {
  58. defaultNavUrl: string;
  59. enabled: boolean;
  60. hasUpdate: boolean;
  61. id: string;
  62. info: PluginMetaInfo;
  63. latestVersion: string;
  64. name: string;
  65. pinned: boolean;
  66. state: string;
  67. type: string;
  68. module: any;
  69. }
  70. export interface PluginDashboard {
  71. dashboardId: number;
  72. description: string;
  73. folderId: number;
  74. imported: boolean;
  75. importedRevision: number;
  76. importedUri: string;
  77. importedUrl: string;
  78. path: string;
  79. pluginId: string;
  80. removed: boolean;
  81. revision: number;
  82. slug: string;
  83. title: string;
  84. }
  85. export interface PluginsState {
  86. plugins: Plugin[];
  87. searchQuery: string;
  88. layoutMode: string;
  89. hasFetched: boolean;
  90. dashboards: PluginDashboard[];
  91. }