kafka-ui/kafka-ui-react-app/src/lib/paths.ts
Azat Gataullin 5d0b783abb
issue-31/add-ui-prefix-for-react-routes (#34)
* issue-31/add-ui-prefix-for-react-routes

* added route for /ui path (#40)

Co-authored-by: Roman Nedzvetskiy <roman@Romans-MacBook-Pro.local>

Co-authored-by: Roman Nedzvetskiy <gmcodemail@gmail.com>
Co-authored-by: Roman Nedzvetskiy <roman@Romans-MacBook-Pro.local>
2020-04-28 14:17:52 +03:00

25 lines
1 KiB
TypeScript

import { ClusterName, TopicName } from 'redux/interfaces';
const clusterPath = (clusterName: ClusterName) => `/ui/clusters/${clusterName}`;
export const clusterBrokersPath = (clusterName: ClusterName) =>
`${clusterPath(clusterName)}/brokers`;
export const clusterTopicsPath = (clusterName: ClusterName) =>
`${clusterPath(clusterName)}/topics`;
export const clusterTopicNewPath = (clusterName: ClusterName) =>
`${clusterPath(clusterName)}/topics/new`;
export const clusterConsumerGroupsPath = (clusterName: ClusterName) =>
`${clusterPath(clusterName)}/consumer-groups`;
export const clusterTopicPath = (
clusterName: ClusterName,
topicName: TopicName
) => `${clusterTopicsPath(clusterName)}/${topicName}`;
export const clusterTopicSettingsPath = (
clusterName: ClusterName,
topicName: TopicName
) => `${clusterTopicsPath(clusterName)}/${topicName}/settings`;
export const clusterTopicMessagesPath = (
clusterName: ClusterName,
topicName: TopicName
) => `${clusterTopicsPath(clusterName)}/${topicName}/messages`;