Skip to content

Commit e9260cf

Browse files
authored
fix broker hosts and ports bug (#1881)
1 parent 62f4778 commit e9260cf

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

kafka-ui-react-app/src/components/Brokers/Brokers.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,21 @@ const Brokers: React.FC = () => {
128128

129129
{diskUsage &&
130130
diskUsage.length !== 0 &&
131-
diskUsage.map(({ brokerId, segmentSize, segmentCount }) => (
132-
<tr key={brokerId}>
133-
<td>{brokerId}</td>
134-
<td>
135-
<BytesFormatted value={segmentSize} />
136-
</td>
137-
<td>{segmentCount}</td>
138-
<td>{items && items[brokerId]?.port}</td>
139-
<td>{items && items[brokerId]?.host}</td>
140-
</tr>
141-
))}
131+
diskUsage.map(({ brokerId, segmentSize, segmentCount }) => {
132+
const brokerItem = items?.find((item) => item.id === brokerId);
133+
134+
return (
135+
<tr key={brokerId}>
136+
<td>{brokerId}</td>
137+
<td>
138+
<BytesFormatted value={segmentSize} />
139+
</td>
140+
<td>{segmentCount}</td>
141+
<td>{brokerItem?.port}</td>
142+
<td>{brokerItem?.host}</td>
143+
</tr>
144+
);
145+
})}
142146
</tbody>
143147
</Table>
144148
</>

0 commit comments

Comments
 (0)