Przeglądaj źródła

cosObjectName + .jar

xy 7 lat temu
rodzic
commit
06945f549a

+ 11 - 15
src/app/common/deploy/tencent/deployCard/DeployCardRender.js

@@ -10,7 +10,7 @@ import {
     UPDATE_PROJECT_ONLY_STATUS
 } from "../../../../../gql";
 import {request} from 'graphql-request'
-import {removePrefix, shiftPrefix} from "../../../../../func";
+import {removePrefix, shiftPrefix, pushPostfix} from "../../../../../func";
 
 const Panel = Collapse.Panel;
 
@@ -65,7 +65,7 @@ class DeployCardRender extends Component {
                 functionName,
                 region,
                 cosBucketName,
-                cosObjectName,
+                cosObjectName: removePrefix('.jar', cosObjectName),
                 cosBucketRegion,
                 serviceName,
                 vpcId,
@@ -96,7 +96,7 @@ class DeployCardRender extends Component {
                 functionName,
                 region: next.region === '' ? region : next.region,
                 cosBucketName,
-                cosObjectName,
+                cosObjectName: removePrefix('.jar', cosObjectName),
                 cosBucketRegion: next.region === '' ? cosBucketRegion : next.region,
                 serviceName,
                 vpcId,
@@ -126,19 +126,17 @@ class DeployCardRender extends Component {
 
     ok = (id, userID, projectID, cloudID, deploy) => {
         let {description, cosBucketName, subnetId, cosObjectName, region, vpcId, cosBucketRegion, functionName} = this.state;
-        region = shiftPrefix('ap-', region);
-        cosBucketRegion = shiftPrefix('ap-', cosBucketRegion);
         let varObj = {
             id,
             cloud_id: cloudID,
             user_id: userID,
+            cosObjectName: pushPostfix('.jar', cosObjectName),
+            region: shiftPrefix('ap-', region),
+            cosBucketRegion: shiftPrefix('ap-', cosBucketRegion),
             description,
             cosBucketName,
-            subnetId,
-            cosObjectName,
-            region,
             vpcId,
-            cosBucketRegion,
+            subnetId,
             functionName,
             memorySize: 512,
             timeout: 300,
@@ -176,17 +174,15 @@ class DeployCardRender 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: deploy.id,
+                cosObjectName: pushPostfix('.jar', cosObjectName),
+                region: shiftPrefix('ap-', region),
+                cosBucketRegion: shiftPrefix('ap-', cosBucketRegion),
                 description,
                 subnetId,
                 cosBucketName,
-                cosObjectName,
-                region,
                 vpcId,
-                cosBucketRegion,
                 functionName,
                 updatedAt: new Date().getTime()
             };
@@ -332,7 +328,7 @@ class DeployCardRender extends Component {
                                             <Icon type="question-circle"/>
                                         </Tooltip>
                                     </span>
-                    <Input value={this.state.cosBucketName} style={{width: 200}}
+                    <Input value={this.state.cosObjectName} style={{width: 200}}
                            disabled={disable['cosObjectName'] === true} addonAfter=".jar"
                            onChange={this.switchConfig('cosObjectName')}/>
                 </div>

+ 2 - 2
src/app/graphqlService/component/schema/Schema.jsx

@@ -556,9 +556,9 @@ class CopySchemaButton extends Component {
         });
 
         history.push({
-            pathname: `/graphql-service/my-create/${schemaName}`,
+            pathname: `/graphql-service/my-create/${projectName}`,
             state: {
-                schemaName,
+                schemaName:projectName,
                 schemaID:schemaId,
                 projectID: projectId,
                 copy: true,

+ 7 - 1
src/func.js

@@ -16,4 +16,10 @@ const shiftPrefix = (prefix, value) => {
     return prefix + value;
 };
 
-export {shiftPrefix, removePrefix, removeSpace, idGen}
+const pushPostfix = (postfix, value) => {
+    value = removePrefix(postfix, value);
+    return  value + postfix;
+};
+
+
+export {shiftPrefix, removePrefix, removeSpace, idGen, pushPostfix}