|
|
@@ -110,23 +110,24 @@ export default class GraphDisplay extends Component<PropsType, StateType> {
|
|
|
|
|
|
createNodes = (components: ResourceType[]) => {
|
|
|
return components.map((c: ResourceType) => {
|
|
|
+ let yaml = JSON.stringify(c.RawYAML)
|
|
|
switch(c.Kind) {
|
|
|
case "ClusterRoleBinding":
|
|
|
case "ClusterRole":
|
|
|
case "RoleBinding":
|
|
|
case "Role":
|
|
|
- return { id: c.ID, name: c.Name, kind: c.Kind, x: this.getRandomIntBetweenRange(-1000, 0), y: this.getRandomIntBetweenRange(0, 500), w: 40, h: 40 };
|
|
|
+ return { id: c.ID, yaml, name: c.Name, kind: c.Kind, x: this.getRandomIntBetweenRange(-1000, 0), y: this.getRandomIntBetweenRange(0, 500), w: 40, h: 40 };
|
|
|
case "Deployment":
|
|
|
case "StatefulSet":
|
|
|
case "Pod":
|
|
|
case "ServiceAccount":
|
|
|
- return { id: c.ID, name: c.Name, kind: c.Kind, x: this.getRandomIntBetweenRange(0, 1000), y: this.getRandomIntBetweenRange(0, 500), w: 40, h: 40 };
|
|
|
+ return { id: c.ID, yaml, name: c.Name, kind: c.Kind, x: this.getRandomIntBetweenRange(0, 1000), y: this.getRandomIntBetweenRange(0, 500), w: 40, h: 40 };
|
|
|
case "Service":
|
|
|
case "Ingress":
|
|
|
case "ServiceAccount":
|
|
|
- return { id: c.ID, name: c.Name, kind: c.Kind, x: this.getRandomIntBetweenRange(0, 1000), y: this.getRandomIntBetweenRange(-500, 0), w: 40, h: 40 };
|
|
|
+ return { id: c.ID, yaml, name: c.Name, kind: c.Kind, x: this.getRandomIntBetweenRange(0, 1000), y: this.getRandomIntBetweenRange(-500, 0), w: 40, h: 40 };
|
|
|
default:
|
|
|
- return { id: c.ID, name: c.Name, kind: c.Kind, x: this.getRandomIntBetweenRange(-700, 0), y: this.getRandomIntBetweenRange(-500, 0), w: 40, h: 40 };
|
|
|
+ return { id: c.ID, yaml, name: c.Name, kind: c.Kind, x: this.getRandomIntBetweenRange(-700, 0), y: this.getRandomIntBetweenRange(-500, 0), w: 40, h: 40 };
|
|
|
}
|
|
|
});
|
|
|
}
|