forked from p15670423/monkey
Raise a modal indicating that Monkey binaries are missing.
This commit is contained in:
parent
e1229baa61
commit
a4d4f629e0
|
@ -43,7 +43,8 @@ class RunMonkeyPageComponent extends AuthComponent {
|
|||
isLoadingAws: true,
|
||||
isErrorWhileCollectingAwsMachines: false,
|
||||
awsMachineCollectionErrorMsg: '',
|
||||
showModal: false
|
||||
showModal: false,
|
||||
errorDetails: ''
|
||||
};
|
||||
|
||||
this.closeModal = this.closeModal.bind(this);
|
||||
|
@ -138,7 +139,8 @@ class RunMonkeyPageComponent extends AuthComponent {
|
|||
/* If Monkey binaries are missing, change the state accordingly */
|
||||
if (res['error_text'].startsWith('Copy file failed')) {
|
||||
this.setState({
|
||||
showModal: true}
|
||||
showModal: true,
|
||||
errorDetails: res['error_text']}
|
||||
);
|
||||
}
|
||||
this.setState({
|
||||
|
@ -320,7 +322,7 @@ class RunMonkeyPageComponent extends AuthComponent {
|
|||
<MissingBinariesModal
|
||||
showModal = {this.state.showModal}
|
||||
onClose = {this.closeModal}
|
||||
onVerify = {this.cleanup}/>
|
||||
errorDetails = {this.state.errorDetails}/>
|
||||
{
|
||||
// TODO: implement button functionality
|
||||
/*
|
||||
|
|
|
@ -9,22 +9,44 @@ class MissingBinariesModal extends React.PureComponent {
|
|||
super(props);
|
||||
|
||||
this.state = {
|
||||
showModal: this.props.showModal
|
||||
showModal: this.props.showModal,
|
||||
errorDetails: this.props.errorDetails
|
||||
};
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (this.props !== prevProps) {
|
||||
this.setState({
|
||||
showModal: this.props.showModal,
|
||||
errorDetails: this.props.errorDetails
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
render = () => {
|
||||
return (
|
||||
<Modal show={this.props.showModal} onHide={() => this.props.onClose()}>
|
||||
<Modal show={this.state.showModal} onHide={() => this.props.onClose()}>
|
||||
<Modal.Body>
|
||||
<h3>
|
||||
<div className='text-center'>Uh oh...</div>
|
||||
</h3>
|
||||
<p style={{'fontSize': '1.2em', 'marginBottom': '2em'}}>
|
||||
Some Monkey binaries are not found where they should be...{"\r\n"}
|
||||
<div style={{'marginTop': '1em', 'marginBottom': '1em'}}>
|
||||
<p className="alert alert-warning">
|
||||
<i className="glyphicon glyphicon-info-sign" style={{'marginRight': '5px'}}/>
|
||||
Some Monkey binaries are not found where they should be...<br/>
|
||||
Try downloading them from <a href="https://github.com/guardicore/monkey/releases/latest" target="blank">here</a>,
|
||||
at the bottommost section titled "Assets".
|
||||
</p>
|
||||
</div>
|
||||
<hr/>
|
||||
<h4>
|
||||
Error Details
|
||||
</h4>
|
||||
<div style={{'marginTop': '1em', 'marginBottom': '1em'}}>
|
||||
<pre>
|
||||
{this.state.errorDetails}
|
||||
</pre>
|
||||
</div>
|
||||
<div className='text-center'>
|
||||
<button type='button' className='btn btn-success btn-lg' style={{margin: '5px'}}
|
||||
onClick={() => this.props.onClose()}>
|
||||
|
|
Loading…
Reference in New Issue