diff --git a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/nodes/rebalances/RebalanceTable.tsx b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/nodes/rebalances/RebalanceTable.tsx index b89dffba6..63a197c4e 100644 --- a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/nodes/rebalances/RebalanceTable.tsx +++ b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/nodes/rebalances/RebalanceTable.tsx @@ -14,6 +14,10 @@ import { DescriptionListTerm, DescriptionListDescription, Badge, + Popover, + List, + ListItem, + Tooltip, } from "@/libs/patternfly/react-core"; import { CheckIcon, @@ -21,6 +25,7 @@ import { PauseCircleIcon, PendingIcon, OutlinedClockIcon, + HelpIcon, } from "@/libs/patternfly/react-icons"; import Link from "next/link"; import React, { ReactNode } from "react"; @@ -34,80 +39,96 @@ export type RebalanceTableColumn = (typeof RebalanceTableColumns)[number]; const StatusLabel: Record = { New: ( - <> - - - -   New - + + + + + +   New + + ), PendingProposal: ( - <> - - - -  PendingProposal - + + + + + +  PendingProposal + + ), ProposalReady: ( - <> - - - -  ProposalReady - + + + + + +  ProposalReady + + ), Stopped: ( - <> - - stop icon - -  Stopped - + + + + stop icon + +  Stopped + + ), Rebalancing: ( - <> - - - -  Rebalancing - + + + + + +  Rebalancing + + ), NotReady: ( - <> - - - -  NotReady - + + + + + +  NotReady + + ), Ready: ( - <> - - - -  Ready - + + + + + +  Ready + + ), ReconciliationPaused: ( - <> - - - -  ReconciliationPaused - + + + + + +  ReconciliationPaused + + ), }; const ModeLabel: Record = { - full: <>full, - "add-brokers": <>add-brokers, - "remove-brokers": <>remove-brokers, + full: <>Full, + "add-brokers": <>Add, + "remove-brokers": <>Remove, }; export type RebalanceTabelProps = { @@ -192,7 +213,7 @@ export function RebalanceTable({ case "name": return ( - + {t("cr_badge")} {row.attributes.name} @@ -239,21 +260,13 @@ export function RebalanceTable({ } getExpandedRow={({ row }) => { return ( - + - - {t("mode")} - - {ModeLabel[row.attributes.mode]} - - - - {t("auto_approval_enabled")} @@ -263,14 +276,58 @@ export function RebalanceTable({ - + - {t("brokers")} + + {t("mode")} + {" "} + {t("rebalance_mode")}} + bodyContent={ +
+ + + {t.rich("full_mode")}  + {t("full_mode_description")} + + + {t.rich("add_brokers_mode")} +   + {t("add_brokers_mode_description")} + + + {t.rich("remove_brokers_mode")} +   + {t("remove_brokers_mode_description")} + + +
+ } + > + +
+
- {!row.attributes.brokers || - row.attributes.brokers.length === 0 - ? "N/A" - : row.attributes.brokers.join(",")} + {row.attributes.mode === "full" ? ( + ModeLabel[row.attributes.mode] + ) : ( + <> + {ModeLabel[row.attributes.mode]}{" "} + {row.attributes.brokers?.length + ? row.attributes.brokers.map((b, index) => ( + <> + + {t("broker", { b })} + + {index < + (row.attributes.brokers?.length || 0) - 1 && + ", "} + + )) + : ""} + + )}
diff --git a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/nodes/rebalances/page.tsx b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/nodes/rebalances/page.tsx index 9ef8338f2..1f5e9d504 100644 --- a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/nodes/rebalances/page.tsx +++ b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/nodes/rebalances/page.tsx @@ -42,9 +42,9 @@ export default function RebalancesPage({ }; }) { const name = searchParams["name"]; - const mode = (searchParams["mode"] || "") - .split(",") - .filter((v) => !!v) as RebalanceMode[] | undefined;; + const mode = (searchParams["mode"] || "").split(",").filter((v) => !!v) as + | RebalanceMode[] + | undefined; const pageSize = stringToInt(searchParams.perPage) || 20; const sort = (searchParams["sort"] || "name") as RebalanceTableColumn; const sortDir = (searchParams["sortDir"] || "asc") as "asc" | "desc"; @@ -69,7 +69,9 @@ export default function RebalancesPage({ nextPageCursor={undefined} prevPageCursor={undefined} mode={mode} - baseurl={`/kafka/${params.kafkaId}/nodes`} kafkaId={params.kafkaId} /> + baseurl={`/kafka/${params.kafkaId}/nodes`} + kafkaId={params.kafkaId} + /> } > Full mode:", + "full_mode_description": "Moves replicas across all brokers. This is the default mode", + "add_brokers_mode_description": "Moves replicas to newly added brokers. Brokers must be specified", + "add_brokers_mode": "Add-brokers mode:", + "remove_brokers_mode": "Remove-brokers mode:", + "remove_brokers_mode_description": "Moves replicas off brokers to be removed. Brokers must be specified", + "broker": "broker {b}" } }