diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/system/item-log-level.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/system/item-log-level.js | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/system/item-log-level.js b/server/sonar-web/src/main/js/apps/system/item-log-level.js index 2f888d7100b..3e924a2781e 100644 --- a/server/sonar-web/src/main/js/apps/system/item-log-level.js +++ b/server/sonar-web/src/main/js/apps/system/item-log-level.js @@ -4,17 +4,31 @@ import { setLogLevel } from '../../api/system'; const LOG_LEVELS = ['INFO', 'DEBUG', 'TRACE']; export default React.createClass({ + getInitialState () { + return { level: this.props.value }; + }, + onChange() { let newValue = React.findDOMNode(this.refs.select).value; - setLogLevel(newValue); + setLogLevel(newValue).then(() => { + this.setState({ level: newValue }); + }); }, render() { let options = LOG_LEVELS.map(level => { return <option key={level} value={level}>{level}</option>; }); - return <select ref="select" - onChange={this.onChange} - defaultValue={this.props.value}>{options}</select>; + let warning = this.state.level !== 'INFO' ? ( + <div className="alert alert-danger spacer-top" style={{ wordBreak: 'normal' }}> + {window.t('system.log_level.warning')} + </div> + ) : null; + return <div> + <select ref="select" + onChange={this.onChange} + value={this.state.level}>{options}</select> + {warning} + </div> } }); |