dev-data.html 793 Bytes
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
		{% if data %}
Vladislav Rykov's avatar
Vladislav Rykov committed
10
11
		<p>Last 5 messages:</p>
		
Vladislav Rykov's avatar
Vladislav Rykov committed
12
13
14
15
16
17
18
		<table class="table">
			<thead>
				<th>Time</th>
				<th>Content</th>
			</thead>
			<tbody>
			{% for d in data %}
Vladislav Rykov's avatar
Vladislav Rykov committed
19
			<tr>
Vladislav Rykov's avatar
Vladislav Rykov committed
20
21
				<th> {{ d[1] }} </th>
				<th> {{ d[2] }} </th>
Vladislav Rykov's avatar
Vladislav Rykov committed
22
23
			</tr>
			{% endfor %}
Vladislav Rykov's avatar
Vladislav Rykov committed
24
			</tbody>
Vladislav Rykov's avatar
Vladislav Rykov committed
25
26
		</table>

Vladislav Rykov's avatar
Vladislav Rykov committed
27
		<p>Total: {{ total }} messages.</p>
Vladislav Rykov's avatar
Vladislav Rykov committed
28
29

		<a href="/data-csv"><button type="submit" class="btn btn-primary">Download CSV</button></a>
Vladislav Rykov's avatar
Vladislav Rykov committed
30
31
32
		{% else %}
		<p>Device have not sent any data yet.</p>
		{% endif %}
Vladislav Rykov's avatar
Vladislav Rykov committed
33
34
35
36
37
38
39
40
41
42
43
	</div>
</div>

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

{% endblock %}