paths.ts 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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 clusterSchemaSchemaEditPath = (
  37. clusterName: ClusterName,
  38. subject: SchemaName
  39. ) => `${clusterSchemasPath(clusterName)}/${subject}/edit`;
  40. // Topics
  41. export const clusterTopicsPath = (clusterName: ClusterName) =>
  42. `${clusterPath(clusterName)}/topics`;
  43. export const clusterTopicNewPath = (clusterName: ClusterName) =>
  44. `${clusterPath(clusterName)}/topics/create-new`;
  45. export const clusterTopicPath = (
  46. clusterName: ClusterName,
  47. topicName: TopicName
  48. ) => `${clusterTopicsPath(clusterName)}/${topicName}`;
  49. export const clusterTopicSettingsPath = (
  50. clusterName: ClusterName,
  51. topicName: TopicName
  52. ) => `${clusterTopicsPath(clusterName)}/${topicName}/settings`;
  53. export const clusterTopicMessagesPath = (
  54. clusterName: ClusterName,
  55. topicName: TopicName
  56. ) => `${clusterTopicsPath(clusterName)}/${topicName}/messages`;
  57. export const clusterTopicEditPath = (
  58. clusterName: ClusterName,
  59. topicName: TopicName
  60. ) => `${clusterTopicsPath(clusterName)}/${topicName}/edit`;
  61. export const clusterTopicConsumerGroupsPath = (
  62. clusterName: ClusterName,
  63. topicName: TopicName
  64. ) => `${clusterTopicsPath(clusterName)}/${topicName}/consumer-groups`;
  65. export const clusterTopicSendMessagePath = (
  66. clusterName: ClusterName,
  67. topicName: TopicName
  68. ) => `${clusterTopicsPath(clusterName)}/${topicName}/message`;
  69. // Kafka Connect
  70. export const clusterConnectsPath = (clusterName: ClusterName) =>
  71. `${clusterPath(clusterName)}/connects`;
  72. export const clusterConnectorsPath = (clusterName: ClusterName) =>
  73. `${clusterPath(clusterName)}/connectors`;
  74. export const clusterConnectorNewPath = (clusterName: ClusterName) =>
  75. `${clusterConnectorsPath(clusterName)}/create-new`;
  76. const clusterConnectConnectorsPath = (
  77. clusterName: ClusterName,
  78. connectName: ConnectName
  79. ) => `${clusterConnectsPath(clusterName)}/${connectName}/connectors`;
  80. export const clusterConnectConnectorPath = (
  81. clusterName: ClusterName,
  82. connectName: ConnectName,
  83. connectorName: ConnectorName
  84. ) =>
  85. `${clusterConnectConnectorsPath(clusterName, connectName)}/${connectorName}`;
  86. export const clusterConnectConnectorEditPath = (
  87. clusterName: ClusterName,
  88. connectName: ConnectName,
  89. connectorName: ConnectorName
  90. ) =>
  91. `${clusterConnectConnectorsPath(
  92. clusterName,
  93. connectName
  94. )}/${connectorName}/edit`;
  95. export const clusterConnectConnectorTasksPath = (
  96. clusterName: ClusterName,
  97. connectName: ConnectName,
  98. connectorName: ConnectorName
  99. ) =>
  100. `${clusterConnectConnectorPath(
  101. clusterName,
  102. connectName,
  103. connectorName
  104. )}/tasks`;
  105. export const clusterConnectConnectorConfigPath = (
  106. clusterName: ClusterName,
  107. connectName: ConnectName,
  108. connectorName: ConnectorName
  109. ) =>
  110. `${clusterConnectConnectorPath(
  111. clusterName,
  112. connectName,
  113. connectorName
  114. )}/config`;
  115. // KsqlDb
  116. export const clusterKsqlDbPath = (clusterName: ClusterName = ':clusterName') =>
  117. `${clusterPath(clusterName)}/ksql-db`;
  118. export const clusterKsqlDbQueryPath = (
  119. clusterName: ClusterName = ':clusterName'
  120. ) => `${clusterPath(clusterName)}/ksql-db/query`;