datasources.ts 991 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { LayoutMode } from '../core/components/LayoutSelector/LayoutSelector';
  2. import { Plugin, PluginExports, PluginMeta } from './plugins';
  3. export interface DataSource {
  4. id: number;
  5. orgId: number;
  6. name: string;
  7. typeLogoUrl: string;
  8. type: string;
  9. access: string;
  10. url: string;
  11. password: string;
  12. user: string;
  13. database: string;
  14. basicAuth: boolean;
  15. isDefault: boolean;
  16. jsonData: { authType: string; defaultRegion: string };
  17. readOnly: boolean;
  18. meta?: PluginMeta;
  19. pluginExports?: PluginExports;
  20. init?: () => void;
  21. testDatasource?: () => Promise<any>;
  22. }
  23. export interface DataSourceSelectItem {
  24. name: string;
  25. value: string | null;
  26. meta: PluginMeta;
  27. sort: string;
  28. }
  29. export interface DataSourcesState {
  30. dataSources: DataSource[];
  31. searchQuery: string;
  32. dataSourceTypeSearchQuery: string;
  33. layoutMode: LayoutMode;
  34. dataSourcesCount: number;
  35. dataSourceTypes: Plugin[];
  36. dataSource: DataSource;
  37. dataSourceMeta: Plugin;
  38. hasFetched: boolean;
  39. }