|
@@ -16,23 +16,15 @@ import {
|
|
|
import ClusterContext from 'components/contexts/ClusterContext';
|
|
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
|
|
import { useClusters } from 'lib/hooks/api/clusters';
|
|
|
-import Brokers from 'components/Brokers/Brokers';
|
|
|
-import Topics from 'components/Topics/Topics';
|
|
|
-import Schemas from 'components/Schemas/Schemas';
|
|
|
-import Connect from 'components/Connect/Connect';
|
|
|
-import KsqlDb from 'components/KsqlDb/KsqlDb';
|
|
|
-import ConsumerGroups from 'components/ConsumerGroups/ConsumerGroups';
|
|
|
|
|
|
-// We can't use Lazy loading till we have a better way to update publicPath in runtime
|
|
|
-// Now java app replaces paths in builded index.html file.
|
|
|
-// const Brokers = React.lazy(() => import('components/Brokers/Brokers'));
|
|
|
-// const Topics = React.lazy(() => import('components/Topics/Topics'));
|
|
|
-// const Schemas = React.lazy(() => import('components/Schemas/Schemas'));
|
|
|
-// const Connect = React.lazy(() => import('components/Connect/Connect'));
|
|
|
-// const KsqlDb = React.lazy(() => import('components/KsqlDb/KsqlDb'));
|
|
|
-// const ConsumerGroups = React.lazy(
|
|
|
-// () => import('components/ConsumerGroups/ConsumerGroups')
|
|
|
-// );
|
|
|
+const Brokers = React.lazy(() => import('components/Brokers/Brokers'));
|
|
|
+const Topics = React.lazy(() => import('components/Topics/Topics'));
|
|
|
+const Schemas = React.lazy(() => import('components/Schemas/Schemas'));
|
|
|
+const Connect = React.lazy(() => import('components/Connect/Connect'));
|
|
|
+const KsqlDb = React.lazy(() => import('components/KsqlDb/KsqlDb'));
|
|
|
+const ConsumerGroups = React.lazy(
|
|
|
+ () => import('components/ConsumerGroups/ConsumerGroups')
|
|
|
+);
|
|
|
|
|
|
const Cluster: React.FC = () => {
|
|
|
const { clusterName } = useAppParams<ClusterNameRoute>();
|
|
@@ -59,49 +51,51 @@ const Cluster: React.FC = () => {
|
|
|
return (
|
|
|
<Suspense fallback={<PageLoader />}>
|
|
|
<ClusterContext.Provider value={contextValue}>
|
|
|
- <Routes>
|
|
|
- <Route
|
|
|
- path={getNonExactPath(clusterBrokerRelativePath)}
|
|
|
- element={<Brokers />}
|
|
|
- />
|
|
|
- <Route
|
|
|
- path={getNonExactPath(clusterTopicsRelativePath)}
|
|
|
- element={<Topics />}
|
|
|
- />
|
|
|
- <Route
|
|
|
- path={getNonExactPath(clusterConsumerGroupsRelativePath)}
|
|
|
- element={<ConsumerGroups />}
|
|
|
- />
|
|
|
- {contextValue.hasSchemaRegistryConfigured && (
|
|
|
+ <Suspense fallback={<PageLoader />}>
|
|
|
+ <Routes>
|
|
|
<Route
|
|
|
- path={getNonExactPath(clusterSchemasRelativePath)}
|
|
|
- element={<Schemas />}
|
|
|
+ path={getNonExactPath(clusterBrokerRelativePath)}
|
|
|
+ element={<Brokers />}
|
|
|
/>
|
|
|
- )}
|
|
|
- {contextValue.hasKafkaConnectConfigured && (
|
|
|
<Route
|
|
|
- path={getNonExactPath(clusterConnectsRelativePath)}
|
|
|
- element={<Connect />}
|
|
|
+ path={getNonExactPath(clusterTopicsRelativePath)}
|
|
|
+ element={<Topics />}
|
|
|
/>
|
|
|
- )}
|
|
|
- {contextValue.hasKafkaConnectConfigured && (
|
|
|
<Route
|
|
|
- path={getNonExactPath(clusterConnectorsRelativePath)}
|
|
|
- element={<Connect />}
|
|
|
+ path={getNonExactPath(clusterConsumerGroupsRelativePath)}
|
|
|
+ element={<ConsumerGroups />}
|
|
|
/>
|
|
|
- )}
|
|
|
- {contextValue.hasKsqlDbConfigured && (
|
|
|
+ {contextValue.hasSchemaRegistryConfigured && (
|
|
|
+ <Route
|
|
|
+ path={getNonExactPath(clusterSchemasRelativePath)}
|
|
|
+ element={<Schemas />}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {contextValue.hasKafkaConnectConfigured && (
|
|
|
+ <Route
|
|
|
+ path={getNonExactPath(clusterConnectsRelativePath)}
|
|
|
+ element={<Connect />}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {contextValue.hasKafkaConnectConfigured && (
|
|
|
+ <Route
|
|
|
+ path={getNonExactPath(clusterConnectorsRelativePath)}
|
|
|
+ element={<Connect />}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {contextValue.hasKsqlDbConfigured && (
|
|
|
+ <Route
|
|
|
+ path={getNonExactPath(clusterKsqlDbRelativePath)}
|
|
|
+ element={<KsqlDb />}
|
|
|
+ />
|
|
|
+ )}
|
|
|
<Route
|
|
|
- path={getNonExactPath(clusterKsqlDbRelativePath)}
|
|
|
- element={<KsqlDb />}
|
|
|
+ path="/"
|
|
|
+ element={<Navigate to={clusterBrokerRelativePath} replace />}
|
|
|
/>
|
|
|
- )}
|
|
|
- <Route
|
|
|
- path="/"
|
|
|
- element={<Navigate to={clusterBrokerRelativePath} replace />}
|
|
|
- />
|
|
|
- </Routes>
|
|
|
- <Outlet />
|
|
|
+ </Routes>
|
|
|
+ <Outlet />
|
|
|
+ </Suspense>
|
|
|
</ClusterContext.Provider>
|
|
|
</Suspense>
|
|
|
);
|