|
@@ -35,6 +35,15 @@ const toolTipTitle = {
|
|
|
'description': 'its description',
|
|
'description': 'its description',
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const removePrefix = (prefix, value) => {
|
|
|
|
|
+ let r = new RegExp(prefix);
|
|
|
|
|
+ return value.replace(r, '');
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const shiftPrefix = (prefix, value) => {
|
|
|
|
|
+ return prefix + value;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
class DeployCard extends Component {
|
|
class DeployCard extends Component {
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props);
|
|
super(props);
|
|
@@ -144,6 +153,8 @@ class DeployCard extends Component {
|
|
|
)
|
|
)
|
|
|
} else {
|
|
} else {
|
|
|
let {description, cosBucketName, subnetId, cosObjectName, region, vpcId, cosBucketRegion, functionName} = this.state;
|
|
let {description, cosBucketName, subnetId, cosObjectName, region, vpcId, cosBucketRegion, functionName} = this.state;
|
|
|
|
|
+ region = shiftPrefix('ap-', region);
|
|
|
|
|
+ cosBucketRegion = shiftPrefix('ap-', cosBucketRegion);
|
|
|
let varObj = {
|
|
let varObj = {
|
|
|
id: this.props.deploy.id,
|
|
id: this.props.deploy.id,
|
|
|
description,
|
|
description,
|
|
@@ -206,7 +217,7 @@ class DeployCard extends Component {
|
|
|
this.setState({
|
|
this.setState({
|
|
|
region: e.target.value
|
|
region: e.target.value
|
|
|
})
|
|
})
|
|
|
- }} defaultValue={this.state.region} buttonStyle="solid">
|
|
|
|
|
|
|
+ }} defaultValue={this.state.region} value={removePrefix('ap-', this.state.region)} buttonStyle="solid">
|
|
|
<Radio.Button value="guangzhou">Guangzhou</Radio.Button>
|
|
<Radio.Button value="guangzhou">Guangzhou</Radio.Button>
|
|
|
<Radio.Button value="shanghai">Shanghai</Radio.Button>
|
|
<Radio.Button value="shanghai">Shanghai</Radio.Button>
|
|
|
<Radio.Button value="beijing">Beijing</Radio.Button>
|
|
<Radio.Button value="beijing">Beijing</Radio.Button>
|
|
@@ -222,24 +233,25 @@ class DeployCard extends Component {
|
|
|
<Icon type="question-circle"/>
|
|
<Icon type="question-circle"/>
|
|
|
</Tooltip>
|
|
</Tooltip>
|
|
|
</span>
|
|
</span>
|
|
|
- <Radio.Group onChange={this.switchConfig('cosBucketRegion')}
|
|
|
|
|
- value={this.state.cosBucketRegion} buttonStyle="solid">
|
|
|
|
|
|
|
+ <Radio.Group onChange={this.switchConfig('cosBucketRegion')} defaultValue={this.state.region}
|
|
|
|
|
+ value={removePrefix('ap-', this.state.cosBucketRegion)} buttonStyle="solid">
|
|
|
<Radio.Button value="guangzhou">Guangzhou</Radio.Button>
|
|
<Radio.Button value="guangzhou">Guangzhou</Radio.Button>
|
|
|
<Radio.Button value="shanghai">Shanghai</Radio.Button>
|
|
<Radio.Button value="shanghai">Shanghai</Radio.Button>
|
|
|
<Radio.Button value="beijing">Beijing</Radio.Button>
|
|
<Radio.Button value="beijing">Beijing</Radio.Button>
|
|
|
<Radio.Button value="chengdu">Chengdu</Radio.Button>
|
|
<Radio.Button value="chengdu">Chengdu</Radio.Button>
|
|
|
</Radio.Group>
|
|
</Radio.Group>
|
|
|
</div>
|
|
</div>
|
|
|
- <div style={{marginBottom: 10}}>
|
|
|
|
|
- <span className='vice-title'>{valueToKey['serviceName']}
|
|
|
|
|
- <span> </span>
|
|
|
|
|
- <Tooltip placement="top" title={toolTipTitle['serviceName']}>
|
|
|
|
|
- <Icon type="question-circle"/>
|
|
|
|
|
- </Tooltip>
|
|
|
|
|
- </span>
|
|
|
|
|
- <Input value={this.state.serviceName} style={{width: 200}} disabled
|
|
|
|
|
- onChange={this.switchConfig('serviceName')}/>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ {/*腾讯云为空字符串,不显示,这里未作区分*/}
|
|
|
|
|
+ {/*<div style={{marginBottom: 10}}>*/}
|
|
|
|
|
+ {/*<span className='vice-title'>{valueToKey['serviceName']}*/}
|
|
|
|
|
+ {/*<span> </span>*/}
|
|
|
|
|
+ {/*<Tooltip placement="top" title={toolTipTitle['serviceName']}>*/}
|
|
|
|
|
+ {/*<Icon type="question-circle"/>*/}
|
|
|
|
|
+ {/*</Tooltip>*/}
|
|
|
|
|
+ {/*</span>*/}
|
|
|
|
|
+ {/*<Input value={this.state.serviceName} style={{width: 200}} disabled*/}
|
|
|
|
|
+ {/*onChange={this.switchConfig('serviceName')}/>*/}
|
|
|
|
|
+ {/*</div>*/}
|
|
|
{
|
|
{
|
|
|
this.state.configs.map(config => (
|
|
this.state.configs.map(config => (
|
|
|
<div key={config} style={{marginBottom: 10}}>
|
|
<div key={config} style={{marginBottom: 10}}>
|