-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: hemahg <[email protected]>
- Loading branch information
Showing
11 changed files
with
421 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/app/[locale]/(authorized)/kafka/[kafkaId]/@activeBreadcrumb/nodes/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { BreadcrumbItem } from "@/libs/patternfly/react-core"; | ||
|
||
export default function TopicsActiveBreadcrumb() { | ||
export default function NodesActiveBreadcrumb() { | ||
return <BreadcrumbItem showDivider={true}>Brokers</BreadcrumbItem>; | ||
} |
5 changes: 5 additions & 0 deletions
5
ui/app/[locale]/(authorized)/kafka/[kafkaId]/@activeBreadcrumb/nodes/rebalances/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { BreadcrumbItem } from "@/libs/patternfly/react-core"; | ||
|
||
export default function RebalanceActiveBreadcrumb() { | ||
return <BreadcrumbItem showDivider={true}>Brokers</BreadcrumbItem>; | ||
} |
87 changes: 87 additions & 0 deletions
87
ui/app/[locale]/(authorized)/kafka/[kafkaId]/@header/nodes/rebalances/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { getKafkaCluster } from "@/api/kafka/actions"; | ||
import { KafkaParams } from "@/app/[locale]/(authorized)/kafka/[kafkaId]/kafka.params"; | ||
import { AppHeader } from "@/components/AppHeader"; | ||
import { Number } from "@/components/Format/Number"; | ||
import { NavItemLink } from "@/components/Navigation/NavItemLink"; | ||
import { | ||
Label, | ||
Nav, | ||
NavList, | ||
PageNavigation, | ||
Spinner, | ||
Split, | ||
SplitItem, | ||
} from "@/libs/patternfly/react-core"; | ||
import { CheckCircleIcon } from "@/libs/patternfly/react-icons"; | ||
import { Suspense } from "react"; | ||
|
||
export default function NodesHeader({ params }: { params: KafkaParams }) { | ||
return ( | ||
<Suspense | ||
fallback={<Header kafkaId={undefined} cruiseControlEnable={false} />} | ||
> | ||
<ConnectedHeader params={params} /> | ||
</Suspense> | ||
); | ||
} | ||
|
||
async function ConnectedHeader({ params }: { params: KafkaParams }) { | ||
const cluster = await getKafkaCluster(params.kafkaId); | ||
return ( | ||
<Header | ||
total={cluster?.attributes.nodes.length || 0} | ||
kafkaId={cluster?.id} | ||
cruiseControlEnable={cluster?.attributes.cruiseControlEnabled || false} | ||
/> | ||
); | ||
} | ||
|
||
function Header({ | ||
total, | ||
kafkaId, | ||
cruiseControlEnable, | ||
}: { | ||
total?: number; | ||
kafkaId: string | undefined; | ||
cruiseControlEnable: boolean; | ||
}) { | ||
return ( | ||
<AppHeader | ||
title={ | ||
<Split hasGutter={true}> | ||
<SplitItem>Brokers</SplitItem> | ||
<SplitItem> | ||
<Label | ||
color={"green"} | ||
icon={ | ||
total === undefined ? ( | ||
<Spinner size={"sm"} /> | ||
) : ( | ||
<CheckCircleIcon /> | ||
) | ||
} | ||
> | ||
{total && <Number value={total} />} | ||
</Label> | ||
</SplitItem> | ||
</Split> | ||
} | ||
navigation={ | ||
<PageNavigation> | ||
<Nav aria-label="Node navigation" variant="tertiary"> | ||
<NavList> | ||
<NavItemLink url={`/kafka/${kafkaId}/nodes`}> | ||
Overview | ||
</NavItemLink> | ||
{cruiseControlEnable && ( | ||
<NavItemLink url={`/kafka/${kafkaId}/nodes/rebalances`}> | ||
Rebalance | ||
</NavItemLink> | ||
)} | ||
</NavList> | ||
</Nav> | ||
</PageNavigation> | ||
} | ||
/> | ||
); | ||
} |
Oops, something went wrong.