plugins.ts 2.3 KB

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