dataSourcesMocks.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { DataSource } from 'app/types';
  2. export const getMockDataSources = (amount: number): DataSource[] => {
  3. const dataSources = [];
  4. for (let i = 0; i <= amount; i++) {
  5. dataSources.push({
  6. access: '',
  7. basicAuth: false,
  8. database: `database-${i}`,
  9. id: i,
  10. isDefault: false,
  11. jsonData: { authType: 'credentials', defaultRegion: 'eu-west-2' },
  12. name: `dataSource-${i}`,
  13. orgId: 1,
  14. password: '',
  15. readOnly: false,
  16. type: 'cloudwatch',
  17. typeLogoUrl: 'public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png',
  18. url: '',
  19. user: '',
  20. });
  21. }
  22. return dataSources;
  23. };
  24. export const getMockDataSource = (): DataSource => {
  25. return {
  26. access: '',
  27. basicAuth: false,
  28. basicAuthUser: '',
  29. basicAuthPassword: '',
  30. withCredentials: false,
  31. database: '',
  32. id: 13,
  33. isDefault: false,
  34. jsonData: { authType: 'credentials', defaultRegion: 'eu-west-2' },
  35. name: 'gdev-cloudwatch',
  36. orgId: 1,
  37. password: '',
  38. readOnly: false,
  39. type: 'cloudwatch',
  40. typeLogoUrl: 'public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png',
  41. url: '',
  42. user: '',
  43. };
  44. };