plugins.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. tables?: boolean;
  39. logs?: boolean;
  40. explore?: boolean;
  41. annotations?: boolean;
  42. mixed?: boolean;
  43. hasQueryHelp?: boolean;
  44. queryOptions?: PluginMetaQueryOptions;
  45. }
  46. export interface PluginInclude {
  47. type: string;
  48. name: string;
  49. path: string;
  50. }
  51. export interface PluginMetaInfo {
  52. author: {
  53. name: string;
  54. url?: string;
  55. };
  56. description: string;
  57. links: string[];
  58. logos: {
  59. large: string;
  60. small: string;
  61. };
  62. screenshots: any[];
  63. updated: string;
  64. version: string;
  65. }
  66. export interface Plugin {
  67. defaultNavUrl: string;
  68. enabled: boolean;
  69. hasUpdate: boolean;
  70. id: string;
  71. info: PluginMetaInfo;
  72. latestVersion: string;
  73. name: string;
  74. pinned: boolean;
  75. state: string;
  76. type: string;
  77. module: any;
  78. }
  79. export interface PluginDashboard {
  80. dashboardId: number;
  81. description: string;
  82. folderId: number;
  83. imported: boolean;
  84. importedRevision: number;
  85. importedUri: string;
  86. importedUrl: string;
  87. path: string;
  88. pluginId: string;
  89. removed: boolean;
  90. revision: number;
  91. slug: string;
  92. title: string;
  93. }
  94. export interface PluginsState {
  95. plugins: Plugin[];
  96. searchQuery: string;
  97. layoutMode: string;
  98. hasFetched: boolean;
  99. dashboards: PluginDashboard[];
  100. }
  101. export interface VariableQueryProps {
  102. query: any;
  103. onChange: (query: any, definition: string) => void;
  104. datasource: any;
  105. templateSrv: any;
  106. }