From 42d986c66daecd2f4ade15fe0f246dbab0051769 Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Wed, 14 Jun 2017 22:42:36 +0300 Subject: [PATCH] =?UTF-8?q?MCSM:Webconsole:=20=D0=BE=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D1=88=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=BA=20=D0=B2=20=D1=81=D0=BE=D0=BE=D1=82=D0=B2=D0=B5?= =?UTF-8?q?=D1=82=D1=81=D1=82=D0=B2=D0=B8=D0=B8=20=D1=81=D0=BE=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=82=D1=83=D1=81=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ошибки в красный фон, предупреждения - желтый --- mcserver-manager/build.gradle | 2 +- mcserver-manager/src/main/resources/components.js | 5 ++++- mcserver-manager/src/main/resources/moduleStyle.css | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mcserver-manager/build.gradle b/mcserver-manager/build.gradle index 3471b72..0fdb140 100644 --- a/mcserver-manager/build.gradle +++ b/mcserver-manager/build.gradle @@ -1,5 +1,5 @@ group = 'asys' -version = '0.10.4-SNAPSHOT' +version = '0.10.5-SNAPSHOT' apply plugin: 'osgi' diff --git a/mcserver-manager/src/main/resources/components.js b/mcserver-manager/src/main/resources/components.js index f07bea5..ae8a9b1 100644 --- a/mcserver-manager/src/main/resources/components.js +++ b/mcserver-manager/src/main/resources/components.js @@ -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}) diff --git a/mcserver-manager/src/main/resources/moduleStyle.css b/mcserver-manager/src/main/resources/moduleStyle.css index 2a9fd62..621d064 100644 --- a/mcserver-manager/src/main/resources/moduleStyle.css +++ b/mcserver-manager/src/main/resources/moduleStyle.css @@ -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;