plugins.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. TemplateQueryComponent?: any;
  9. ExploreQueryField?: any;
  10. ExploreStartPage?: any;
  11. // Panel plugin
  12. PanelCtrl?;
  13. PanelComponent?: ComponentClass<PanelProps>;
  14. PanelOptionsComponent: ComponentClass<PanelOptionsProps>;
  15. }
  16. export interface PanelPlugin {
  17. id: string;
  18. name: string;
  19. meta: any;
  20. hideFromList: boolean;
  21. module: string;
  22. baseUrl: string;
  23. info: any;
  24. sort: number;
  25. exports?: PluginExports;
  26. }
  27. export interface PluginMeta {
  28. id: string;
  29. name: string;
  30. info: PluginMetaInfo;
  31. includes: PluginInclude[];
  32. // Datasource-specific
  33. metrics?: boolean;
  34. logs?: boolean;
  35. explore?: boolean;
  36. annotations?: boolean;
  37. }
  38. export interface PluginInclude {
  39. type: string;
  40. name: string;
  41. path: string;
  42. }
  43. export interface PluginMetaInfo {
  44. author: {
  45. name: string;
  46. url: string;
  47. };
  48. description: string;
  49. links: string[];
  50. logos: {
  51. large: string;
  52. small: string;
  53. };
  54. screenshots: string;
  55. updated: string;
  56. version: string;
  57. }
  58. export interface Plugin {
  59. defaultNavUrl: string;
  60. enabled: boolean;
  61. hasUpdate: boolean;
  62. id: string;
  63. info: PluginMetaInfo;
  64. latestVersion: string;
  65. name: string;
  66. pinned: boolean;
  67. state: string;
  68. type: string;
  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. }
  92. export interface TemplateQueryProps {
  93. query: any;
  94. onChange: (c: any) => void;
  95. datasource: any;
  96. // datasource: StackdriverDatasource;
  97. }