Visualisation intéreactive des règles
parent
4d105a3f6a
commit
47f4b7c5ce
|
@ -10,8 +10,5 @@
|
|||
<body>
|
||||
<div id="js">lOl</div>
|
||||
<script type="text/javascript" src="/dist/bundle.js"></script>
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
"react": "^15.0.1",
|
||||
"react-dom": "^15.0.1",
|
||||
"react-hot-loader": "3.0.0-beta.2",
|
||||
"react-json-tree": "^0.10.0",
|
||||
"react-redux": "^4.4.5",
|
||||
"react-router": "^2.6.1",
|
||||
"redux": "^3.5.2",
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
import React, { Component } from 'react'
|
||||
import {findRuleByName} from '../model.js'
|
||||
import {safeDump} from 'js-yaml'
|
||||
import './Rule.css'
|
||||
import JSONTree from 'react-json-tree'
|
||||
|
||||
export default class Rule extends Component {
|
||||
render() {
|
||||
let json = findRuleByName(this.props.params.name)[2]
|
||||
|
||||
return (
|
||||
<div id="variable">
|
||||
<pre>
|
||||
<code className="yaml">
|
||||
{safeDump(findRuleByName(this.props.params.name)[2])}
|
||||
<JSONTree hideRoot="true" shouldExpandNode={() => true} data={json} />
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue