소스 검색

provisioning

sunguroku 5 년 전
부모
커밋
cc27be46eb
2개의 변경된 파일10개의 추가작업 그리고 19개의 파일을 삭제
  1. 8 19
      dashboard/src/main/home/new-project/Provisioner.tsx
  2. 2 0
      dashboard/src/main/home/sidebar/ClusterSection.tsx

+ 8 - 19
dashboard/src/main/home/new-project/Provisioner.tsx

@@ -54,6 +54,7 @@ export default class Provisioner extends Component<PropsType, StateType> {
 
 
     ws.onmessage = (evt: MessageEvent) => {
     ws.onmessage = (evt: MessageEvent) => {
       let event = JSON.parse(evt.data);
       let event = JSON.parse(evt.data);
+      console.log(event)
       let validEvents = [] as any[];
       let validEvents = [] as any[];
       let err = null;
       let err = null;
       
       
@@ -137,22 +138,7 @@ export default class Provisioner extends Component<PropsType, StateType> {
       return this.setupWebsocket(ws, infra)
       return this.setupWebsocket(ws, infra)
     });
     });
 
 
-    viewData.forEach(async (infra: any) => {
-      await new Promise((next: (res?: any) => void) => {
-        if (!this.state.maxStep[infra.kind] || !this.state.maxStep[infra.kind]["total_resources"]) {
-          this.setState({
-            maxStep: {
-              ...this.state.maxStep,
-              [infra.kind] : 10
-            }
-          }, () => {
-            next()
-          })
-        }
-      })
-    })
-
-    this.setState({ websockets, logs: [] });
+    this.setState({ websockets, logs: ["Provisioning EKS cluster and ECR registry..."] });
   }
   }
 
 
   componentWillUnmount() {
   componentWillUnmount() {
@@ -210,12 +196,15 @@ export default class Provisioner extends Component<PropsType, StateType> {
     let currentStep = 0;
     let currentStep = 0;
 
 
     for (let key in this.state.maxStep) {
     for (let key in this.state.maxStep) {
-      console.log(key)
-      maxStep += this.state.maxStep[key]
+      if (key == 'eks') {
+        maxStep += this.state.maxStep[key]
+      }
     }
     }
 
 
     for (let key in this.state.currentStep) {
     for (let key in this.state.currentStep) {
-      currentStep += this.state.currentStep[key]
+      if (key == 'eks') {
+        currentStep += this.state.currentStep[key]
+      }
     }
     }
 
 
     if (maxStep !== 0 && currentStep === maxStep) {
     if (maxStep !== 0 && currentStep === maxStep) {

+ 2 - 0
dashboard/src/main/home/sidebar/ClusterSection.tsx

@@ -76,9 +76,11 @@ export default class ClusterSection extends Component<PropsType, StateType> {
 
 
       // Refresh clusters on project change 
       // Refresh clusters on project change 
       if (this.state.prevProjectId !== this.context.currentProject.id && this.props.currentView !== 'provisioner') {
       if (this.state.prevProjectId !== this.context.currentProject.id && this.props.currentView !== 'provisioner') {
+        console.log("HERE")
         this.updateClusters();
         this.updateClusters();
         this.setState({ prevProjectId: this.context.currentProject.id });
         this.setState({ prevProjectId: this.context.currentProject.id });
       } else if (this.props.forceRefreshClusters === true) {
       } else if (this.props.forceRefreshClusters === true) {
+        console.log("HERE2")
         this.updateClusters();
         this.updateClusters();
         this.props.setRefreshClusters(false);
         this.props.setRefreshClusters(false);
       }
       }