Skip to content

Commit 0cd7488

Browse files
committed
split isr & replicas
1 parent fec6862 commit 0cd7488

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,12 @@ type InSyncReplicasProps = CellContext<
7878
BrokersTableRow['inSyncReplicas']
7979
>;
8080

81-
export const InSyncReplicas = ({ row }: InSyncReplicasProps) => {
82-
const { replicas, inSyncReplicas } = row.original;
81+
export const InSyncReplicas = ({ getValue }: InSyncReplicasProps) => {
82+
return <ColoredCell value={getValue() || ''} />;
83+
};
8384

84-
if (
85-
replicas === undefined ||
86-
inSyncReplicas === undefined
87-
) {
88-
return null;
89-
}
90-
const value = `${inSyncReplicas} of ${replicas}`;
85+
type ReplicasProps = CellContext<BrokersTableRow, BrokersTableRow['replicas']>;
9186

92-
return (
93-
<ColoredCell
94-
value={value}
95-
attention={inSyncReplicas < replicas}
96-
/>
97-
);
87+
export const Replicas = ({ getValue }: ReplicasProps) => {
88+
return <ColoredCell value={getValue() || ''} />;
9889
};

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ export const getBrokersTableColumns = () => {
6161
header: 'In Sync Replicas',
6262
cell: Cell.InSyncReplicas,
6363
}),
64+
columnHelper.accessor('replicas', {
65+
header: 'Replicas',
66+
cell: Cell.Replicas,
67+
}),
6468
columnHelper.accessor('replicasSkew', {
6569
header: SkewHeader,
6670
cell: Cell.Skew,

0 commit comments

Comments
 (0)