stats: Add stats page

* add stats_table_data() function on the backend
* add stats HTML page and route

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2023-09-09 22:59:38 -07:00
parent 3760d5a941
commit cc9c5b5f43
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
{% extends "base.html" %}
{% block title %}Stats{% endblock title %}
{% block main %}
<h2>Statistics</h2>
<div class="infobox">
<h4>Histogram</h4>
<p>
<img src="{{static_url("histogram.svg")}}" width="33%" />
</p>
<p>
<a target="_blank" href="{{static_url("histogram.svg")}}">Click here to see the full histogram view</a>
</p>
<hr/>
<h4>Table</h4>
<p>
<table>
<thead>
<tr>
<th>Board</th>
<th>Bans</th>
</tr>
</thead>
<tbody>
{% for row in stats_table_data() %}
<tr>
<td>{{row['board']}}</td>
<td>{{row["bans"]}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</p>
</div>
{% endblock main %}