|
|
@@ -1,5 +1,5 @@
|
|
|
import React, {Component} from 'react';
|
|
|
-import {Row, Col, Card, Button, Spin, Alert, Steps} from 'antd';
|
|
|
+import {Row, Col, Card, Button, Spin, Alert, Steps, Progress} from 'antd';
|
|
|
import axios from 'axios';
|
|
|
import APIGroupCard from './APIGroupCard';
|
|
|
import APIPathCard from './APIPathCard';
|
|
|
@@ -23,7 +23,8 @@ class TencentConfig extends Component {
|
|
|
deployIdPassToPath: '',
|
|
|
groupIdPassToPath: '',
|
|
|
pathIdPassToConfig: '',
|
|
|
- currentStep: 0
|
|
|
+ currentStep: 0,
|
|
|
+ deploying: ''
|
|
|
};
|
|
|
}
|
|
|
|
|
|
@@ -33,7 +34,8 @@ class TencentConfig extends Component {
|
|
|
region: '',
|
|
|
deployIdPassToPath: '',
|
|
|
groupIdPassToPath: '',
|
|
|
- currentStep: 0
|
|
|
+ currentStep: 0,
|
|
|
+ deploying: ''
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -67,6 +69,9 @@ class TencentConfig extends Component {
|
|
|
console.log('group', group);
|
|
|
if (schema && deploy && api && group) {
|
|
|
console.log('deploying');
|
|
|
+ this.setState({
|
|
|
+ deploying: 'deploying'
|
|
|
+ });
|
|
|
axios.get(`${deployUrl}`,
|
|
|
{
|
|
|
params: {
|
|
|
@@ -80,8 +85,14 @@ class TencentConfig extends Component {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
console.log('deploy res', res);
|
|
|
+ this.setState({
|
|
|
+ deploying: 'finished'
|
|
|
+ })
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
+ this.setState({
|
|
|
+ deploying: 'error'
|
|
|
+ });
|
|
|
console.log('err', err);
|
|
|
console.log('err.response', err.response);
|
|
|
console.log('err.response.data', err.response.data);
|
|
|
@@ -420,19 +431,37 @@ class TencentConfig extends Component {
|
|
|
this.props.trialcase ?
|
|
|
''
|
|
|
:
|
|
|
+
|
|
|
projectType === 'graphql' ?
|
|
|
+
|
|
|
schema_id.schemaState === 'ok' ?
|
|
|
- <Button type='primary'
|
|
|
- onClick={() => this.deployFC(schemaID, deploy ? deploy.id : this.state.deployIdPassToPath, this.state.pathIdPassToConfig, group ? group.id : this.state.groupIdPassToPath)}><FormattedMessage
|
|
|
- id="deploy"/>!</Button>
|
|
|
+
|
|
|
+ this.state.deploying === '' ?
|
|
|
+ <Button type='primary' onClick={() => this.deployFC(schemaID, deploy ? deploy.id : this.state.deployIdPassToPath, this.state.pathIdPassToConfig, group ? group.id : this.state.groupIdPassToPath)}><FormattedMessage id="deploy"/>!</Button>
|
|
|
+ :
|
|
|
+ ''
|
|
|
:
|
|
|
<Button type='primary'
|
|
|
- disabled><FormattedMessage id="deploy"/>!</Button>
|
|
|
+ disabled><FormattedMessage
|
|
|
+ id="deploy"/>!</Button>
|
|
|
:
|
|
|
<Button type='primary' onClick={() => {
|
|
|
}}><FormattedMessage id="deploy"/>!</Button>
|
|
|
|
|
|
}
|
|
|
+ {
|
|
|
+ this.state.deploying === 'deploying' ?
|
|
|
+ <Spin size="large"/>
|
|
|
+ :
|
|
|
+ this.state.deploying === 'finished' ?
|
|
|
+ <Progress type="circle" percent={100} />
|
|
|
+ :
|
|
|
+ this.state.deploying === 'error' ?
|
|
|
+ <Progress type="circle" percent={99} status="exception" />
|
|
|
+ :
|
|
|
+ ''
|
|
|
+
|
|
|
+ }
|
|
|
</Col>
|
|
|
:
|
|
|
''
|