Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
539 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
module.exports = [ | ||
{ | ||
request: { | ||
method: 'GET', | ||
path: '/api/cluster/nodes' | ||
}, | ||
response: { | ||
statusCode: 200, | ||
body: JSON.stringify( | ||
{ | ||
'data': [ | ||
{ | ||
'code': 'primary', | ||
'name': 'Prague', | ||
'description': 'Detail of node', | ||
'state': 'RUN', | ||
'id': 12 | ||
}, | ||
{ | ||
'code': 'secondary', | ||
'name': 'London', | ||
'description': 'Lorem ipsum', | ||
'state': 'STOPPED', | ||
'id': 121 | ||
}, | ||
{ | ||
'code': 'backup', | ||
'name': 'Frankfurt', | ||
'description': 'Lorem ipsum', | ||
'state': 'HANDLES_EXISTING_MESSAGES', | ||
'id': 111 | ||
} | ||
] | ||
} | ||
) | ||
} | ||
}, | ||
{ | ||
request: { | ||
method: 'PUT', | ||
path : '/api/cluster/nodes/:id' | ||
}, | ||
response: { | ||
statusCode: 200 | ||
} | ||
}, | ||
{ | ||
request: { | ||
method: 'DELETE', | ||
path : '/api/cluster/nodes/:id' | ||
}, | ||
response: { | ||
statusCode: 200 | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
admin-console/src/routes/EnvironmentProperties/components/EnvironmentProperties.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
admin-console/src/routes/Nodes/components/NodeModal/NodeModal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import React, { Component, PropTypes } from 'react' | ||
import Radium from 'radium' | ||
import Modal from 'react-modal' | ||
import { ValidForm, Field, ValidStyles } from 'valid-react-form' | ||
import ModalHeader from '../../../../common/components/ModalHeader/ModalHeader' | ||
import styles from './nodeModal.styles' | ||
import Button from '../../../../common/components/Button/Button' | ||
import Anchor from '../../../../common/components/Anchor/Anchor' | ||
|
||
@Radium | ||
class NodeModal extends Component { | ||
constructor (props) { | ||
super(props) | ||
this.state = { | ||
state: this.props.data.state | ||
} | ||
} | ||
|
||
changeState (state) { | ||
this.setState(() => ({ | ||
state | ||
})) | ||
} | ||
|
||
render () { | ||
const { isOpen, updateNode, close, data } = this.props | ||
const { state } = this.state | ||
return ( | ||
<Modal contentLabel='params' style={styles.main} isOpen={isOpen}> | ||
<ModalHeader onClose={close} title={'Cluster Node Update'} /> | ||
{isOpen && data && | ||
<div style={styles.content}> | ||
<ValidStyles> | ||
<ValidForm extended={this.state} autoComplete='off' onSubmit={(payload) => updateNode(data.id, payload)}> | ||
<div style={styles.row}> | ||
<div style={styles.label}>Name</div> | ||
<Field required name='name' value={data.name} /> | ||
</div> | ||
<div style={styles.row}> | ||
<div style={styles.label}>Description</div> | ||
<Field name='description' value={data.description} /> | ||
</div> | ||
<div style={styles.row}> | ||
<div style={styles.label}>State</div> | ||
<div style={styles.state} onChange={(event) => this.changeState(event.target.value)}> | ||
Run | ||
<input | ||
defaultChecked={state === 'RUN'} | ||
style={styles.radio} | ||
value='RUN' | ||
type='radio' | ||
name='state' | ||
/> <br /> | ||
Handle existing messages | ||
<input | ||
defaultChecked={state === 'HANDLES_EXISTING_MESSAGES'} | ||
style={styles.radio} | ||
type='radio' | ||
value='HANDLES_EXISTING_MESSAGES' | ||
name='state' | ||
/><br /> | ||
Stopped | ||
<input | ||
defaultChecked={state === 'STOPPED'} | ||
style={styles.radio} | ||
value='STOPPED' | ||
type='radio' | ||
name='state' | ||
/> | ||
</div> | ||
</div> | ||
<div style={[styles.row, styles.controls]}> | ||
<Anchor style={styles.controls.cancel} onClick={close}>Cancel</Anchor> | ||
<Button style={styles.controls.submit}>{'Update'}</Button> | ||
</div> | ||
</ValidForm> | ||
</ValidStyles> | ||
</div>} | ||
</Modal> | ||
) | ||
} | ||
} | ||
|
||
NodeModal.propTypes = { | ||
isOpen : PropTypes.bool, | ||
data : PropTypes.object, | ||
close : PropTypes.func, | ||
updateNode: PropTypes.func | ||
} | ||
|
||
export default NodeModal |
Oops, something went wrong.