|
@@ -1,5 +1,9 @@
|
|
import React from 'react';
|
|
import React from 'react';
|
|
-import { TopicWithDetailedInfo, ClusterName } from 'redux/interfaces';
|
|
|
|
|
|
+import {
|
|
|
|
+ TopicWithDetailedInfo,
|
|
|
|
+ ClusterName,
|
|
|
|
+ TopicName,
|
|
|
|
+} from 'redux/interfaces';
|
|
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
|
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
|
import { Link, useParams } from 'react-router-dom';
|
|
import { Link, useParams } from 'react-router-dom';
|
|
import { clusterTopicNewPath } from 'lib/paths';
|
|
import { clusterTopicNewPath } from 'lib/paths';
|
|
@@ -16,6 +20,7 @@ interface Props {
|
|
externalTopics: TopicWithDetailedInfo[];
|
|
externalTopics: TopicWithDetailedInfo[];
|
|
totalPages: number;
|
|
totalPages: number;
|
|
fetchTopicsList(props: FetchTopicsListParams): void;
|
|
fetchTopicsList(props: FetchTopicsListParams): void;
|
|
|
|
+ deleteTopic(topicName: TopicName, clusterName: ClusterName): void;
|
|
}
|
|
}
|
|
|
|
|
|
const List: React.FC<Props> = ({
|
|
const List: React.FC<Props> = ({
|
|
@@ -24,6 +29,7 @@ const List: React.FC<Props> = ({
|
|
externalTopics,
|
|
externalTopics,
|
|
totalPages,
|
|
totalPages,
|
|
fetchTopicsList,
|
|
fetchTopicsList,
|
|
|
|
+ deleteTopic,
|
|
}) => {
|
|
}) => {
|
|
const { isReadOnly } = React.useContext(ClusterContext);
|
|
const { isReadOnly } = React.useContext(ClusterContext);
|
|
const { clusterName } = useParams<{ clusterName: ClusterName }>();
|
|
const { clusterName } = useParams<{ clusterName: ClusterName }>();
|
|
@@ -82,17 +88,23 @@ const List: React.FC<Props> = ({
|
|
<th>Total Partitions</th>
|
|
<th>Total Partitions</th>
|
|
<th>Out of sync replicas</th>
|
|
<th>Out of sync replicas</th>
|
|
<th>Type</th>
|
|
<th>Type</th>
|
|
|
|
+ <th> </th>
|
|
</tr>
|
|
</tr>
|
|
</thead>
|
|
</thead>
|
|
<tbody>
|
|
<tbody>
|
|
|
|
+ {items.map((topic) => (
|
|
|
|
+ <ListItem
|
|
|
|
+ clusterName={clusterName}
|
|
|
|
+ key={topic.name}
|
|
|
|
+ topic={topic}
|
|
|
|
+ deleteTopic={deleteTopic}
|
|
|
|
+ />
|
|
|
|
+ ))}
|
|
{items.length === 0 && (
|
|
{items.length === 0 && (
|
|
<tr>
|
|
<tr>
|
|
<td colSpan={10}>No topics found</td>
|
|
<td colSpan={10}>No topics found</td>
|
|
</tr>
|
|
</tr>
|
|
)}
|
|
)}
|
|
- {items.map((topic) => (
|
|
|
|
- <ListItem key={topic.name} topic={topic} />
|
|
|
|
- ))}
|
|
|
|
</tbody>
|
|
</tbody>
|
|
</table>
|
|
</table>
|
|
<Pagination totalPages={totalPages} />
|
|
<Pagination totalPages={totalPages} />
|