|
@@ -1,9 +1,9 @@
|
|
|
import React, {Component} from 'react';
|
|
import React, {Component} from 'react';
|
|
|
import {Link} from 'react-router-dom';
|
|
import {Link} from 'react-router-dom';
|
|
|
-import {deployAll, graphqlUrl, storeFile} from "../../../config";
|
|
|
|
|
|
|
+import {deployAll, graphqlUrl, storeFile, copyCos} from "../../../config";
|
|
|
import {ADD_APIGROUP, ADD_APIGWPATH, ADD_DEPLOY, ADD_PROJECT, SHOW_CLOUD} from "../../../gql";
|
|
import {ADD_APIGROUP, ADD_APIGWPATH, ADD_DEPLOY, ADD_PROJECT, SHOW_CLOUD} from "../../../gql";
|
|
|
import {CloudConfig} from "../../../login/CloudConfig";
|
|
import {CloudConfig} from "../../../login/CloudConfig";
|
|
|
-import {Button, notification, Spin, Input, Radio, Modal, Icon} from 'antd';
|
|
|
|
|
|
|
+import {Button, Spin, Input, Radio, Modal, Icon} from 'antd';
|
|
|
import {FormattedMessage} from 'react-intl';
|
|
import {FormattedMessage} from 'react-intl';
|
|
|
import {request} from 'graphql-request'
|
|
import {request} from 'graphql-request'
|
|
|
import {idGen} from "../../../func";
|
|
import {idGen} from "../../../func";
|
|
@@ -188,7 +188,7 @@ class UserCustom extends Component {
|
|
|
pathname: `/common/deploy`,
|
|
pathname: `/common/deploy`,
|
|
|
state: {
|
|
state: {
|
|
|
// 处理传回数据,直接拼接
|
|
// 处理传回数据,直接拼接
|
|
|
- url: `http://${subDomain}/test/graphql`
|
|
|
|
|
|
|
+ url: `http://${subDomain}/test/`
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
@@ -242,8 +242,8 @@ class UserCustom extends Component {
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
{
|
|
{
|
|
|
- customName===''?
|
|
|
|
|
- <span style={{color: 'orange'}}>不能为空</span>:''
|
|
|
|
|
|
|
+ customName === '' ?
|
|
|
|
|
+ <span style={{color: 'orange'}}>不能为空</span> : ''
|
|
|
}
|
|
}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -287,7 +287,7 @@ class UserCustom extends Component {
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
{
|
|
{
|
|
|
- deployFailed?
|
|
|
|
|
|
|
+ deployFailed ?
|
|
|
<span style={{color: 'red', fontSize: 20}}>部署失败!</span>
|
|
<span style={{color: 'red', fontSize: 20}}>部署失败!</span>
|
|
|
:
|
|
:
|
|
|
''
|
|
''
|
|
@@ -299,73 +299,6 @@ class UserCustom extends Component {
|
|
|
<Spin tip="部署大约需要几分钟..."/>
|
|
<Spin tip="部署大约需要几分钟..."/>
|
|
|
:
|
|
:
|
|
|
<Button style={{margin: '20px 0'}} type='primary' onClick={() => {
|
|
<Button style={{margin: '20px 0'}} type='primary' onClick={() => {
|
|
|
- // if (appId && secretID && secretKey) {
|
|
|
|
|
- // this.setState({
|
|
|
|
|
- // disableDeployButton: true
|
|
|
|
|
- // });
|
|
|
|
|
- //
|
|
|
|
|
- // // store *.edn to cos
|
|
|
|
|
- // let deployConf = dbKind === 'mongodb' ?
|
|
|
|
|
- // ` {:secretId "${secretID}"\n` +
|
|
|
|
|
- // ` :secretKey "${secretKey}"\n` +
|
|
|
|
|
- // ` :appId "${appId}"\n` +
|
|
|
|
|
- // ' :region "ap-beijing" \n' +
|
|
|
|
|
- // ' }\n'
|
|
|
|
|
- // :
|
|
|
|
|
- // ` {:secretId "${secretID}"\n` +
|
|
|
|
|
- // ` :secretKey "${secretKey}"\n` +
|
|
|
|
|
- // ` :appId "${appId}"\n` +
|
|
|
|
|
- // ' :region "ap-beijing"\n' +
|
|
|
|
|
- // ' :bucket "fc-db"\n' +
|
|
|
|
|
- // ' :trustStore "/etc/ssl/certs/java/cacerts"\n' +
|
|
|
|
|
- // ` :fc-db-store "save/${bucketName}.dat"\n` +
|
|
|
|
|
- // ' :fc-db-dir "fc-db"\n' +
|
|
|
|
|
- // ' :graphql-url "http://orderfcdb.ioobot.cn/graphql"\n' +
|
|
|
|
|
- // ' :local-tmp-dir "/tmp"\n' +
|
|
|
|
|
- // ' :local-db-file "fcdb.dat"\n' +
|
|
|
|
|
- // ' :update-tx? true \n' +
|
|
|
|
|
- // ' :force-down? true\n' +
|
|
|
|
|
- // ' }';
|
|
|
|
|
- //
|
|
|
|
|
- // let a = axios.post(storeFile, {
|
|
|
|
|
- // 'file-name': `${bucketName}/${dbKind}/${userID}/deploy-conf.edn`,
|
|
|
|
|
- // bucket: 'case',
|
|
|
|
|
- // cont: deployConf
|
|
|
|
|
- // });
|
|
|
|
|
- //
|
|
|
|
|
- // let cont = '{:uri {\n' +
|
|
|
|
|
- // ':auth {:admin-db "order"\n' +
|
|
|
|
|
- // ' :u "ly"\n' +
|
|
|
|
|
- // ' :p "autorunC1705"\n' +
|
|
|
|
|
- // ' :host "119.27.174.13"}}\n' +
|
|
|
|
|
- // ' :db-name "order"}';
|
|
|
|
|
- //
|
|
|
|
|
- // let b = dbKind === 'mongodb' ?
|
|
|
|
|
- // axios.post(storeFile, {
|
|
|
|
|
- // 'file-name': `${bucketName}/${dbKind}/${userID}/mongo-config.edn`,
|
|
|
|
|
- // bucket: 'case',
|
|
|
|
|
- // cont
|
|
|
|
|
- // })
|
|
|
|
|
- // :
|
|
|
|
|
- // Promise.resolve({status: 200});
|
|
|
|
|
- //
|
|
|
|
|
- // Promise.all([a, b]).then(value => {
|
|
|
|
|
- // if (value.every(res => res.status === 200)) {
|
|
|
|
|
- // console.log('store file success , start deploying');
|
|
|
|
|
- // this.deploy();
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
- // } else {
|
|
|
|
|
- // notification['warning']({
|
|
|
|
|
- // message: '需要填写配置',
|
|
|
|
|
- // description: '后续使用,需要先填写配置',
|
|
|
|
|
- // });
|
|
|
|
|
- //
|
|
|
|
|
- // this.props.history.push({
|
|
|
|
|
- // pathname: `/login/cloud`
|
|
|
|
|
- // })
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
this.setState({
|
|
this.setState({
|
|
|
disableDeployButton: true
|
|
disableDeployButton: true
|
|
|
});
|
|
});
|
|
@@ -384,9 +317,8 @@ class UserCustom extends Component {
|
|
|
' :region "ap-beijing"\n' +
|
|
' :region "ap-beijing"\n' +
|
|
|
' :bucket "fc-db"\n' +
|
|
' :bucket "fc-db"\n' +
|
|
|
' :trustStore "/etc/ssl/certs/java/cacerts"\n' +
|
|
' :trustStore "/etc/ssl/certs/java/cacerts"\n' +
|
|
|
- ` :fc-db-store "save/${bucketName}.dat"\n` +
|
|
|
|
|
- ' :fc-db-dir "fc-db"\n' +
|
|
|
|
|
- ' :graphql-url "http://orderfcdb.ioobot.cn/graphql"\n' +
|
|
|
|
|
|
|
+ ` :fc-db-store "case/fc-db/${userID}/${bucketName}.dat"\n` +
|
|
|
|
|
+ ' :fc-db-dir "case"\n' +
|
|
|
' :local-tmp-dir "/tmp"\n' +
|
|
' :local-tmp-dir "/tmp"\n' +
|
|
|
' :local-db-file "fcdb.dat"\n' +
|
|
' :local-db-file "fcdb.dat"\n' +
|
|
|
' :update-tx? true \n' +
|
|
' :update-tx? true \n' +
|
|
@@ -415,7 +347,17 @@ class UserCustom extends Component {
|
|
|
:
|
|
:
|
|
|
Promise.resolve({status: 200});
|
|
Promise.resolve({status: 200});
|
|
|
|
|
|
|
|
- Promise.all([a, b]).then(value => {
|
|
|
|
|
|
|
+ let c = dbKind === 'mongodb' ?
|
|
|
|
|
+ Promise.resolve({status: 200})
|
|
|
|
|
+ :
|
|
|
|
|
+ axios.post(copyCos, {
|
|
|
|
|
+ 'src-bucket': 'case',
|
|
|
|
|
+ 'src-key': `${bucketName}/${bucketName}.dat`,
|
|
|
|
|
+ 'dest-bucket': "case",
|
|
|
|
|
+ 'dest-key': `${bucketName}/fc-db/${userID}/${bucketName}.dat`
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ Promise.all([a, b, c]).then(value => {
|
|
|
if (value.every(res => res.status === 200)) {
|
|
if (value.every(res => res.status === 200)) {
|
|
|
console.log('store file success , start deploying');
|
|
console.log('store file success , start deploying');
|
|
|
this.deploy();
|
|
this.deploy();
|