|
@@ -24,6 +24,7 @@ export type ControllerTabPodType = {
|
|
|
phase: string;
|
|
phase: string;
|
|
|
status: any;
|
|
status: any;
|
|
|
replicaSetName: string;
|
|
replicaSetName: string;
|
|
|
|
|
+ hash: string;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const ControllerTabFC: React.FunctionComponent<Props> = ({
|
|
const ControllerTabFC: React.FunctionComponent<Props> = ({
|
|
@@ -100,12 +101,14 @@ const ControllerTabFC: React.FunctionComponent<Props> = ({
|
|
|
const replicaSetName =
|
|
const replicaSetName =
|
|
|
Array.isArray(pod?.metadata?.ownerReferences) &&
|
|
Array.isArray(pod?.metadata?.ownerReferences) &&
|
|
|
pod?.metadata?.ownerReferences[0]?.name;
|
|
pod?.metadata?.ownerReferences[0]?.name;
|
|
|
|
|
+ const [hash] = (pod?.metadata?.name as string).split("-").reverse();
|
|
|
return {
|
|
return {
|
|
|
namespace: pod?.metadata?.namespace,
|
|
namespace: pod?.metadata?.namespace,
|
|
|
name: pod?.metadata?.name,
|
|
name: pod?.metadata?.name,
|
|
|
phase: pod?.status?.phase,
|
|
phase: pod?.status?.phase,
|
|
|
status: pod?.status,
|
|
status: pod?.status,
|
|
|
replicaSetName,
|
|
replicaSetName,
|
|
|
|
|
+ hash,
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -317,7 +320,7 @@ const ControllerTabFC: React.FunctionComponent<Props> = ({
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const mapPods = (podList: ControllerTabPodType[]) => {
|
|
const mapPods = (podList: ControllerTabPodType[]) => {
|
|
|
- return podList.map((pod, i) => {
|
|
|
|
|
|
|
+ return podList.map((pod, i, arr) => {
|
|
|
let status = getPodStatus(pod.status);
|
|
let status = getPodStatus(pod.status);
|
|
|
return (
|
|
return (
|
|
|
<PodRow
|
|
<PodRow
|
|
@@ -325,7 +328,7 @@ const ControllerTabFC: React.FunctionComponent<Props> = ({
|
|
|
pod={pod}
|
|
pod={pod}
|
|
|
isSelected={currentSelectedPod?.name === pod?.name}
|
|
isSelected={currentSelectedPod?.name === pod?.name}
|
|
|
podStatus={status}
|
|
podStatus={status}
|
|
|
- isLastItem={i === pods.length - 1}
|
|
|
|
|
|
|
+ isLastItem={i === arr.length - 1}
|
|
|
onTabClick={() => {
|
|
onTabClick={() => {
|
|
|
setPodError("");
|
|
setPodError("");
|
|
|
status === "failed" &&
|
|
status === "failed" &&
|
|
@@ -352,9 +355,17 @@ const ControllerTabFC: React.FunctionComponent<Props> = ({
|
|
|
{!!replicaSetArray.length &&
|
|
{!!replicaSetArray.length &&
|
|
|
replicaSetArray.map((subArray, index) => {
|
|
replicaSetArray.map((subArray, index) => {
|
|
|
const firstItem = subArray[0];
|
|
const firstItem = subArray[0];
|
|
|
|
|
+ const [replicaSetHash] = firstItem.replicaSetName
|
|
|
|
|
+ .split("-")
|
|
|
|
|
+ .reverse();
|
|
|
return (
|
|
return (
|
|
|
<div key={firstItem.replicaSetName + index}>
|
|
<div key={firstItem.replicaSetName + index}>
|
|
|
- {firstItem.replicaSetName}
|
|
|
|
|
|
|
+ <ReplicaSetContainer>
|
|
|
|
|
+ <ReplicaSetName>
|
|
|
|
|
+ ReplicaSet hash: {replicaSetHash}
|
|
|
|
|
+ </ReplicaSetName>
|
|
|
|
|
+ <div> Revision: V1.0</div>
|
|
|
|
|
+ </ReplicaSetContainer>
|
|
|
{mapPods(subArray)}
|
|
{mapPods(subArray)}
|
|
|
</div>
|
|
</div>
|
|
|
);
|
|
);
|
|
@@ -371,3 +382,11 @@ const ControllerTabFC: React.FunctionComponent<Props> = ({
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default ControllerTabFC;
|
|
export default ControllerTabFC;
|
|
|
|
|
+
|
|
|
|
|
+const ReplicaSetContainer = styled.div`
|
|
|
|
|
+ padding: 10px 5px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+`;
|
|
|
|
|
+
|
|
|
|
|
+const ReplicaSetName = styled.span``;
|