Improve config buttons and message

This commit is contained in:
Itay Mizeretz 2017-10-04 15:26:02 +03:00
parent f9206ff817
commit 6197f4253e
2 changed files with 31 additions and 20 deletions

View File

@ -122,26 +122,37 @@ class ConfigurePageComponent extends React.Component {
<Form schema={displayedSchema}
formData={this.state.configuration[this.state.selectedSection]}
onSubmit={this.onSubmit}
onChange={this.onChange} />
onChange={this.onChange}>
<div>
<div className="alert alert-info">
<i className="glyphicon glyphicon-info-sign" style={{'marginRight': '5px'}}/>
This configuration will only apply to new infections.
</div>
<div className="text-center">
<button type="submit" className="btn btn-success btn-lg" style={{margin: '5px'}}>
Submit
</button>
<button type="button" onClick={this.resetConfig} className="btn btn-danger btn-lg" style={{margin: '5px'}}>
Reset to defaults
</button>
</div>
{ this.state.reset ?
<div className="alert alert-success">
<i className="glyphicon glyphicon-ok-sign" style={{'marginRight': '5px'}}/>
Configuration reset successfully.
</div>
: ''}
{ this.state.saved ?
<div className="alert alert-success">
<i className="glyphicon glyphicon-ok-sign" style={{'marginRight': '5px'}}/>
Configuration saved successfully.
</div>
: ''}
</div>
</Form>
: ''}
<a onClick={this.resetConfig} className="btn btn-danger btn-lg">Reset to defaults</a>
<div className="alert alert-info">
<i className="glyphicon glyphicon-info-sign" style={{'marginRight': '5px'}}/>
This configuration will only apply to new infections.
</div>
{ this.state.reset ?
<div className="alert alert-info">
<i className="glyphicon glyphicon-info-sign" style={{'marginRight': '5px'}}/>
Configuration reset successfully.
</div>
: ''}
{ this.state.saved ?
<div className="alert alert-info">
<i className="glyphicon glyphicon-info-sign" style={{'marginRight': '5px'}}/>
Configuration saved successfully.
</div>
: ''}
</Col>
);
}

View File

@ -27,8 +27,8 @@ class StartOverPageComponent extends React.Component {
<a onClick={this.cleanup} className="btn btn-danger btn-lg">Reset Environment</a>
</p>
{ this.state.cleaned ?
<div className="alert alert-info">
<i className="glyphicon glyphicon-info-sign" style={{'marginRight': '5px'}}/>
<div className="alert alert-success">
<i className="glyphicon glyphicon-ok-sign" style={{'marginRight': '5px'}}/>
Environment was reset successfully
</div>
: ''}