From 4020d4d6c105cc203b8c2cb57b282ec06efd97b7 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 15 Oct 2018 21:11:56 -0400 Subject: [PATCH] detect is log is an object and display json view --- embark-ui/src/actions/index.js | 2 +- embark-ui/src/components/Console.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/embark-ui/src/actions/index.js b/embark-ui/src/actions/index.js index dfd431eb5..9b84c7613 100644 --- a/embark-ui/src/actions/index.js +++ b/embark-ui/src/actions/index.js @@ -117,7 +117,7 @@ export const commands = { { timestamp: new Date().getTime(), name: EMBARK_PROCESS_NAME, - msg: `console> ${payload.command}
${ansiToHtml(command.result)}`, + msg: `${ansiToHtml(command.result)}`, command: `console> ${payload.command}
`, result: command.result } diff --git a/embark-ui/src/components/Console.js b/embark-ui/src/components/Console.js index 0afd4916f..4af70e1a6 100644 --- a/embark-ui/src/components/Console.js +++ b/embark-ui/src/components/Console.js @@ -70,13 +70,18 @@ class Console extends Component { .reverse() .map((item, i) => { - if (item.result && item.result[0] === "{") { + if (item.result && (item.result[0] === "{" || item.result[0] === "[")) { return( - +
+

+ +
) } -

+ return ( +

+ ) }) }