|
|
@ -16,7 +16,9 @@ class BreakPoint extends React.Component {
|
|
|
|
method: 'ALL',
|
|
|
|
method: 'ALL',
|
|
|
|
url: '',
|
|
|
|
url: '',
|
|
|
|
action: '1',
|
|
|
|
action: '1',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
haveRules: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.handleClose = this.handleClose.bind(this)
|
|
|
|
this.handleClose = this.handleClose.bind(this)
|
|
|
@ -45,14 +47,17 @@ class BreakPoint extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
this.props.onSave(rules)
|
|
|
|
this.props.onSave(rules)
|
|
|
|
this.handleClose()
|
|
|
|
this.handleClose()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({ haveRules: rules.length ? true : false })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const { rule } = this.state
|
|
|
|
const { rule, haveRules } = this.state
|
|
|
|
|
|
|
|
const variant = haveRules ? 'success' : 'primary'
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<Button size="sm" onClick={this.handleShow}>BreakPoint</Button>
|
|
|
|
<Button variant={variant} size="sm" onClick={this.handleShow}>BreakPoint</Button>
|
|
|
|
|
|
|
|
|
|
|
|
<Modal show={this.state.show} onHide={this.handleClose}>
|
|
|
|
<Modal show={this.state.show} onHide={this.handleClose}>
|
|
|
|
<Modal.Header closeButton>
|
|
|
|
<Modal.Header closeButton>
|
|
|
@ -60,36 +65,34 @@ class BreakPoint extends React.Component {
|
|
|
|
</Modal.Header>
|
|
|
|
</Modal.Header>
|
|
|
|
|
|
|
|
|
|
|
|
<Modal.Body>
|
|
|
|
<Modal.Body>
|
|
|
|
<Form>
|
|
|
|
<Form.Group as={Row}>
|
|
|
|
<Form.Group as={Row}>
|
|
|
|
<Form.Label column sm={2}>Method</Form.Label>
|
|
|
|
<Form.Label column sm={2}>Method</Form.Label>
|
|
|
|
<Col sm={10}>
|
|
|
|
<Col sm={10}>
|
|
|
|
<Form.Control as="select" value={rule.method} onChange={e => { this.setState({ rule: { ...rule, method: e.target.value } }) }}>
|
|
|
|
<Form.Control as="select" value={rule.method} onChange={e => { this.setState({ rule: { ...rule, method: e.target.value } }) }}>
|
|
|
|
<option>ALL</option>
|
|
|
|
<option>ALL</option>
|
|
|
|
<option>GET</option>
|
|
|
|
<option>GET</option>
|
|
|
|
<option>POST</option>
|
|
|
|
<option>POST</option>
|
|
|
|
<option>PUT</option>
|
|
|
|
<option>PUT</option>
|
|
|
|
<option>DELETE</option>
|
|
|
|
<option>DELETE</option>
|
|
|
|
</Form.Control>
|
|
|
|
</Form.Control>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Form.Group>
|
|
|
|
</Form.Group>
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Group as={Row}>
|
|
|
|
<Form.Group as={Row}>
|
|
|
|
<Form.Label column sm={2}>URL</Form.Label>
|
|
|
|
<Form.Label column sm={2}>URL</Form.Label>
|
|
|
|
<Col sm={10}><Form.Control value={rule.url} onChange={e => { this.setState({ rule: { ...rule, url: e.target.value } }) }} /></Col>
|
|
|
|
<Col sm={10}><Form.Control value={rule.url} onChange={e => { this.setState({ rule: { ...rule, url: e.target.value } }) }} /></Col>
|
|
|
|
</Form.Group>
|
|
|
|
</Form.Group>
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Group as={Row}>
|
|
|
|
<Form.Group as={Row}>
|
|
|
|
<Form.Label column sm={2}>Action</Form.Label>
|
|
|
|
<Form.Label column sm={2}>Action</Form.Label>
|
|
|
|
<Col sm={10}>
|
|
|
|
<Col sm={10}>
|
|
|
|
<Form.Control as="select" value={rule.action} onChange={e => { this.setState({ rule: { ...rule, action: e.target.value } }) }}>
|
|
|
|
<Form.Control as="select" value={rule.action} onChange={e => { this.setState({ rule: { ...rule, action: e.target.value } }) }}>
|
|
|
|
<option value="1">Request</option>
|
|
|
|
<option value="1">Request</option>
|
|
|
|
<option value="2">Response</option>
|
|
|
|
<option value="2">Response</option>
|
|
|
|
<option value="3">Both</option>
|
|
|
|
<option value="3">Both</option>
|
|
|
|
</Form.Control>
|
|
|
|
</Form.Control>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Form.Group>
|
|
|
|
</Form.Group>
|
|
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
|
|
</Modal.Body>
|
|
|
|
</Modal.Body>
|
|
|
|
|
|
|
|
|
|
|
|
<Modal.Footer>
|
|
|
|
<Modal.Footer>
|
|
|
@ -97,7 +100,7 @@ class BreakPoint extends React.Component {
|
|
|
|
Close
|
|
|
|
Close
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<Button variant="primary" onClick={this.handleSave}>
|
|
|
|
<Button variant="primary" onClick={this.handleSave}>
|
|
|
|
Save Changes
|
|
|
|
Save
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
</Modal.Footer>
|
|
|
|
</Modal.Footer>
|
|
|
|
</Modal>
|
|
|
|
</Modal>
|
|
|
|