|
@@ -1,9 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import {
|
|
|
- Switch,
|
|
|
- Route,
|
|
|
- Redirect,
|
|
|
-} from 'react-router-dom';
|
|
|
+import { Switch, Route, Redirect } from 'react-router-dom';
|
|
|
import './App.scss';
|
|
|
import BrokersContainer from './Brokers/BrokersContainer';
|
|
|
import TopicsContainer from './Topics/TopicsContainer';
|
|
@@ -21,13 +17,19 @@ const App: React.FC<AppProps> = ({
|
|
|
isClusterListFetched,
|
|
|
fetchClustersList,
|
|
|
}) => {
|
|
|
- React.useEffect(() => { fetchClustersList() }, [fetchClustersList]);
|
|
|
+ React.useEffect(() => {
|
|
|
+ fetchClustersList();
|
|
|
+ }, [fetchClustersList]);
|
|
|
|
|
|
return (
|
|
|
<div className="Layout">
|
|
|
- <nav className="navbar is-fixed-top is-white Layout__header" role="navigation" aria-label="main navigation">
|
|
|
+ <nav
|
|
|
+ className="navbar is-fixed-top is-white Layout__header"
|
|
|
+ role="navigation"
|
|
|
+ aria-label="main navigation"
|
|
|
+ >
|
|
|
<div className="navbar-brand">
|
|
|
- <a className="navbar-item title is-5 is-marginless" href="/">
|
|
|
+ <a className="navbar-item title is-5 is-marginless" href="/ui">
|
|
|
Kafka UI
|
|
|
</a>
|
|
|
</div>
|
|
@@ -36,17 +38,31 @@ const App: React.FC<AppProps> = ({
|
|
|
<NavConatiner className="Layout__navbar" />
|
|
|
{isClusterListFetched ? (
|
|
|
<Switch>
|
|
|
- <Route exact path="/" component={Dashboard} />
|
|
|
- <Route exact path="/clusters" component={Dashboard} />
|
|
|
- <Route path="/clusters/:clusterName/topics" component={TopicsContainer} />
|
|
|
- <Route path="/clusters/:clusterName/brokers" component={BrokersContainer} />
|
|
|
- <Route path="/clusters/:clusterName/consumer-groups" component={ConsumersGroupsContainer} />
|
|
|
- <Redirect from="/clusters/:clusterName" to="/clusters/:clusterName/brokers" />
|
|
|
+ <Route
|
|
|
+ exact
|
|
|
+ path={['/', '/ui', '/ui/clusters']}
|
|
|
+ component={Dashboard}
|
|
|
+ />
|
|
|
+ <Route
|
|
|
+ path="/ui/clusters/:clusterName/brokers"
|
|
|
+ component={BrokersContainer}
|
|
|
+ />
|
|
|
+ <Route
|
|
|
+ path="/ui/clusters/:clusterName/topics"
|
|
|
+ component={TopicsContainer}
|
|
|
+ />
|
|
|
+ <Route
|
|
|
+ path="/ui/clusters/:clusterName/consumer-groups"
|
|
|
+ component={ConsumersGroupsContainer}
|
|
|
+ />
|
|
|
+ <Redirect
|
|
|
+ from="/ui/clusters/:clusterName"
|
|
|
+ to="/ui/clusters/:clusterName/brokers"
|
|
|
+ />
|
|
|
</Switch>
|
|
|
) : (
|
|
|
<PageLoader />
|
|
|
)}
|
|
|
-
|
|
|
</main>
|
|
|
</div>
|
|
|
);
|