plugins.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. VariableQueryEditor?: any;
  9. ExploreQueryField?: any;
  10. ExploreStartPage?: any;
  11. // Panel plugin
  12. PanelCtrl?;
  13. Panel?: ComponentClass<PanelProps>;
  14. PanelOptions?: ComponentClass<PanelOptionsProps>;
  15. }
  16. export interface PanelPlugin {
  17. id: string;
  18. name: string;
  19. hideFromList?: boolean;
  20. module: string;
  21. baseUrl: string;
  22. info: any;
  23. sort: number;
  24. exports?: PluginExports;
  25. }
  26. interface PluginMetaQueryOptions {
  27. cacheTimeout?: boolean;
  28. maxDataPoints?: boolean;
  29. minInterval?: boolean;
  30. }
  31. export interface PluginMeta {
  32. id: string;
  33. name: string;
  34. info: PluginMetaInfo;
  35. includes: PluginInclude[];
  36. // Datasource-specific
  37. metrics?: boolean;
  38. logs?: boolean;
  39. explore?: boolean;
  40. annotations?: boolean;
  41. mixed?: boolean;
  42. hasQueryHelp?: boolean;
  43. queryOptions?: PluginMetaQueryOptions;
  44. }
  45. export interface PluginInclude {
  46. type: string;
  47. name: string;
  48. path: string;
  49. }
  50. export interface PluginMetaInfo {
  51. author: {
  52. name: string;
  53. url?: string;
  54. };
  55. description: string;
  56. links: string[];
  57. logos: {
  58. large: string;
  59. small: string;
  60. };
  61. screenshots: any[];
  62. updated: string;
  63. version: string;
  64. }
  65. export interface Plugin {
  66. defaultNavUrl: string;
  67. enabled: boolean;
  68. hasUpdate: boolean;
  69. id: string;
  70. info: PluginMetaInfo;
  71. latestVersion: string;
  72. name: string;
  73. pinned: boolean;
  74. state: string;
  75. type: string;
  76. module: any;
  77. }
  78. export interface PluginDashboard {
  79. dashboardId: number;
  80. description: string;
  81. folderId: number;
  82. imported: boolean;
  83. importedRevision: number;
  84. importedUri: string;
  85. importedUrl: string;
  86. path: string;
  87. pluginId: string;
  88. removed: boolean;
  89. revision: number;
  90. slug: string;
  91. title: string;
  92. }
  93. export interface PluginsState {
  94. plugins: Plugin[];
  95. searchQuery: string;
  96. layoutMode: string;
  97. hasFetched: boolean;
  98. dashboards: PluginDashboard[];
  99. }
  100. export interface VariableQueryProps {
  101. query: any;
  102. onChange: (query: any, definition: string) => void;
  103. datasource: any;
  104. templateSrv: any;
  105. }