sunguroku 5 лет назад
Родитель
Сommit
3087cc2be9

+ 21 - 21
dashboard/src/main/home/provisioner/GCPFormSection.tsx

@@ -157,16 +157,16 @@ class GCPFormSection extends Component<PropsType, StateType> {
     let { currentProject } = this.context;
     let { handleError } = this.props;
 
-    api.createGCR('<token>', {
-      gcp_integration_id: id,
-    }, { project_id: currentProject.id }, (err: any, res: any) => {
-      if (err) {
-        console.log(err);
-        handleError();
-        return;
-      }
-      callback && callback();
-    });
+    // api.createGCR('<token>', {
+    //   gcp_integration_id: id,
+    // }, { project_id: currentProject.id }, (err: any, res: any) => {
+    //   if (err) {
+    //     console.log(err);
+    //     handleError();
+    //     return;
+    //   }
+    callback && callback();
+    // });
   }
 
   provisionGKE = (id: number) => {
@@ -175,17 +175,17 @@ class GCPFormSection extends Component<PropsType, StateType> {
     let { currentProject } = this.context;
 
     let clusterName = `${currentProject.name}-cluster`
-    api.createGKE('<token>', {
-      gke_name: clusterName,
-      gcp_integration_id: id,
-    }, { project_id: currentProject.id }, (err: any, res: any) => {
-      if (err) {
-        console.log(err);
-        handleError();
-        return;
-      }
-      this.props.history.push("dashboard?tab=provisioner");
-    })
+    // api.createGKE('<token>', {
+    //   gke_name: clusterName,
+    //   gcp_integration_id: id,
+    // }, { project_id: currentProject.id }, (err: any, res: any) => {
+    //   if (err) {
+    //     console.log(err);
+    //     handleError();
+    //     return;
+    //   }
+    this.props.history.push("dashboard?tab=provisioner");
+    // })
   }
 
   handleCreateFlow = () => {

+ 4 - 4
dashboard/src/main/home/provisioner/Provisioner.tsx

@@ -4,10 +4,9 @@ import posthog from 'posthog-js';
 
 import api from 'shared/api';
 import { Context } from 'shared/Context';
-import ansiparse from 'shared/ansiparser'
 import loading from 'assets/loading.gif';
 import warning from 'assets/warning.png';
-import { InfraType } from 'shared/types';
+import { InfraType, ProjectType } from 'shared/types';
 import Loading from 'components/Loading';
 
 import Helper from 'components/values-form/Helper';
@@ -28,6 +27,7 @@ type StateType = {
   infras: InfraType[],
   loading: boolean,
   selectedInfra: InfraType,
+  currentProject: ProjectType,
 };
 
 class Provisioner extends Component<PropsType, StateType> {
@@ -41,6 +41,7 @@ class Provisioner extends Component<PropsType, StateType> {
     infras: [] as InfraType[],
     selectedInfra: null as InfraType,
     loading: true,
+    currentProject: this.context.currentProject,
   }
 
   selectInfra = (infra: InfraType) => {
@@ -48,7 +49,7 @@ class Provisioner extends Component<PropsType, StateType> {
   }
 
   componentDidMount() {
-    let { currentProject } = this.context;
+    let { currentProject } = this.state;
 
     api.getInfra('<token>', {}, { 
       project_id: currentProject.id 
@@ -65,7 +66,6 @@ class Provisioner extends Component<PropsType, StateType> {
   }
 
   render() {
-    console.log(this.state.infras)
     if (this.state.loading) {
       return (
         <StyledProvisioner> 

+ 1 - 2
dashboard/src/main/home/provisioner/ProvisionerLogs.tsx

@@ -35,7 +35,6 @@ class ProvisionerLogs extends Component<PropsType, StateType> {
   parentRef = React.createRef<HTMLDivElement>()
 
   scrollToBottom = () => {
-    console.log(this.parentRef.current)
     this.parentRef.current.lastElementChild.scrollIntoView({ behavior: "auto" })
   }
 
@@ -85,7 +84,7 @@ class ProvisionerLogs extends Component<PropsType, StateType> {
       let event = JSON.parse(evt.data);
       let validEvents = [] as any[];
       let err = null;
-      
+      console.log(event)
       for (var i = 0; i < event.length; i++) {
         let msg = event[i];
         if (msg["Values"] && msg["Values"]["data"] && this.isJSON(msg["Values"]["data"])) {