Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FE: Fix 'Online Partitions' column #607

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,3 @@ export const Skew = ({ getValue }: ScewProps) => {
/>
);
};

type OnlinePartitionsProps = CellContext<
BrokersTableRow,
BrokersTableRow['onlinePartitionCount']
>;

export const OnlinePartitions = ({ row }: OnlinePartitionsProps) => {
const { onlinePartitionCount, offlinePartitionCount } = row.original;

if (
onlinePartitionCount === undefined ||
offlinePartitionCount === undefined
) {
return null;
}

return (
<ColoredCell
value={onlinePartitionCount}
attention={offlinePartitionCount > 0}
/>
);
};
1 change: 1 addition & 0 deletions frontend/src/components/Brokers/BrokersList/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type BrokersTableRow = {
partitionsLeader: number | undefined;
partitionsSkew: number | undefined;
leadersSkew: number | undefined;
partitions: number | undefined;
onlinePartitionCount: number | undefined;
offlinePartitionCount: number | undefined;
activeControllers: number | undefined;
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/components/Brokers/BrokersList/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const getBrokersTableRows = ({
partitionsLeader: broker.partitionsLeader,
partitionsSkew: broker.partitionsSkew,
leadersSkew: broker.leadersSkew,
partitions: broker.partitions,
onlinePartitionCount,
offlinePartitionCount,
activeControllers,
Expand All @@ -59,19 +60,16 @@ export const getBrokersTableColumns = () => {
header: 'Disk usage',
cell: Cell.DiscUsage,
}),
columnHelper.accessor('partitions', { header: 'Partitions' }),
columnHelper.accessor('partitionsSkew', {
header: SkewHeader,
cell: Cell.Skew,
}),
columnHelper.accessor('partitionsLeader', { header: 'Leaders' }),
columnHelper.accessor('leadersSkew', {
header: 'Leader skew',
header: 'Leaders skew',
cell: Cell.Skew,
}),
columnHelper.accessor('onlinePartitionCount', {
header: 'Online partitions',
cell: Cell.OnlinePartitions,
}),
columnHelper.accessor('port', { header: 'Port' }),
columnHelper.accessor('host', { header: 'Host' }),
];
Expand Down
Loading