xy 7 роки тому
батько
коміт
605de0cc99
1 змінених файлів з 59 додано та 53 видалено
  1. 59 53
      src/app/common/deploy/tencent/TencentConfig.js

+ 59 - 53
src/app/common/deploy/tencent/TencentConfig.js

@@ -37,7 +37,7 @@ class TencentConfig extends Component {
                 let dataProject = data.project_by_id;
                 if (dataProject !== null) {
                     this.setState({
-                        schemaState: dataProject.schema_id? dataProject.schema_id.schemaState : '',
+                        schemaState: dataProject.schema_id ? dataProject.schema_id.schemaState : '',
                         projectType: dataProject.projectType
                     });
                     switch (dataProject.projectStatus) {
@@ -117,7 +117,7 @@ class TencentConfig extends Component {
                 let dataProject = data.project_by_id;
                 if (dataProject !== null) {
                     this.setState({
-                        schemaState: dataProject.schema_id? dataProject.schema_id.schemaState : '',
+                        schemaState: dataProject.schema_id ? dataProject.schema_id.schemaState : '',
                         projectType: dataProject.projectType
                     });
                     switch (dataProject.projectStatus) {
@@ -195,7 +195,7 @@ class TencentConfig extends Component {
                     let group = dataProject.apiGWGroup_id.id;
                     request(graphqlUrl, SHOW_APIGWPATH, {apiGWGroup_id: group}).then(
                         data => {
-                            if(data.apiGWPath_by_props !== null) {
+                            if (data.apiGWPath_by_props !== null) {
 
                                 // 给 project 加 deploying 状态
                                 request(graphqlUrl, UPDATE_PROJECT_ONLY_STATUS, {
@@ -307,12 +307,21 @@ class TencentConfig extends Component {
                         <Col span={14}>
 
                             {
-                                this.state.currentStep !== '' || this.state.deploying === 'deploying' || this.state.deploying === 'deployed'?
-                                    <Steps current={this.state.deploying !== 'deploying' ? this.state.currentStep : 4} style={{marginBottom: 30}}>
-                                        <Step onClick={()=>{this.stepByStep(0)}} title={this.stepStatus(0)} description="云函数配置"/>
-                                        <Step onClick={()=>{this.stepByStep(1)}} title={this.stepStatus(1)} description="服务配置"/>
-                                        <Step onClick={()=>{this.stepByStep(2)}} title={this.stepStatus(2)} description="API 配置"/>
-                                        <Step onClick={()=>{this.stepByStep(3)}} title={this.stepStatus(3)} description="通知配置"/>
+                                this.state.currentStep !== '' || this.state.deploying === 'deploying' || this.state.deploying === 'deployed' ?
+                                    <Steps current={this.state.deploying !== 'deploying' ? this.state.currentStep : 4}
+                                           style={{marginBottom: 30}}>
+                                        <Step onClick={() => {
+                                            this.stepByStep(0)
+                                        }} title={this.stepStatus(0)} description="云函数配置"/>
+                                        <Step onClick={() => {
+                                            this.stepByStep(1)
+                                        }} title={this.stepStatus(1)} description="服务配置"/>
+                                        <Step onClick={() => {
+                                            this.stepByStep(2)
+                                        }} title={this.stepStatus(2)} description="API 配置"/>
+                                        <Step onClick={() => {
+                                            this.stepByStep(3)
+                                        }} title={this.stepStatus(3)} description="通知配置"/>
                                     </Steps>
                                     :
                                     ''
@@ -401,59 +410,56 @@ class TencentConfig extends Component {
                             }
 
                         </Col>
+                        <Col span={8} offset={2}>
+                            {
+                                this.state.currentStep === 4 || this.state.stepAllShow ?
+                                    this.props.trialcase ?
+                                        ''
+                                        :
+                                        this.state.projectType === 'graphql' ?
 
-                        {
-                            this.state.currentStep === 4 || this.state.stepAllShow ?
-                                <Col offset={2} span={6}>
-                                    {
-                                        this.props.trialcase ?
-                                            ''
-                                            :
-                                            this.state.projectType === 'graphql' ?
-
-                                                this.state.schemaState === 'ok' ?
+                                            this.state.schemaState === 'ok' ?
 
-                                                    this.state.deploying === '' ?
-                                                        <Button type='primary' onClick={this.deployFC}><FormattedMessage id="deploy"/>!</Button>
-                                                        :
-                                                        ''
-                                                    :
-                                                    <Button type='primary'
-                                                            disabled><FormattedMessage
+                                                this.state.deploying === '' ?
+                                                    <Button type='primary' onClick={this.deployFC}><FormattedMessage
                                                         id="deploy"/>!</Button>
+                                                    :
+                                                    ''
                                                 :
-                                                <Button type='primary' onClick={() => {
-                                                }}><FormattedMessage id="deploy"/>!</Button>
-
-                                    }
-                                </Col>
-                                :
-                                ''
-                        }
+                                                <Button type='primary'
+                                                        disabled><FormattedMessage
+                                                    id="deploy"/>!</Button>
+                                            :
+                                            <Button type='primary' onClick={() => {
+                                            }}><FormattedMessage id="deploy"/>!</Button>
+                                    :
+                                    ''
+                            }
 
-                        {
-                            this.props.trialcase ?
-                                <Progress type="circle" percent={100}/>
-                                :
-                                this.state.deploying === 'deploying' ?
-                                    <div>
-                                        <Spin size="large"/>
-                                        &nbsp;&nbsp;
-                                        <span><b>大约需要等待 30s</b></span>
-                                    </div>
+                            {
+                                this.props.trialcase ?
+                                    <Progress type="circle" percent={100}/>
                                     :
-                                    this.state.deploying === 'deployed' ?
-                                        <Progress type="circle" percent={100}/>
+                                    this.state.deploying === 'deploying' ?
+                                        <div>
+                                            <Spin size="large"/>
+                                            &nbsp;&nbsp;
+                                            <span><b>大约需要等待 30s</b></span>
+                                        </div>
                                         :
-                                        this.state.deploying === 'error' ?
-                                            <Progress type="circle" percent={99} status="exception"/>
+                                        this.state.deploying === 'deployed' ?
+                                            <Progress type="circle" percent={100}/>
                                             :
-                                            this.state.deploying === 'updated' ?
-                                                <Button type='primary' onClick={this.deployFC}><FormattedMessage id="redeploy"/>!</Button>
+                                            this.state.deploying === 'error' ?
+                                                <Progress type="circle" percent={99} status="exception"/>
                                                 :
-                                                ''
-                        }
-
+                                                this.state.deploying === 'updated' ?
+                                                    <Button type='primary' onClick={this.deployFC}><FormattedMessage
+                                                        id="redeploy"/>!</Button>
+                                                    :
+                                                    ''
+                            }
+                        </Col>
                     </Row>
                 </div>
             </div>