|
@@ -6,18 +6,21 @@ import EditContainer from 'components/Topics/Edit/EditContainer';
|
|
import ListContainer from './List/ListContainer';
|
|
import ListContainer from './List/ListContainer';
|
|
import DetailsContainer from './Details/DetailsContainer';
|
|
import DetailsContainer from './Details/DetailsContainer';
|
|
import NewContainer from './New/NewContainer';
|
|
import NewContainer from './New/NewContainer';
|
|
|
|
+import ClusterContext from '../contexts/ClusterContext';
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
clusterName: ClusterName;
|
|
clusterName: ClusterName;
|
|
isFetched: boolean;
|
|
isFetched: boolean;
|
|
fetchBrokers: (clusterName: ClusterName) => void;
|
|
fetchBrokers: (clusterName: ClusterName) => void;
|
|
fetchTopicsList: (clusterName: ClusterName) => void;
|
|
fetchTopicsList: (clusterName: ClusterName) => void;
|
|
|
|
+ isReadOnly: boolean;
|
|
}
|
|
}
|
|
|
|
|
|
const Topics: React.FC<Props> = ({
|
|
const Topics: React.FC<Props> = ({
|
|
clusterName,
|
|
clusterName,
|
|
isFetched,
|
|
isFetched,
|
|
fetchTopicsList,
|
|
fetchTopicsList,
|
|
|
|
+ isReadOnly,
|
|
}) => {
|
|
}) => {
|
|
React.useEffect(() => {
|
|
React.useEffect(() => {
|
|
fetchTopicsList(clusterName);
|
|
fetchTopicsList(clusterName);
|
|
@@ -25,27 +28,29 @@ const Topics: React.FC<Props> = ({
|
|
|
|
|
|
if (isFetched) {
|
|
if (isFetched) {
|
|
return (
|
|
return (
|
|
- <Switch>
|
|
|
|
- <Route
|
|
|
|
- exact
|
|
|
|
- path="/ui/clusters/:clusterName/topics"
|
|
|
|
- component={ListContainer}
|
|
|
|
- />
|
|
|
|
- <Route
|
|
|
|
- exact
|
|
|
|
- path="/ui/clusters/:clusterName/topics/new"
|
|
|
|
- component={NewContainer}
|
|
|
|
- />
|
|
|
|
- <Route
|
|
|
|
- exact
|
|
|
|
- path="/ui/clusters/:clusterName/topics/:topicName/edit"
|
|
|
|
- component={EditContainer}
|
|
|
|
- />
|
|
|
|
- <Route
|
|
|
|
- path="/ui/clusters/:clusterName/topics/:topicName"
|
|
|
|
- component={DetailsContainer}
|
|
|
|
- />
|
|
|
|
- </Switch>
|
|
|
|
|
|
+ <ClusterContext.Provider value={{ isReadOnly }}>
|
|
|
|
+ <Switch>
|
|
|
|
+ <Route
|
|
|
|
+ exact
|
|
|
|
+ path="/ui/clusters/:clusterName/topics"
|
|
|
|
+ component={ListContainer}
|
|
|
|
+ />
|
|
|
|
+ <Route
|
|
|
|
+ exact
|
|
|
|
+ path="/ui/clusters/:clusterName/topics/new"
|
|
|
|
+ component={NewContainer}
|
|
|
|
+ />
|
|
|
|
+ <Route
|
|
|
|
+ exact
|
|
|
|
+ path="/ui/clusters/:clusterName/topics/:topicName/edit"
|
|
|
|
+ component={EditContainer}
|
|
|
|
+ />
|
|
|
|
+ <Route
|
|
|
|
+ path="/ui/clusters/:clusterName/topics/:topicName"
|
|
|
|
+ component={DetailsContainer}
|
|
|
|
+ />
|
|
|
|
+ </Switch>
|
|
|
|
+ </ClusterContext.Provider>
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|