|
|
@@ -16,15 +16,18 @@ class CloudConfig extends Component {
|
|
|
showOK: '',
|
|
|
showNotOK: '',
|
|
|
tencentCLoudID: '',
|
|
|
+ tenAppID: '',
|
|
|
tenID: '',
|
|
|
tenKey: '',
|
|
|
aliyunCLoudID: '',
|
|
|
+ aliAppID: '',
|
|
|
aliID: '',
|
|
|
aliKey: '',
|
|
|
awsCLoudID: '',
|
|
|
+ awsAppID: '',
|
|
|
awsID: '',
|
|
|
awsKey: '',
|
|
|
- userID: getCookie('user_id')
|
|
|
+ userID: getCookie('user_id'),
|
|
|
};
|
|
|
request(graphqlUrl, SHOW_CLOUD, {user_id: this.state.userID}).then(
|
|
|
data => {
|
|
|
@@ -34,12 +37,15 @@ class CloudConfig extends Component {
|
|
|
this.setState({
|
|
|
show: true,
|
|
|
tencentCLoudID: tencent ? tencent.id : '',
|
|
|
+ tenAppID: tencent ? tencent.appId : '',
|
|
|
tenID: tencent ? tencent.secretId : '',
|
|
|
tenKey: tencent ? tencent.secretKey : '',
|
|
|
aliyunCLoudID: aliyun ? aliyun.id : '',
|
|
|
+ aliAppID: aliyun ? aliyun.appId : '',
|
|
|
aliID: aliyun ? aliyun.secretId : '',
|
|
|
aliKey: aliyun ? aliyun.secretKey : '',
|
|
|
awsCLoudID: amazon ? amazon.id : '',
|
|
|
+ awsAppID: amazon ? amazon.appId : '',
|
|
|
awsID: amazon ? amazon.secretId : '',
|
|
|
awsKey: amazon ? amazon.secretKey : ''
|
|
|
});
|
|
|
@@ -56,13 +62,13 @@ class CloudConfig extends Component {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- submit = (id, cloudName, secretId, secretKey) => {
|
|
|
+ submit = (id, cloudName, secretId, secretKey, appId) => {
|
|
|
return () => {
|
|
|
if (id === '') {
|
|
|
let varObj = {
|
|
|
id: idGen('cloud'),
|
|
|
user_id: this.state.userID,
|
|
|
- appId: 'account-id',
|
|
|
+ appId,
|
|
|
cloudName,
|
|
|
secretId,
|
|
|
secretKey,
|
|
|
@@ -97,6 +103,7 @@ class CloudConfig extends Component {
|
|
|
id,
|
|
|
secretId,
|
|
|
secretKey,
|
|
|
+ appId,
|
|
|
updatedAt: new Date().getTime()
|
|
|
};
|
|
|
request(graphqlUrl, UPDATE_CLOUD, varObj).then(
|
|
|
@@ -142,13 +149,17 @@ class CloudConfig extends Component {
|
|
|
<span className='cloud-name'><FormattedMessage id="Tencent"/>: </span>
|
|
|
<div style={{marginBottom: 15}}>
|
|
|
<div>
|
|
|
+ <div style={{marginBottom: 20}}>
|
|
|
+ <span className='item-title-cloud'>APP ID:</span>
|
|
|
+ <Input style={{width: 250}} value={this.state.tenAppID} onChange={this.inputChange('tenAppID')}/>
|
|
|
+ </div>
|
|
|
<div style={{marginBottom: 20}}>
|
|
|
<span className='item-title-cloud'>secret ID:</span>
|
|
|
- <Input style={{width: 250}} value={this.state.aliID} onChange={this.inputChange('tenID')}/>
|
|
|
+ <Input style={{width: 250}} value={this.state.tenID} onChange={this.inputChange('tenID')}/>
|
|
|
</div>
|
|
|
<div style={{marginBottom: 20}}>
|
|
|
<span className='item-title-cloud'>secret Key:</span>
|
|
|
- <Input style={{width: 250}} value={this.state.aliKey} onChange={this.inputChange('tenKey')}/>
|
|
|
+ <Input style={{width: 250}} value={this.state.tenKey} onChange={this.inputChange('tenKey')}/>
|
|
|
</div>
|
|
|
{
|
|
|
this.state.showOK === 'tencent' ?
|
|
|
@@ -161,7 +172,7 @@ class CloudConfig extends Component {
|
|
|
}
|
|
|
</div>
|
|
|
<Button type='primary'
|
|
|
- onClick={this.submit(this.state.tencentCLoudID, 'tencent', this.state.tenID, this.state.tenKey)}>
|
|
|
+ onClick={this.submit(this.state.tencentCLoudID, 'tencent', this.state.tenID, this.state.tenKey, this.state.tenAppID)}>
|
|
|
<FormattedMessage id="save"/>
|
|
|
</Button>
|
|
|
</div>
|