dev-data.html 1.12 KB
Newer Older
Vladislav Rykov's avatar
Vladislav Rykov committed
1
2
3
4
5
6
7
8
{% extends 'layout.html' %}

{% block title %} Device Data: {% endblock %}

{% block content %}

<div class="row">
	<div class="col-md-6 col-md-offset-3">
Vladislav Rykov's avatar
Vladislav Rykov committed
9
10
11
12
13
14
15
		<div class="panel panel-success">
			<div class="panel-heading">
				<h2><center> {{ devname }} data </center></h2>
			</div>
			<div class="panel-body">
				{% if data %}
				<p>Last {{ lastctr }} messages:</p>
Vladislav Rykov's avatar
Vladislav Rykov committed
16
		
Vladislav Rykov's avatar
Vladislav Rykov committed
17
18
19
20
21
22
23
24
25
				<table class="table">
					<thead>
						<th>Time</th>
						<th>Content</th>
					</thead>
					<tbody>
					{% for d in data %}
						<tr>
							<th> {{ d[1] }} </th>
Vladislav Rykov's avatar
Vladislav Rykov committed
26
27
28
29
30
							<th>
							{% for k in d[2] %}
							{{ k }} : {{ d[2][k] }} <br>
							{% endfor %}
							</th>
Vladislav Rykov's avatar
Vladislav Rykov committed
31
32
33
34
35
36
37
38
39
40
41
						</tr>
					{% endfor %}
					</tbody>
				</table>

				<p>Total: <strong>{{ total }}</strong> messages.</p>

				<center>
				<a href="/data-csv"><button type="submit" class="btn btn-primary">Download CSV</button></a>
				</center>
				{% else %}
42
				<h3><center>Device have not sent any data yet.</center></h3>
Vladislav Rykov's avatar
Vladislav Rykov committed
43
				{% endif %}
Vladislav Rykov's avatar
Vladislav Rykov committed
44
45
46
47
48
49
50
51
52
53
54
	</div>
</div>

<script type="text/javascrypt">
function conf() {
	return confirm("Are you sure? It will remove all device data.")
}
</script>

{% endblock %}