|
|
@@ -1,5 +1,5 @@
|
|
|
import React, {Component} from 'react';
|
|
|
-import {Row, Col, Card, Button, Spin} from 'antd';
|
|
|
+import {Row, Col, Card, Button, Spin, Alert} from 'antd';
|
|
|
import axios from 'axios';
|
|
|
import APIGroupCard from './APIGroupCard';
|
|
|
import APIPathCard from './APIPathCard';
|
|
|
@@ -40,7 +40,7 @@ class TencentConfig extends Component {
|
|
|
};
|
|
|
|
|
|
pass = (value, kind) => {
|
|
|
- if(kind === 'deploy')
|
|
|
+ if (kind === 'deploy')
|
|
|
this.setState({
|
|
|
deployIdPassToPath: value
|
|
|
});
|
|
|
@@ -54,23 +54,23 @@ class TencentConfig extends Component {
|
|
|
let _this = this;
|
|
|
|
|
|
axios.get(`${deployUrl}`,
|
|
|
- // axios.get(`http://localhost:8999/graphql/deployall`,
|
|
|
+ // axios.get(`http://localhost:8999/graphql/deployall`,
|
|
|
{
|
|
|
params: {
|
|
|
'cloud-name': 'tencent',
|
|
|
- schema:"ecommerce_schemaID",
|
|
|
- deploy:"deploy_1544504304478_57468453",
|
|
|
- api:"path_1544504334478_82625598",
|
|
|
- group:"group_1544504325443_46750115"
|
|
|
+ schema: "ecommerce_schemaID",
|
|
|
+ deploy: "deploy_1544504304478_57468453",
|
|
|
+ api: "path_1544504334478_82625598",
|
|
|
+ group: "group_1544504325443_46750115"
|
|
|
}
|
|
|
})
|
|
|
.then((res) => {
|
|
|
console.log('deploy res', res);
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- console.log('err',err);
|
|
|
- console.log('err.response',err.response);
|
|
|
- console.log('err.response.data',err.response.data);
|
|
|
+ console.log('err', err);
|
|
|
+ console.log('err.response', err.response);
|
|
|
+ console.log('err.response.data', err.response.data);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -91,9 +91,9 @@ class TencentConfig extends Component {
|
|
|
let group = '',
|
|
|
deploy = '',
|
|
|
path = '',
|
|
|
- cloudID= 'tencent_CloudID';
|
|
|
+ cloudID = 'tencent_CloudID';
|
|
|
|
|
|
- if(data.project_by_id.cloud_id !== null && data.project_by_id.cloud_id.cloudName === 'tencent') {
|
|
|
+ if (data.project_by_id.cloud_id !== null && data.project_by_id.cloud_id.cloudName === 'tencent') {
|
|
|
group = data.project_by_id.apiGWGroup_id;
|
|
|
deploy = data.project_by_id.deploy_id;
|
|
|
cloudID = data.project_by_id.cloud_id.id;
|
|
|
@@ -101,9 +101,23 @@ class TencentConfig extends Component {
|
|
|
let defaultName = data.project_by_id.projectName;
|
|
|
return (
|
|
|
<div>
|
|
|
+ {
|
|
|
+ data.project_by_id.schema_id.schemaState === 'ok' ?
|
|
|
+ ''
|
|
|
+ :
|
|
|
+ this.props.trialcase ?
|
|
|
+ ''
|
|
|
+ :
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
+ <Alert message="数据表结构不符合规范,暂不能部署,请修改" type="warning"
|
|
|
+ banner closable/>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
<div style={{padding: '30px'}}>
|
|
|
<Row gutter={16}>
|
|
|
<Col span={14}>
|
|
|
+
|
|
|
+
|
|
|
<FormattedMessage id="fc Deploy">
|
|
|
{
|
|
|
msg =>
|
|
|
@@ -137,7 +151,8 @@ class TencentConfig extends Component {
|
|
|
</Card>
|
|
|
}
|
|
|
</FormattedMessage>
|
|
|
- <Query query={gql(SHOW_APIGWPATH)} variables={{apiGWGroup_id: data.project_by_id.apiGWGroup_id? data.project_by_id.apiGWGroup_id.id : ''}}>
|
|
|
+ <Query query={gql(SHOW_APIGWPATH)}
|
|
|
+ variables={{apiGWGroup_id: data.project_by_id.apiGWGroup_id ? data.project_by_id.apiGWGroup_id.id : ''}}>
|
|
|
{
|
|
|
({loading, error, data}) => {
|
|
|
if (loading) {
|
|
|
@@ -146,7 +161,7 @@ class TencentConfig extends Component {
|
|
|
if (error) {
|
|
|
return 'error!';
|
|
|
}
|
|
|
- if(data.apiGWPath_by_props.length>0)
|
|
|
+ if (data.apiGWPath_by_props.length > 0)
|
|
|
path = data.apiGWPath_by_props[0];
|
|
|
return (
|
|
|
<FormattedMessage id="API Path">
|
|
|
@@ -158,12 +173,12 @@ class TencentConfig extends Component {
|
|
|
defalutName={defaultName}
|
|
|
userID={this.props.userID}
|
|
|
trialcase={this.props.trialcase}
|
|
|
- deployID={deploy? deploy.id : this.state.deployIdPassToPath}
|
|
|
- groupID={group? group.id : this.state.groupIdPassToPath}
|
|
|
+ deployID={deploy ? deploy.id : this.state.deployIdPassToPath}
|
|
|
+ groupID={group ? group.id : this.state.groupIdPassToPath}
|
|
|
/>
|
|
|
</Card>
|
|
|
}
|
|
|
- </FormattedMessage>
|
|
|
+ </FormattedMessage>
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
@@ -181,14 +196,15 @@ class TencentConfig extends Component {
|
|
|
</FormattedMessage>
|
|
|
</Col>
|
|
|
<Col offset={2} span={6}>
|
|
|
- <Button type='primary' disabled={data.project_by_id.schema_id.schemaState === 'ok'? '': 'disabled'} onClick={()=>this.deployFC()}><FormattedMessage id="deploy"/>!</Button>
|
|
|
{
|
|
|
- data.project_by_id.schema_id.schemaState === 'ok'?
|
|
|
+ this.props.trialcase ?
|
|
|
''
|
|
|
:
|
|
|
- <div>
|
|
|
- <span>if button is disabled, check your schema</span>
|
|
|
- </div>
|
|
|
+ data.project_by_id.schema_id.schemaState === 'ok' ?
|
|
|
+ <Button type='primary' onClick={() => this.deployFC()}><FormattedMessage id="deploy"/>!</Button>
|
|
|
+ :
|
|
|
+ <Button type='primary' disabled><FormattedMessage id="deploy"/>!</Button>
|
|
|
+
|
|
|
}
|
|
|
</Col>
|
|
|
</Row>
|