Skip to content

Commit bc640d7

Browse files
committed
refactor 'Online Partitions' column
1 parent 3a94e13 commit bc640d7

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

frontend/src/components/Brokers/BrokersList/TableCells/TableCells.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,3 @@ export const Skew = ({ getValue }: ScewProps) => {
7272
/>
7373
);
7474
};
75-
76-
type OnlinePartitionsProps = CellContext<
77-
BrokersTableRow,
78-
BrokersTableRow['inSyncPartitions']
79-
>;
80-
81-
export const OnlinePartitions = ({ row }: OnlinePartitionsProps) => {
82-
const { count, inSyncPartitions } = row.original;
83-
84-
if (count === undefined || inSyncPartitions === undefined) {
85-
return null;
86-
}
87-
88-
return (
89-
<ColoredCell
90-
value={inSyncPartitions}
91-
attention={inSyncPartitions !== count}
92-
/>
93-
);
94-
};

frontend/src/components/Brokers/BrokersList/lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type BrokersTableRow = {
77
partitionsLeader: number | undefined;
88
partitionsSkew: number | undefined;
99
leadersSkew: number | undefined;
10-
inSyncPartitions: number | undefined;
10+
partitions: number | undefined;
1111
onlinePartitionCount: number | undefined;
1212
offlinePartitionCount: number | undefined;
1313
activeControllers: number | undefined;

frontend/src/components/Brokers/BrokersList/lib/utils.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const getBrokersTableRows = ({
4040
partitionsLeader: broker.partitionsLeader,
4141
partitionsSkew: broker.partitionsSkew,
4242
leadersSkew: broker.leadersSkew,
43-
inSyncPartitions: broker.inSyncPartitions,
43+
partitions: broker.partitions,
4444
onlinePartitionCount,
4545
offlinePartitionCount,
4646
activeControllers,
@@ -60,19 +60,16 @@ export const getBrokersTableColumns = () => {
6060
header: 'Disk usage',
6161
cell: Cell.DiscUsage,
6262
}),
63+
columnHelper.accessor('partitions', { header: 'Partitions' }),
6364
columnHelper.accessor('partitionsSkew', {
6465
header: SkewHeader,
6566
cell: Cell.Skew,
6667
}),
6768
columnHelper.accessor('partitionsLeader', { header: 'Leaders' }),
6869
columnHelper.accessor('leadersSkew', {
69-
header: 'Leader skew',
70+
header: 'Leaders skew',
7071
cell: Cell.Skew,
7172
}),
72-
columnHelper.accessor('inSyncPartitions', {
73-
header: 'Online partitions',
74-
cell: Cell.OnlinePartitions,
75-
}),
7673
columnHelper.accessor('port', { header: 'Port' }),
7774
columnHelper.accessor('host', { header: 'Host' }),
7875
];

0 commit comments

Comments
 (0)