mocks.ts 533 B

123456789101112131415161718192021222324
  1. import { DataSourceSettings } from '@grafana/data';
  2. export function createDatasourceSettings<T>(jsonData: T): DataSourceSettings<T> {
  3. return {
  4. id: 0,
  5. uid: 'x',
  6. orgId: 0,
  7. name: 'datasource-test',
  8. typeLogoUrl: '',
  9. type: 'datasource',
  10. typeName: 'Datasource',
  11. access: 'server',
  12. url: 'http://localhost',
  13. user: '',
  14. database: '',
  15. basicAuth: false,
  16. basicAuthUser: '',
  17. isDefault: false,
  18. jsonData,
  19. readOnly: false,
  20. withCredentials: false,
  21. secureJsonFields: {},
  22. };
  23. }