Commit 35469f79 authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

dev data finished without graph nac

parent 07c7c87f
...@@ -40,6 +40,11 @@ ...@@ -40,6 +40,11 @@
/*workaround to make clickable in IE */ /*workaround to make clickable in IE */
} }
.glyphicon.glyphicon-arrow-left { .glyphicon-pagenav {
font-size: 50px; font-size: 50px;
} }
.glyphicon-graphnav {
font-size: 40px;
}
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="row"> <div class="row">
<div class="col-md-1"> <div class="col-md-1">
<div class="clickback"> <div class="clickback">
<span class="glyphicon glyphicon-arrow-left"></span> <span class="glyphicon glyphicon-arrow-left glyphicon-pagenav"></span>
<p><a class="backlink" onclick="history.back(-1)"></a></p> <p><a class="backlink" onclick="history.back(-1)"></a></p>
</div> </div>
</div> </div>
...@@ -34,11 +34,22 @@ ...@@ -34,11 +34,22 @@
{% for k in data[0][2] %} {% for k in data[0][2] %}
<div id="{{ k }}" class="tabcontent"> <div id="{{ k }}" class="tabcontent">
<center><div id="curve_chart_{{ k }}"></div></center> <center><div id="curve_chart_{{ k }}"></div></center>
<!--
<br> <div>
<div style="float:left;">
<span class="glyphicon glyphicon-arrow-left glyphicon-graphnav"></span>
</div>
<div style="float:right;">
<span class="glyphicon glyphicon-arrow-right glyphicon-graphnav"></span>
</div>
</div>
<br><br>
-->
<center>
<p>Total: <strong>{{ total }}</strong> messages. <p>Total: <strong>{{ total }}</strong> messages.
<a href="/data-csv"><button type="submit" class="btn btn-primary">Download CSV</button></a>
</p> </p>
<a href="/data-csv"><button type="submit" class="btn btn-primary">Download CSV</button></a>
</center>
<br> <br>
<table class="table" id="table_{{ k }}"> <table class="table" id="table_{{ k }}">
...@@ -60,6 +71,8 @@ ...@@ -60,6 +71,8 @@
{% if data %} {% if data %}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
function init_scroll() { function init_scroll() {
var ts = { var ts = {
{% for k in data[0][2] %} {% for k in data[0][2] %}
...@@ -70,7 +83,6 @@ ...@@ -70,7 +83,6 @@
} }
var tscroll = init_scroll(); var tscroll = init_scroll();
google.charts.load('current', {'packages':['corechart']});
function drawChart(dname, ddata) { function drawChart(dname, ddata) {
var data = google.visualization.arrayToDataTable(ddata); var data = google.visualization.arrayToDataTable(ddata);
...@@ -79,8 +91,7 @@ ...@@ -79,8 +91,7 @@
title: '{{ devname }} > '+dname, title: '{{ devname }} > '+dname,
curveType: 'function', curveType: 'function',
hAxis: { hAxis: {
format: 'dd/MM hh:mm', format: 'dd/MM hh:mm'
}, },
vAxis: { vAxis: {
format: 'decimal', format: 'decimal',
...@@ -119,7 +130,9 @@ ...@@ -119,7 +130,9 @@
document.getElementById(dname).style.display = "block"; document.getElementById(dname).style.display = "block";
evt.currentTarget.className += " active"; evt.currentTarget.className += " active";
fetch(window.origin+'/dev-data/'+dname+'/graph/'+tscroll[dname]).then(res => res.text()).then(data => drawChart(dname, eval(data))); tscroll = init_scroll();
fetch(window.origin+'/dev-data/'+dname+'/graph/1').then(res => res.text()).then(data => drawChart(dname, eval(data)));
fetch(window.origin+'/dev-data/'+dname+'/table/'+tscroll[dname]).then(res => res.text()).then(data => $('#table_'+dname+'_body').html(data)); fetch(window.origin+'/dev-data/'+dname+'/table/'+tscroll[dname]).then(res => res.text()).then(data => $('#table_'+dname+'_body').html(data));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment