|
|
@@ -20,14 +20,14 @@ class UserCustom extends Component {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
userID: props.userID,
|
|
|
- bucketName: props.bucketName,
|
|
|
cloudName: 'tencent',
|
|
|
disableDeployButton: false,
|
|
|
deployFailed: false,
|
|
|
cloudID: '',
|
|
|
secretID: '',
|
|
|
secretKey: '',
|
|
|
- appId: ''
|
|
|
+ appId: '',
|
|
|
+ bucketName: ''
|
|
|
};
|
|
|
|
|
|
console.log(this.state, 'userCustom state')
|
|
|
@@ -44,14 +44,33 @@ class UserCustom extends Component {
|
|
|
|
|
|
componentWillMount() {
|
|
|
this._isMounted = true;
|
|
|
+ let {bucketName} = this.props
|
|
|
+ bucketName.then(res => {
|
|
|
+ console.log(res, 'bucketname')
|
|
|
+ this.setState({
|
|
|
+ bucketName: res
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
this._isMounted = false;
|
|
|
}
|
|
|
|
|
|
+ componentWillReceiveProps(next) {
|
|
|
+ if(next.bucketName !== this.props.bucketName) {
|
|
|
+ let {bucketName} = this.props
|
|
|
+ bucketName.then(res => {
|
|
|
+ console.log(res, 'bucketname')
|
|
|
+ this.setState({
|
|
|
+ bucketName: res
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
- let {userID, cloudID, bucketName, deployFailed, appId, secretID, secretKey} = this.state;
|
|
|
+ let {userID, cloudID, deployFailed, appId, secretID, secretKey, bucketName} = this.state;
|
|
|
let {history} = this.props
|
|
|
return (
|
|
|
<Content className="content">
|
|
|
@@ -274,6 +293,14 @@ class NameAndDB extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ componentWillReceiveProps(next) {
|
|
|
+ if(next.bucketName !== this.props.bucketName) {
|
|
|
+ this.setState({
|
|
|
+ customName: next.bucketName
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
showModal = () => {
|
|
|
if (this.state.userID) {
|