paths.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. import {
  2. ClusterName,
  3. ConnectName,
  4. ConnectorName,
  5. SchemaName,
  6. TopicName,
  7. } from 'redux/interfaces';
  8. import { GIT_REPO_LINK } from './constants';
  9. export const gitCommitPath = (commit: string) =>
  10. `${GIT_REPO_LINK}/commit/${commit}`;
  11. export const clusterPath = (clusterName: ClusterName) =>
  12. `/ui/clusters/${clusterName}`;
  13. // Brokers
  14. export const clusterBrokersPath = (clusterName: ClusterName) =>
  15. `${clusterPath(clusterName)}/brokers`;
  16. // Consumer Groups
  17. export const clusterConsumerGroupsPath = (clusterName: ClusterName) =>
  18. `${clusterPath(clusterName)}/consumer-groups`;
  19. export const clusterConsumerGroupDetailsPath = (
  20. clusterName: ClusterName,
  21. groupId: string
  22. ) => `${clusterPath(clusterName)}/consumer-groups/${groupId}`;
  23. export const clusterConsumerGroupResetOffsetsPath = (
  24. clusterName: ClusterName,
  25. groupId: string
  26. ) => `${clusterPath(clusterName)}/consumer-groups/${groupId}/reset-offsets`;
  27. // Schemas
  28. export const clusterSchemasPath = (clusterName: ClusterName) =>
  29. `${clusterPath(clusterName)}/schemas`;
  30. export const clusterSchemaNewPath = (clusterName: ClusterName) =>
  31. `${clusterPath(clusterName)}/schemas/create-new`;
  32. export const clusterSchemaPath = (
  33. clusterName: ClusterName,
  34. subject: SchemaName
  35. ) => `${clusterSchemasPath(clusterName)}/${subject}`;
  36. export const clusterSchemaEditPath = (
  37. clusterName: ClusterName,
  38. subject: SchemaName
  39. ) => `${clusterSchemasPath(clusterName)}/${subject}/edit`;
  40. export const clusterSchemaSchemaDiffPath = (
  41. clusterName: ClusterName,
  42. subject: SchemaName
  43. ) => `${clusterSchemaPath(clusterName, subject)}/diff`;
  44. // Topics
  45. export const clusterTopicsPath = (clusterName: ClusterName) =>
  46. `${clusterPath(clusterName)}/topics`;
  47. export const clusterTopicNewPath = (clusterName: ClusterName) =>
  48. `${clusterPath(clusterName)}/topics/create-new`;
  49. export const clusterTopicPath = (
  50. clusterName: ClusterName,
  51. topicName: TopicName
  52. ) => `${clusterTopicsPath(clusterName)}/${topicName}`;
  53. export const clusterTopicSettingsPath = (
  54. clusterName: ClusterName,
  55. topicName: TopicName
  56. ) => `${clusterTopicsPath(clusterName)}/${topicName}/settings`;
  57. export const clusterTopicMessagesPath = (
  58. clusterName: ClusterName,
  59. topicName: TopicName
  60. ) => `${clusterTopicsPath(clusterName)}/${topicName}/messages`;
  61. export const clusterTopicEditPath = (
  62. clusterName: ClusterName,
  63. topicName: TopicName
  64. ) => `${clusterTopicsPath(clusterName)}/${topicName}/edit`;
  65. export const clusterTopicConsumerGroupsPath = (
  66. clusterName: ClusterName,
  67. topicName: TopicName
  68. ) => `${clusterTopicsPath(clusterName)}/${topicName}/consumer-groups`;
  69. export const clusterTopicSendMessagePath = (
  70. clusterName: ClusterName,
  71. topicName: TopicName
  72. ) => `${clusterTopicsPath(clusterName)}/${topicName}/message`;
  73. // Kafka Connect
  74. export const clusterConnectsPath = (clusterName: ClusterName) =>
  75. `${clusterPath(clusterName)}/connects`;
  76. export const clusterConnectorsPath = (clusterName: ClusterName) =>
  77. `${clusterPath(clusterName)}/connectors`;
  78. export const clusterConnectorNewPath = (clusterName: ClusterName) =>
  79. `${clusterConnectorsPath(clusterName)}/create-new`;
  80. export const clusterConnectConnectorsPath = (
  81. clusterName: ClusterName,
  82. connectName: ConnectName
  83. ) => `${clusterConnectsPath(clusterName)}/${connectName}/connectors`;
  84. export const clusterConnectConnectorPath = (
  85. clusterName: ClusterName,
  86. connectName: ConnectName,
  87. connectorName: ConnectorName
  88. ) =>
  89. `${clusterConnectConnectorsPath(clusterName, connectName)}/${connectorName}`;
  90. export const clusterConnectConnectorEditPath = (
  91. clusterName: ClusterName,
  92. connectName: ConnectName,
  93. connectorName: ConnectorName
  94. ) =>
  95. `${clusterConnectConnectorsPath(
  96. clusterName,
  97. connectName
  98. )}/${connectorName}/edit`;
  99. export const clusterConnectConnectorTasksPath = (
  100. clusterName: ClusterName,
  101. connectName: ConnectName,
  102. connectorName: ConnectorName
  103. ) =>
  104. `${clusterConnectConnectorPath(
  105. clusterName,
  106. connectName,
  107. connectorName
  108. )}/tasks`;
  109. export const clusterConnectConnectorConfigPath = (
  110. clusterName: ClusterName,
  111. connectName: ConnectName,
  112. connectorName: ConnectorName
  113. ) =>
  114. `${clusterConnectConnectorPath(
  115. clusterName,
  116. connectName,
  117. connectorName
  118. )}/config`;
  119. // KsqlDb
  120. export const clusterKsqlDbPath = (clusterName: ClusterName = ':clusterName') =>
  121. `${clusterPath(clusterName)}/ksql-db`;
  122. export const clusterKsqlDbQueryPath = (
  123. clusterName: ClusterName = ':clusterName'
  124. ) => `${clusterPath(clusterName)}/ksql-db/query`;