Visualisation intéreactive des règles

pull/1/head
Mael Thomas 2016-12-16 17:09:21 +01:00
parent 4d105a3f6a
commit 47f4b7c5ce
3 changed files with 5 additions and 5 deletions

View File

@ -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>

View File

@ -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",

View File

@ -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>