-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Calvin Bui
authored and
Calvin Bui
committed
Sep 17, 2024
1 parent
a3b8128
commit e2d46d3
Showing
1 changed file
with
37 additions
and
37 deletions.
There are no files selected for viewing
74 changes: 37 additions & 37 deletions
74
extensions/argo/numa-rollout/numa-rollout-extension/ui/src/rollout/PipelineRollout.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,45 +1,45 @@ | ||
import React, { useContext } from "react"; | ||
import { RolloutComponentContext } from "./RolloutComponentWrapper"; | ||
import { Box } from "@mui/material"; | ||
import { SquareCheckIcon } from "../utils/SquareCheckIcon"; | ||
import { SquareCancelIcon } from "../utils/SquareCancelIcon"; | ||
import React, {useContext} from "react"; | ||
import {RolloutComponentContext} from "./RolloutComponentWrapper"; | ||
import {Box} from "@mui/material"; | ||
import {SquareCheckIcon} from "../utils/SquareCheckIcon"; | ||
import {SquareCancelIcon} from "../utils/SquareCancelIcon"; | ||
|
||
export const PipelineRollout = () => { | ||
const { props, kindToNodeMap } = useContext(RolloutComponentContext); | ||
const {props, kindToNodeMap} = useContext(RolloutComponentContext); | ||
const conditions = props?.resource?.status?.conditions | ||
const hasChildResourcesHealthy = conditions.some(condition => condition.type === 'ChildResourcesHealthy'); | ||
|
||
return ( | ||
<Box> | ||
<Box> | ||
{kindToNodeMap.get("Pipeline")?.map((node) => { | ||
return ( | ||
<Box key={node?.name}> | ||
<Box>Pipeline Name: {node?.name}</Box> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "row", | ||
width: "100%", | ||
backgroundColor: "#dee6eb", | ||
borderRadius: "3px", | ||
padding: "6px", | ||
flexWrap: "wrap", | ||
marginRight: "-3px", | ||
marginBottom: "-3px", | ||
}} | ||
> | ||
Pipeline Status:{" "} | ||
{hasChildResourcesHealthy ? ( | ||
<SquareCheckIcon tooltipTitle={node?.name} /> | ||
) : ( | ||
<SquareCancelIcon tooltipTitle={node?.name} /> | ||
)} | ||
</Box> | ||
<Box> | ||
<Box> | ||
{kindToNodeMap.get("Pipeline")?.map((node) => { | ||
return ( | ||
<Box key={node?.name}> | ||
<Box>Pipeline Name: {node?.name}</Box> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "row", | ||
width: "100%", | ||
backgroundColor: "#dee6eb", | ||
borderRadius: "3px", | ||
padding: "6px", | ||
flexWrap: "wrap", | ||
marginRight: "-3px", | ||
marginBottom: "-3px", | ||
}} | ||
> | ||
Pipeline Status:{" "} | ||
{hasChildResourcesHealthy ? ( | ||
<SquareCheckIcon tooltipTitle={node?.name}/> | ||
) : ( | ||
<SquareCancelIcon tooltipTitle={node?.name}/> | ||
)} | ||
</Box> | ||
</Box> | ||
); | ||
})} | ||
</Box> | ||
); | ||
})} | ||
</Box> | ||
</Box> | ||
); | ||
</Box> | ||
); | ||
}; |