Archived
0

MCSM:Webconsole: окрашивание строк в соответствии со статусом

Ошибки в красный фон, предупреждения - желтый
This commit is contained in:
2017-06-14 22:42:36 +03:00
parent 89ba10ebec
commit 42d986c66d
3 changed files with 13 additions and 2 deletions

View File

@@ -199,7 +199,10 @@ var WebConsole = React.createClass({
ce('div', {id: 'webconsole'},
ce(ScrollingContent, {className: 'output'},
this.state.lines.map(function(line){
return ce('p', {dangerouslySetInnerHTML: {__html: ansi_up.ansi_to_html(line)}});
var clazz = "";
if (line.indexOf('ERROR') !== -1) { clazz = "error"; }
else if (line.indexOf('WARN') !== -1) { clazz = "warn"; }
return ce('p', {className: clazz, dangerouslySetInnerHTML: {__html: ansi_up.ansi_to_html(line)}});
})
),
ce('input', {ref: 'input', 'onKeyPress': this.handleKeyInput})

View File

@@ -26,6 +26,14 @@
word-wrap: break-word;
}
#webconsole .output .wrapper .content p.error {
background-color: rgba(255,0,0,0.4);
}
#webconsole .output .wrapper .content p.warn {
background-color: rgba(255,200,0,0.3);
}
#webconsole .output .scroll {
width: 9px;
background: #f00;