plugins.ts 1.8 KB

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