plugins.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import { ComponentClass } from 'react';
  2. import { PanelProps, PanelOptionsProps } from '@grafana/ui';
  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. interface PluginMetaInfoLink {
  53. name: string;
  54. url: string;
  55. }
  56. export interface PluginMetaInfo {
  57. author: {
  58. name: string;
  59. url?: string;
  60. };
  61. description: string;
  62. links: PluginMetaInfoLink[];
  63. logos: {
  64. large: string;
  65. small: string;
  66. };
  67. screenshots: any[];
  68. updated: string;
  69. version: string;
  70. }
  71. export interface Plugin {
  72. defaultNavUrl: string;
  73. enabled: boolean;
  74. hasUpdate: boolean;
  75. id: string;
  76. info: PluginMetaInfo;
  77. latestVersion: string;
  78. name: string;
  79. pinned: boolean;
  80. state: string;
  81. type: string;
  82. module: any;
  83. }
  84. export interface PluginDashboard {
  85. dashboardId: number;
  86. description: string;
  87. folderId: number;
  88. imported: boolean;
  89. importedRevision: number;
  90. importedUri: string;
  91. importedUrl: string;
  92. path: string;
  93. pluginId: string;
  94. removed: boolean;
  95. revision: number;
  96. slug: string;
  97. title: string;
  98. }
  99. export interface PluginsState {
  100. plugins: Plugin[];
  101. searchQuery: string;
  102. layoutMode: string;
  103. hasFetched: boolean;
  104. dashboards: PluginDashboard[];
  105. }
  106. export interface VariableQueryProps {
  107. query: any;
  108. onChange: (query: any, definition: string) => void;
  109. datasource: any;
  110. templateSrv: any;
  111. }