plugins.ts 2.2 KB

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