|
|
@@ -7,13 +7,13 @@ const Panel = Collapse.Panel;
|
|
|
class DeployCard extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
- let {functionName, cosBucketName, cosObjectName, cosBucketRegion, serviceName, vpcId, subnetId} = props.deploy;
|
|
|
- console.log(1111, props.deploy);
|
|
|
+ let {functionName, cosBucketName, cosObjectName, cosBucketRegion, serviceName, vpcId, subnetId, region} = props.deploy;
|
|
|
|
|
|
props.deploy !== '' ?
|
|
|
this.state = {
|
|
|
- configs: ['description', 'cosBucketName', 'cosObjectName', 'cosBucketRegion', 'serviceName', 'vpcId', 'subnetId'],
|
|
|
+ configs: ['description', 'cosBucketName', 'cosObjectName', 'serviceName', 'vpcId', 'subnetId'],
|
|
|
functionName,
|
|
|
+ region,
|
|
|
cosBucketName,
|
|
|
cosObjectName,
|
|
|
cosBucketRegion,
|
|
|
@@ -23,8 +23,9 @@ class DeployCard extends Component {
|
|
|
}
|
|
|
:
|
|
|
this.state = {
|
|
|
- configs: ['description', 'cosBucketName', 'cosObjectName', 'cosBucketRegion', 'serviceName', 'vpcId', 'subnetId'],
|
|
|
+ configs: ['description', 'cosBucketName', 'cosObjectName', 'serviceName', 'vpcId', 'subnetId'],
|
|
|
functionName: props.schemaName,
|
|
|
+ region: props.region,
|
|
|
cosBucketName: 'graphqlfc',
|
|
|
cosObjectName: props.schemaName,
|
|
|
cosBucketRegion: props.region,
|
|
|
@@ -35,11 +36,11 @@ class DeployCard extends Component {
|
|
|
}
|
|
|
|
|
|
componentWillReceiveProps(next) {
|
|
|
- console.log(2222, next.deploy);
|
|
|
if(next.deploy !== '') {
|
|
|
- let {functionName, cosBucketName, cosObjectName, cosBucketRegion, serviceName, vpcId, subnetId} = next.deploy;
|
|
|
+ let {functionName, cosBucketName, cosObjectName, cosBucketRegion, serviceName, vpcId, subnetId, region} = next.deploy;
|
|
|
this.setState( {
|
|
|
functionName,
|
|
|
+ // region,
|
|
|
cosBucketName,
|
|
|
cosObjectName,
|
|
|
cosBucketRegion,
|
|
|
@@ -50,6 +51,7 @@ class DeployCard extends Component {
|
|
|
} else {
|
|
|
this.setState ( {
|
|
|
functionName: next.schemaName,
|
|
|
+ region: next.region,
|
|
|
cosBucketName: 'graphqlfc',
|
|
|
cosObjectName: next.schemaName,
|
|
|
cosBucketRegion: next.region,
|
|
|
@@ -79,22 +81,37 @@ class DeployCard extends Component {
|
|
|
|
|
|
return (
|
|
|
<div>
|
|
|
- <div style={{marginBottom: 10}}>
|
|
|
- <span className='vice-title'>region: </span>
|
|
|
- <Radio.Group onChange={this.props.switchRegion} defaultValue={this.props.region} buttonStyle="solid">
|
|
|
- <Radio.Button value="guangzhou">Guangzhou</Radio.Button>
|
|
|
- <Radio.Button value="shanghai">Shanghai</Radio.Button>
|
|
|
- <Radio.Button value="beijing">Beijing</Radio.Button>
|
|
|
- <Radio.Button value="chengdu">Chengdu</Radio.Button>
|
|
|
- </Radio.Group>
|
|
|
- </div>
|
|
|
<div style={{marginBottom: 10}}>
|
|
|
<span className='vice-title'>functionName: </span>
|
|
|
<Input value={this.state.functionName} style={{width: 400}}
|
|
|
onChange={this.switchConfig('functionName')}/>
|
|
|
</div>
|
|
|
+ {/*// todo: 不知道为啥, radio group 放在这里就是不对*/}
|
|
|
<Collapse bordered={false}>
|
|
|
<Panel header="Want more options?" style={customPanelStyle}>
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
+ <span className='vice-title'>region: </span>
|
|
|
+ <Radio.Group onChange={(e)=>{
|
|
|
+ this.props.switchRegion(e);
|
|
|
+ this.setState({
|
|
|
+ region: e.target.value
|
|
|
+ })
|
|
|
+ }} defaultValue={this.state.region} buttonStyle="solid">
|
|
|
+ <Radio.Button value="guangzhou">Guangzhou</Radio.Button>
|
|
|
+ <Radio.Button value="shanghai">Shanghai</Radio.Button>
|
|
|
+ <Radio.Button value="beijing">Beijing</Radio.Button>
|
|
|
+ <Radio.Button value="chengdu">Chengdu</Radio.Button>
|
|
|
+ </Radio.Group>
|
|
|
+ </div>
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
+ <span className='vice-title'>cosBucketRegion: </span>
|
|
|
+ <Radio.Group onChange={this.switchConfig('cosBucketRegion')} value={this.state.cosBucketRegion} buttonStyle="solid">
|
|
|
+ <Radio.Button value="guangzhou">Guangzhou</Radio.Button>
|
|
|
+ <Radio.Button value="shanghai">Shanghai</Radio.Button>
|
|
|
+ <Radio.Button value="beijing">Beijing</Radio.Button>
|
|
|
+ <Radio.Button value="chengdu">Chengdu</Radio.Button>
|
|
|
+ </Radio.Group>
|
|
|
+ </div>
|
|
|
{
|
|
|
this.state.configs.map(config => (
|
|
|
<div key={config} style={{marginBottom: 10}}>
|