You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.8 KiB
Plaintext
94 lines
2.8 KiB
Plaintext
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Block Explorer</title>
|
|
<link rel="stylesheet" href="/static/css/main.css"/>
|
|
</head>
|
|
<body>
|
|
<div id="page-wrapper">
|
|
{% block content %}
|
|
{% endblock content %}
|
|
<section id="footer">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div id="copyright">
|
|
<ul class="links">
|
|
<li><a href="https://git.wownero.com/lza_menace/wownero-explorer" target=_blank>View the code</a></li>
|
|
<li><a href="https://twitter.com/lza_menace" target=_blank>Holler at me dog</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
<script src="/static/js/react.min.js"></script>
|
|
<script src="/static/js/react-dom.min.js"></script>
|
|
<script src="/static/js/babel.min.js"></script>
|
|
<script src="/static/js/noty.js"></script>
|
|
<script type="text/babel">
|
|
|
|
'use strict';
|
|
|
|
const e = React.createElement;
|
|
|
|
class App extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
looping: false
|
|
}
|
|
}
|
|
|
|
render() {
|
|
// let updateAllData;
|
|
|
|
function getAllData() {
|
|
console.log('updating data');
|
|
// fetch('/')
|
|
// .then((response) => response.json())
|
|
// .then((res) => {
|
|
// document.getElementById('get_ticker_data').innerHTML = JSON.stringify(res);
|
|
// });
|
|
}
|
|
|
|
if (this.state.looping) {
|
|
updateAllData = setInterval(getAllData, 10000);
|
|
}
|
|
|
|
return(
|
|
<div>
|
|
<h1>test</h1>
|
|
{this.state.looping && (
|
|
<div>
|
|
<p>market making is started</p>
|
|
<button onClick={() => {
|
|
this.setState({...this.state, looping: false});
|
|
clearInterval(storeMarketData);
|
|
}}>Stop</button>
|
|
</div>
|
|
) || (
|
|
<div>
|
|
<p>market making is stopped</p>
|
|
<button onClick={() => {
|
|
this.setState({...this.state, looping: true});
|
|
getAllData();
|
|
}}>Start</button>
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
const domContainer = document.querySelector('#container');
|
|
const root = ReactDOM.createRoot(domContainer);
|
|
root.render(e(App));
|
|
|
|
</script> |