paths.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { ClusterName, SchemaName, TopicName } from 'redux/interfaces';
  2. import { GIT_REPO_LINK } from './constants';
  3. export const gitCommitPath = (commit: string) =>
  4. `${GIT_REPO_LINK}/commit/${commit}`;
  5. const clusterPath = (clusterName: ClusterName) => `/ui/clusters/${clusterName}`;
  6. // Brokers
  7. export const clusterBrokersPath = (clusterName: ClusterName) =>
  8. `${clusterPath(clusterName)}/brokers`;
  9. // Consumer Groups
  10. export const clusterConsumerGroupsPath = (clusterName: ClusterName) =>
  11. `${clusterPath(clusterName)}/consumer-groups`;
  12. // Schemas
  13. export const clusterSchemasPath = (clusterName: ClusterName) =>
  14. `${clusterPath(clusterName)}/schemas`;
  15. export const clusterSchemaNewPath = (clusterName: ClusterName) =>
  16. `${clusterPath(clusterName)}/schemas/create_new`;
  17. export const clusterSchemaPath = (
  18. clusterName: ClusterName,
  19. subject: SchemaName
  20. ) => `${clusterSchemasPath(clusterName)}/${subject}/latest`;
  21. // Topics
  22. export const clusterTopicsPath = (clusterName: ClusterName) =>
  23. `${clusterPath(clusterName)}/topics`;
  24. export const clusterTopicNewPath = (clusterName: ClusterName) =>
  25. `${clusterPath(clusterName)}/topics/create_new`;
  26. export const clusterTopicPath = (
  27. clusterName: ClusterName,
  28. topicName: TopicName
  29. ) => `${clusterTopicsPath(clusterName)}/${topicName}`;
  30. export const clusterTopicSettingsPath = (
  31. clusterName: ClusterName,
  32. topicName: TopicName
  33. ) => `${clusterTopicsPath(clusterName)}/${topicName}/settings`;
  34. export const clusterTopicMessagesPath = (
  35. clusterName: ClusterName,
  36. topicName: TopicName
  37. ) => `${clusterTopicsPath(clusterName)}/${topicName}/messages`;
  38. export const clusterTopicEditPath = (
  39. clusterName: ClusterName,
  40. topicName: TopicName
  41. ) => `${clusterTopicsPath(clusterName)}/${topicName}/edit`;
  42. // Kafka Connect
  43. export const clusterConnectorsPath = (clusterName: ClusterName) =>
  44. `${clusterPath(clusterName)}/connectors`;