|
|
@@ -1,20 +1,88 @@
|
|
|
-
|
|
|
import React, {Component} from 'react';
|
|
|
+import {Input, Collapse, Button, Radio} from 'antd';
|
|
|
|
|
|
+const Panel = Collapse.Panel;
|
|
|
|
|
|
class APIGroupCard extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
+ region: props.region,
|
|
|
+ groupName: 'graphql-endpoint'
|
|
|
};
|
|
|
}
|
|
|
|
|
|
|
|
|
+ switchConfig = (label) => {
|
|
|
+ return (e) => {
|
|
|
+ this.setState({
|
|
|
+ [label]: e.target.value
|
|
|
+ })
|
|
|
+ };
|
|
|
+ };
|
|
|
+
|
|
|
+ componentWillReceiveProps(next) {
|
|
|
+ this.setState({
|
|
|
+ region: next.region
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
render() {
|
|
|
+ const customPanelStyle = {
|
|
|
+ background: '#f7f7f7',
|
|
|
+ borderRadius: 4,
|
|
|
+ marginBottom: 24,
|
|
|
+ border: 0,
|
|
|
+ overflow: 'hidden',
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<div>
|
|
|
- APIGroupCard
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
+ <span className='vice-title'>groupName: </span>
|
|
|
+ <Input value={this.state.groupName} style={{width: 400}}
|
|
|
+ onChange={this.switchConfig('groupName')}/>
|
|
|
+ </div>
|
|
|
+ <Collapse bordered={false}>
|
|
|
+ <Panel header="Want more options?" style={customPanelStyle}>
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
+ <span className='vice-title'>frontType: </span>
|
|
|
+ <Radio.Group onChange={this.switchConfig('frontType')} defaultValue="http&https"
|
|
|
+ buttonStyle="solid">
|
|
|
+ <Radio.Button value="http">http</Radio.Button>
|
|
|
+ <Radio.Button value="https">https</Radio.Button>
|
|
|
+ <Radio.Button value="http&https">http&https</Radio.Button>
|
|
|
+ </Radio.Group>
|
|
|
+ </div>
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
+ <span className='vice-title'>defaultDomain: </span>
|
|
|
+ <Input value={this.state.defaultDomain} style={{width: 200}} disabled/>
|
|
|
+ </div>
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
+ <span className='vice-title'>environmentName: </span>
|
|
|
+ <Radio.Group onChange={this.switchConfig('environmentName')} defaultValue="test"
|
|
|
+ buttonStyle="solid">
|
|
|
+ <Radio.Button value="test">test</Radio.Button>
|
|
|
+ <Radio.Button value="prepub">prepub</Radio.Button>
|
|
|
+ <Radio.Button value="release">release</Radio.Button>
|
|
|
+ </Radio.Group>
|
|
|
+ </div>
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
+ <span className='vice-title'>userDomain: </span>
|
|
|
+ <Input value={this.state.groupName} style={{width: 400}}
|
|
|
+ onChange={this.switchConfig('userDomain')}/>
|
|
|
+ </div>
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
+ <span className='vice-title'>userStatus: </span>
|
|
|
+ <Radio.Group onChange={this.switchConfig('userStatus')} defaultValue="open"
|
|
|
+ buttonStyle="solid">
|
|
|
+ <Radio.Button value="open">open</Radio.Button>
|
|
|
+ <Radio.Button value="close">close</Radio.Button>
|
|
|
+ </Radio.Group>
|
|
|
+ </div>
|
|
|
+ </Panel>
|
|
|
+ </Collapse>
|
|
|
+ <Button type='primary'>ok</Button>
|
|
|
</div>
|
|
|
)
|
|
|
}
|