paths.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { ClusterName, SchemaName, TopicName } from 'redux/interfaces';
  2. const clusterPath = (clusterName: ClusterName) => `/ui/clusters/${clusterName}`;
  3. export const clusterBrokersPath = (clusterName: ClusterName) =>
  4. `${clusterPath(clusterName)}/brokers`;
  5. export const clusterTopicsPath = (clusterName: ClusterName) =>
  6. `${clusterPath(clusterName)}/topics`;
  7. export const clusterTopicNewPath = (clusterName: ClusterName) =>
  8. `${clusterPath(clusterName)}/topics/new`;
  9. export const clusterConsumerGroupsPath = (clusterName: ClusterName) =>
  10. `${clusterPath(clusterName)}/consumer-groups`;
  11. export const clusterSchemasPath = (clusterName: ClusterName) =>
  12. `${clusterPath(clusterName)}/schemas`;
  13. export const clusterSchemaNewPath = (clusterName: ClusterName) =>
  14. `${clusterPath(clusterName)}/schemas/new`;
  15. export const clusterTopicPath = (
  16. clusterName: ClusterName,
  17. topicName: TopicName
  18. ) => `${clusterTopicsPath(clusterName)}/${topicName}`;
  19. export const clusterTopicSettingsPath = (
  20. clusterName: ClusterName,
  21. topicName: TopicName
  22. ) => `${clusterTopicsPath(clusterName)}/${topicName}/settings`;
  23. export const clusterTopicMessagesPath = (
  24. clusterName: ClusterName,
  25. topicName: TopicName
  26. ) => `${clusterTopicsPath(clusterName)}/${topicName}/messages`;
  27. export const clusterTopicsTopicEditPath = (
  28. clusterName: ClusterName,
  29. topicName: TopicName
  30. ) => `${clusterTopicsPath(clusterName)}/${topicName}/edit`;
  31. export const clusterSchemaPath = (
  32. clusterName: ClusterName,
  33. subject: SchemaName
  34. ) => `${clusterSchemasPath(clusterName)}/${subject}/latest`;