sunguroku пре 5 година
родитељ
комит
9eb5469cc8

+ 5 - 4
dashboard/src/main/home/dashboard/expanded-chart/graph/GraphDisplay.tsx

@@ -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 };
         }
     });
   }

+ 1 - 0
dashboard/src/shared/types.tsx

@@ -42,6 +42,7 @@ export interface NodeType {
   id: number,
   name: string,
   kind: string,
+  yaml: string,
   x: number,
   y: number,
   w: number,

+ 2 - 2
docker-compose.dev.yaml

@@ -32,7 +32,7 @@ services:
     ports:
       - 5400:5432
     volumes:
-      - db:/var/lib/postgresql/data
+      - database:/var/lib/postgresql/data
   nginx:
     image: nginx:mainline-alpine
     container_name: nginx
@@ -46,5 +46,5 @@ services:
       - webpack    
 
 volumes:
-  db:
+  database:
   metabase: