xy %!s(int64=7) %!d(string=hai) anos
pai
achega
4be48287d7

+ 16 - 5
src/app/common/deploy/tencent/APIGroupCard.js

@@ -31,6 +31,15 @@ const toolTipTitle = {
     'region': 'its region',
 };
 
+const removePrefix = (prefix, value) => {
+    let r = new RegExp(prefix);
+    return value.replace(r, '');
+};
+
+const shiftPrefix = (prefix, value) => {
+    return prefix + value;
+};
+
 class APIGroupCard extends Component {
     constructor(props) {
         super(props);
@@ -93,7 +102,8 @@ class APIGroupCard extends Component {
     };
 
     ok = (id) => {
-        let {userStatus, userDomain, groupName, frontType, environmentName} = this.state;
+        let {userStatus, userDomain, groupName, groupRegion, frontType, environmentName} = this.state;
+        let region = shiftPrefix('ap-', groupRegion);
         let varObj = {
             id,
             cloud_id: this.props.cloudID,
@@ -102,7 +112,7 @@ class APIGroupCard extends Component {
             userDomain,
             groupName,
             frontType,
-            region: this.state.groupRegion,
+            region,
             environmentName,
             defaultDomain: '',
             status: '',
@@ -126,14 +136,15 @@ class APIGroupCard extends Component {
                 }
             )
         } else {
-            let {userStatus, userDomain, groupName, frontType, environmentName} = this.state;
+            let {userStatus, userDomain, groupName, groupRegion, frontType, environmentName} = this.state;
+            let region = shiftPrefix('ap-', groupRegion);
             let varObj = {
                 id: this.props.group.id,
                 userStatus,
                 userDomain,
                 groupName,
                 frontType,
-                region: this.state.groupRegion,
+                region,
                 environmentName,
                 updatedAt: new Date().getTime()
             };
@@ -184,7 +195,7 @@ class APIGroupCard extends Component {
                                     <Icon type="question-circle"/>
                                 </Tooltip>
                             </span>
-                            <Radio.Group onChange={this.switchConfig('groupRegion')} value={this.state.groupRegion} buttonStyle="solid">
+                            <Radio.Group onChange={this.switchConfig('groupRegion')} value={removePrefix('ap-', this.state.groupRegion)} buttonStyle="solid">
                                 <Radio.Button value="guangzhou">Guangzhou</Radio.Button>
                                 <Radio.Button value="shanghai">Shanghai</Radio.Button>
                                 <Radio.Button value="beijing">Beijing</Radio.Button>

+ 25 - 13
src/app/common/deploy/tencent/DeployCard.js

@@ -35,6 +35,15 @@ const toolTipTitle = {
     '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 {
     constructor(props) {
         super(props);
@@ -144,6 +153,8 @@ class DeployCard extends Component {
             )
         } else {
             let {description, cosBucketName, subnetId, cosObjectName, region, vpcId, cosBucketRegion, functionName} = this.state;
+            region = shiftPrefix('ap-', region);
+            cosBucketRegion = shiftPrefix('ap-', cosBucketRegion);
             let varObj = {
                 id: this.props.deploy.id,
                 description,
@@ -206,7 +217,7 @@ class DeployCard extends Component {
                         this.setState({
                             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="shanghai">Shanghai</Radio.Button>
                         <Radio.Button value="beijing">Beijing</Radio.Button>
@@ -222,24 +233,25 @@ class DeployCard extends Component {
                                     <Icon type="question-circle"/>
                                 </Tooltip>
                             </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="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'>{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 => (
                                 <div key={config} style={{marginBottom: 10}}>