aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/system
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-10-22 20:48:21 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-10-22 20:48:21 +0200
commit5469f3ac48fbfd377a246cfa77a19249132714b4 (patch)
treea0be80fdd6713502eac927d20751e50a1b0bc1d6 /server/sonar-web/src/main/js/apps/system
parent0dc21da0c4d4f29e91637bc778b2cbf16b657d80 (diff)
downloadsonarqube-5469f3ac48fbfd377a246cfa77a19249132714b4.tar.gz
sonarqube-5469f3ac48fbfd377a246cfa77a19249132714b4.zip
SONAR-6928 apply feedback
Diffstat (limited to 'server/sonar-web/src/main/js/apps/system')
-rw-r--r--server/sonar-web/src/main/js/apps/system/item-log-level.js22
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>
}
});