plugins.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. interface PluginMetaQueryOptions {
  26. cacheTimeout?: boolean;
  27. maxDataPoints?: boolean;
  28. minInterval?: boolean;
  29. }
  30. export interface PluginMeta {
  31. id: string;
  32. name: string;
  33. info: PluginMetaInfo;
  34. includes: PluginInclude[];
  35. // Datasource-specific
  36. metrics?: boolean;
  37. logs?: boolean;
  38. explore?: boolean;
  39. annotations?: boolean;
  40. mixed?: boolean;
  41. hasQueryHelp?: boolean;
  42. queryOptions?: PluginMetaQueryOptions;
  43. }
  44. export interface PluginInclude {
  45. type: string;
  46. name: string;
  47. path: string;
  48. }
  49. export interface PluginMetaInfo {
  50. author: {
  51. name: string;
  52. url?: string;
  53. };
  54. description: string;
  55. links: string[];
  56. logos: {
  57. large: string;
  58. small: string;
  59. };
  60. screenshots: any[];
  61. updated: string;
  62. version: string;
  63. }
  64. export interface Plugin {
  65. defaultNavUrl: string;
  66. enabled: boolean;
  67. hasUpdate: boolean;
  68. id: string;
  69. info: PluginMetaInfo;
  70. latestVersion: string;
  71. name: string;
  72. pinned: boolean;
  73. state: string;
  74. type: string;
  75. module: any;
  76. }
  77. export interface PluginDashboard {
  78. dashboardId: number;
  79. description: string;
  80. folderId: number;
  81. imported: boolean;
  82. importedRevision: number;
  83. importedUri: string;
  84. importedUrl: string;
  85. path: string;
  86. pluginId: string;
  87. removed: boolean;
  88. revision: number;
  89. slug: string;
  90. title: string;
  91. }
  92. export interface PluginsState {
  93. plugins: Plugin[];
  94. searchQuery: string;
  95. layoutMode: string;
  96. hasFetched: boolean;
  97. dashboards: PluginDashboard[];
  98. }