|
@@ -6,12 +6,49 @@ const Panel = Collapse.Panel;
|
|
|
class APIGroupCard extends Component {
|
|
class APIGroupCard extends Component {
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props);
|
|
super(props);
|
|
|
- this.state = {
|
|
|
|
|
- region: props.region,
|
|
|
|
|
- groupName: 'graphql-endpoint'
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ let {groupName, environmentName, defaultDomain, frontType, userDomain, userStatus} = props.group;
|
|
|
|
|
+ props.group !== '' ?
|
|
|
|
|
+ this.state = {
|
|
|
|
|
+ groupName,
|
|
|
|
|
+ environmentName,
|
|
|
|
|
+ defaultDomain,
|
|
|
|
|
+ frontType,
|
|
|
|
|
+ userDomain,
|
|
|
|
|
+ userStatus
|
|
|
|
|
+ }
|
|
|
|
|
+ :
|
|
|
|
|
+ this.state = {
|
|
|
|
|
+ groupName: 'graphql-endpoint',
|
|
|
|
|
+ environmentName: 'test',
|
|
|
|
|
+ defaultDomain: '',
|
|
|
|
|
+ frontType: 'http&https',
|
|
|
|
|
+ userDomain: '',
|
|
|
|
|
+ userStatus: 'open'
|
|
|
|
|
+ };
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ componentWillReceiveProps(next) {
|
|
|
|
|
+ if(next.deploy !== '') {
|
|
|
|
|
+ let {groupName, environmentName, defaultDomain, frontType, userDomain, userStatus} = next.group;
|
|
|
|
|
+ this.setState( {
|
|
|
|
|
+ groupName,
|
|
|
|
|
+ environmentName,
|
|
|
|
|
+ defaultDomain,
|
|
|
|
|
+ frontType,
|
|
|
|
|
+ userDomain,
|
|
|
|
|
+ userStatus
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.setState ( {
|
|
|
|
|
+ groupName: 'graphql-endpoint',
|
|
|
|
|
+ environmentName: 'test',
|
|
|
|
|
+ defaultDomain: '',
|
|
|
|
|
+ frontType: 'http&https',
|
|
|
|
|
+ userDomain: '',
|
|
|
|
|
+ userStatus: 'open'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
switchConfig = (label) => {
|
|
switchConfig = (label) => {
|
|
|
return (e) => {
|
|
return (e) => {
|
|
@@ -21,12 +58,6 @@ class APIGroupCard extends Component {
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- componentWillReceiveProps(next) {
|
|
|
|
|
- this.setState({
|
|
|
|
|
- region: next.region
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
render() {
|
|
render() {
|
|
|
const customPanelStyle = {
|
|
const customPanelStyle = {
|
|
|
background: '#f7f7f7',
|
|
background: '#f7f7f7',
|
|
@@ -47,7 +78,7 @@ class APIGroupCard extends Component {
|
|
|
<Panel header="Want more options?" style={customPanelStyle}>
|
|
<Panel header="Want more options?" style={customPanelStyle}>
|
|
|
<div style={{marginBottom: 10}}>
|
|
<div style={{marginBottom: 10}}>
|
|
|
<span className='vice-title'>frontType: </span>
|
|
<span className='vice-title'>frontType: </span>
|
|
|
- <Radio.Group onChange={this.switchConfig('frontType')} defaultValue="http&https"
|
|
|
|
|
|
|
+ <Radio.Group onChange={this.switchConfig('frontType')} defaultValue={this.state.frontType}
|
|
|
buttonStyle="solid">
|
|
buttonStyle="solid">
|
|
|
<Radio.Button value="http">http</Radio.Button>
|
|
<Radio.Button value="http">http</Radio.Button>
|
|
|
<Radio.Button value="https">https</Radio.Button>
|
|
<Radio.Button value="https">https</Radio.Button>
|
|
@@ -56,11 +87,11 @@ class APIGroupCard extends Component {
|
|
|
</div>
|
|
</div>
|
|
|
<div style={{marginBottom: 10}}>
|
|
<div style={{marginBottom: 10}}>
|
|
|
<span className='vice-title'>defaultDomain: </span>
|
|
<span className='vice-title'>defaultDomain: </span>
|
|
|
- <Input value={this.state.defaultDomain} style={{width: 200}} disabled/>
|
|
|
|
|
|
|
+ <Input value={this.state.defaultDomain} style={{width: 400}} disabled/>
|
|
|
</div>
|
|
</div>
|
|
|
<div style={{marginBottom: 10}}>
|
|
<div style={{marginBottom: 10}}>
|
|
|
<span className='vice-title'>environmentName: </span>
|
|
<span className='vice-title'>environmentName: </span>
|
|
|
- <Radio.Group onChange={this.switchConfig('environmentName')} defaultValue="test"
|
|
|
|
|
|
|
+ <Radio.Group onChange={this.switchConfig('environmentName')} defaultValue={this.state.environmentName}
|
|
|
buttonStyle="solid">
|
|
buttonStyle="solid">
|
|
|
<Radio.Button value="test">test</Radio.Button>
|
|
<Radio.Button value="test">test</Radio.Button>
|
|
|
<Radio.Button value="prepub">prepub</Radio.Button>
|
|
<Radio.Button value="prepub">prepub</Radio.Button>
|
|
@@ -69,12 +100,12 @@ class APIGroupCard extends Component {
|
|
|
</div>
|
|
</div>
|
|
|
<div style={{marginBottom: 10}}>
|
|
<div style={{marginBottom: 10}}>
|
|
|
<span className='vice-title'>userDomain: </span>
|
|
<span className='vice-title'>userDomain: </span>
|
|
|
- <Input value={this.state.groupName} style={{width: 400}}
|
|
|
|
|
|
|
+ <Input value={this.state.userDomain} style={{width: 400}}
|
|
|
onChange={this.switchConfig('userDomain')}/>
|
|
onChange={this.switchConfig('userDomain')}/>
|
|
|
</div>
|
|
</div>
|
|
|
<div style={{marginBottom: 10}}>
|
|
<div style={{marginBottom: 10}}>
|
|
|
<span className='vice-title'>userStatus: </span>
|
|
<span className='vice-title'>userStatus: </span>
|
|
|
- <Radio.Group onChange={this.switchConfig('userStatus')} defaultValue="open"
|
|
|
|
|
|
|
+ <Radio.Group onChange={this.switchConfig('userStatus')} defaultValue={this.state.userStatus}
|
|
|
buttonStyle="solid">
|
|
buttonStyle="solid">
|
|
|
<Radio.Button value="open">open</Radio.Button>
|
|
<Radio.Button value="open">open</Radio.Button>
|
|
|
<Radio.Button value="close">close</Radio.Button>
|
|
<Radio.Button value="close">close</Radio.Button>
|