|
@@ -9,45 +9,54 @@ const NodeUsage: React.FunctionComponent<NodeUsageProps> = ({ node }) => {
|
|
|
const percentFormatter = (number: number) => `${Number(number).toFixed(2)}%`;
|
|
const percentFormatter = (number: number) => `${Number(number).toFixed(2)}%`;
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
- <Wrapper>
|
|
|
|
|
- <UsageWrapper>
|
|
|
|
|
- <span>
|
|
|
|
|
- <Bolded>Cpu Requested:</Bolded> {node?.cpu_reqs || "Loading..."}
|
|
|
|
|
- </span>
|
|
|
|
|
- <span>
|
|
|
|
|
- <Bolded>Memory Requested:</Bolded> {node?.memory_reqs || "Loading..."}
|
|
|
|
|
- </span>
|
|
|
|
|
- </UsageWrapper>
|
|
|
|
|
- <AllocatableWrapper>
|
|
|
|
|
- <span>
|
|
|
|
|
- <Bolded>Cpu Allocatable:</Bolded>
|
|
|
|
|
- {node?.allocatable_cpu || "Loading..."}
|
|
|
|
|
- </span>
|
|
|
|
|
- <span>
|
|
|
|
|
- <Bolded>Memory Allocatable:</Bolded>
|
|
|
|
|
- {node?.allocatable_memory || "Loading..."}
|
|
|
|
|
- </span>
|
|
|
|
|
- </AllocatableWrapper>
|
|
|
|
|
- <FractionUsageWrapper>
|
|
|
|
|
- <span>
|
|
|
|
|
- <Bolded>Cpu Usage:</Bolded>
|
|
|
|
|
- {node?.fraction_cpu_reqs
|
|
|
|
|
- ? percentFormatter(node?.fraction_cpu_reqs)
|
|
|
|
|
- : "Loading..."}
|
|
|
|
|
- </span>
|
|
|
|
|
- <span>
|
|
|
|
|
- <Bolded>Memory Usage:</Bolded>
|
|
|
|
|
- {node?.fraction_memory_reqs
|
|
|
|
|
- ? percentFormatter(node?.fraction_memory_reqs)
|
|
|
|
|
- : "Loading..."}
|
|
|
|
|
- </span>
|
|
|
|
|
- </FractionUsageWrapper>
|
|
|
|
|
- </Wrapper>
|
|
|
|
|
|
|
+ <NodeUsageWrapper>
|
|
|
|
|
+ <Help
|
|
|
|
|
+ href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu"
|
|
|
|
|
+ target="_blank"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span>How to read memory and cpu units</span>
|
|
|
|
|
+ <i className="material-icons">help_outline</i>
|
|
|
|
|
+ </Help>
|
|
|
|
|
+ <Wrapper>
|
|
|
|
|
+ <UsageWrapper>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <Bolded>Cpu Requested:</Bolded> {node?.cpu_reqs || "Loading..."}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <Bolded>Memory Requested:</Bolded>{" "}
|
|
|
|
|
+ {node?.memory_reqs || "Loading..."}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </UsageWrapper>
|
|
|
|
|
+ <AllocatableWrapper>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <Bolded>Cpu Allocatable:</Bolded>
|
|
|
|
|
+ {node?.allocatable_cpu || "Loading..."}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <Bolded>Memory Allocatable:</Bolded>
|
|
|
|
|
+ {node?.allocatable_memory || "Loading..."}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </AllocatableWrapper>
|
|
|
|
|
+ <FractionUsageWrapper>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <Bolded>Cpu Usage:</Bolded>
|
|
|
|
|
+ {node?.fraction_cpu_reqs
|
|
|
|
|
+ ? percentFormatter(node?.fraction_cpu_reqs)
|
|
|
|
|
+ : "Loading..."}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <Bolded>Memory Usage:</Bolded>
|
|
|
|
|
+ {node?.fraction_memory_reqs
|
|
|
|
|
+ ? percentFormatter(node?.fraction_memory_reqs)
|
|
|
|
|
+ : "Loading..."}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </FractionUsageWrapper>
|
|
|
|
|
+ </Wrapper>
|
|
|
|
|
+ </NodeUsageWrapper>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const Wrapper = styled.div`
|
|
const Wrapper = styled.div`
|
|
|
- margin: 16px 0px;
|
|
|
|
|
display: flex;
|
|
display: flex;
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
@@ -57,7 +66,7 @@ const UsageWrapper = styled.div`
|
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
|
line-height: 24px;
|
|
line-height: 24px;
|
|
|
:not(last-child) {
|
|
:not(last-child) {
|
|
|
- margin-left: 20px;
|
|
|
|
|
|
|
+ margin-right: 20px;
|
|
|
}
|
|
}
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
@@ -71,4 +80,24 @@ const Bolded = styled.span`
|
|
|
margin-right: 6px;
|
|
margin-right: 6px;
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
|
|
+const Help = styled.a`
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ margin-bottom: 5px;
|
|
|
|
|
+ width: fit-content;
|
|
|
|
|
+ :hover {
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ > i {
|
|
|
|
|
+ margin-left: 5px;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ }
|
|
|
|
|
+`;
|
|
|
|
|
+
|
|
|
|
|
+const NodeUsageWrapper = styled.div`
|
|
|
|
|
+ margin: 16px 0px;
|
|
|
|
|
+`;
|
|
|
|
|
+
|
|
|
export default NodeUsage;
|
|
export default NodeUsage;
|