mirror of https://github.com/embarklabs/embark.git
convert ansi colors to spans
This commit is contained in:
parent
1e721fa4f6
commit
426f71fd98
|
@ -4,6 +4,7 @@
|
|||
"private": true,
|
||||
"dependencies": {
|
||||
"ace-mode-solidity": "^0.1.0",
|
||||
"ansi-to-html": "^0.6.6",
|
||||
"axios": "^0.18.0",
|
||||
"classnames": "^2.2.6",
|
||||
"connected-react-router": "^4.3.0",
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
import React, {Component} from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {Page} from "tabler-react";
|
||||
import Convert from 'ansi-to-html';
|
||||
const convert = new Convert();
|
||||
|
||||
class Process extends Component {
|
||||
render() {
|
||||
const {processLogs, process}= this.props;
|
||||
return (
|
||||
<Page.Content className="text-capitalize" title={process.name}>
|
||||
<Page.Content title={process.name}>
|
||||
<p className="text-capitalize">State: {process.state}</p>
|
||||
<div className="logs">
|
||||
{
|
||||
processLogs.map((item, i) => <p key={i} className={item.logLevel}>{item.msg_clear || item.msg}</p>)
|
||||
processLogs.map((item, i) => <p key={i} className={item.logLevel} dangerouslySetInnerHTML={{__html: convert.toHtml(item.msg)}}></p>)
|
||||
}
|
||||
</div>
|
||||
</Page.Content>
|
||||
|
|
Loading…
Reference in New Issue