plugins.ts 1.9 KB

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