mirror of https://github.com/embarklabs/embark.git
detect is log is an object and display json view
This commit is contained in:
parent
b126871a95
commit
4020d4d6c1
|
@ -117,7 +117,7 @@ export const commands = {
|
|||
{
|
||||
timestamp: new Date().getTime(),
|
||||
name: EMBARK_PROCESS_NAME,
|
||||
msg: `console> ${payload.command}<br>${ansiToHtml(command.result)}`,
|
||||
msg: `${ansiToHtml(command.result)}`,
|
||||
command: `console> ${payload.command}<br>`,
|
||||
result: command.result
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
<ReactJson src={JSON.parse(item.result)} theme="monokai" sortKeys={true} collapsed={1} />
|
||||
<div>
|
||||
<p key={i} className={item.logLevel} dangerouslySetInnerHTML={{__html: (convert.toHtml(item.command || ""))}}></p>
|
||||
<ReactJson src={JSON.parse(item.result)} theme="monokai" sortKeys={true} collapsed={1} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<p key={i} className={item.logLevel} dangerouslySetInnerHTML={{__html: convert.toHtml(item.msg)}}></p>
|
||||
|
||||
return (
|
||||
<p key={i} className={item.logLevel} dangerouslySetInnerHTML={{__html: (convert.toHtml(item.command || "") + convert.toHtml(item.msg))}}></p>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Logs>
|
||||
|
|
Loading…
Reference in New Issue