You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.3 KiB
129 lines
3.3 KiB
<script src='{{ root }}main.js'></script>
|
|
<script src='{{ root }}js/jquery.min.js'></script>
|
|
<script src='{{ root }}js/mobile-style.js'></script>
|
|
|
|
<script src="{{ root }}js/chartist/chartist.min.js"></script>
|
|
<link rel='stylesheet' href='{{ root }}stylesheets/chartist/chartist.min.css'>
|
|
|
|
{% if statistics_table %}
|
|
<table style="margin:auto; padding: 20px 0px;">
|
|
<thead>
|
|
<tr>
|
|
<th style="padding: 0px 5px;">{% trans "Board" %}</th>
|
|
<th style="padding: 0px 5px;">{% trans "PPH" %}</th>
|
|
<th style="padding: 0px 5px;">{% trans "IPs last hour" %}</th>
|
|
<th style="padding: 0px 5px;">{% trans "IPs last day" %}</th>
|
|
<th style="padding: 0px 5px;">{% trans "IPs last week" %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<span>{% trans "Total" %}</span>
|
|
</td>
|
|
<td style="text-align: center;">
|
|
<span>{{ statistics_table.pph }}</span>
|
|
</td>
|
|
<td style="text-align: center;">
|
|
<span>{{ statistics_table.hourly_ips }}</span>
|
|
</td>
|
|
<td style="text-align: center;">
|
|
<span>{{ statistics_table.daily_ips }}</span>
|
|
</td>
|
|
<td style="text-align: center;">
|
|
<span>{{ statistics_table.weekly_ips }}</span>
|
|
</td>
|
|
</tr>
|
|
{% for boardStat in statistics_table.boards %}
|
|
<tr>
|
|
<td>
|
|
<span>{{ boardStat.title }}</span>
|
|
</td>
|
|
<td style="text-align: center;">
|
|
<span>{{ boardStat.pph }}</span>
|
|
</td>
|
|
<td style="text-align: center;">
|
|
<span>{{ boardStat.hourly_ips }}</span>
|
|
</td>
|
|
<td style="text-align: center;">
|
|
<span>{{ boardStat.daily_ips }}</span>
|
|
</td>
|
|
<td style="text-align: center;">
|
|
<span>{{ boardStat.weekly_ips }}</span>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
<noscript>The following are JavaScript graphs.</noscript>
|
|
{% if (mod) or (public_hourly) %}
|
|
<h2>Hourly Statistics</h2>
|
|
<section>
|
|
<div class="ct-chart" id="hourly"></div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
<h2>Weekly Statistics (for this and previous week)</h2>
|
|
<section>
|
|
<div class="ct-chart" id="week"></div>
|
|
</section>
|
|
|
|
<h2>View Board Specific Stats</h2>
|
|
<section>
|
|
{% if mod %}
|
|
<a href="?/statistics">[Full Statistics]</a>
|
|
{% for board in boards %}
|
|
<a href="?/{{board.uri}}/statistics">[{{board.uri}}]</a>
|
|
{% endfor %}
|
|
{% else %}
|
|
<a href="{{ config.root }}/{{ stat_filename }}">[Full Statistics]</a>
|
|
{% for board in boards %}
|
|
<a href="{{ config.root }}/{{ board.uri }}/{{ stat_filename }}">[{{board.uri}}]</a>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</section>
|
|
|
|
<script type="text/javascript">{% raw %}
|
|
|
|
{% endraw %}{% if (mod) or (public_hourly) %}{% raw %}
|
|
var data_24h = {
|
|
labels: [ "AM", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11",
|
|
"PM", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11" ],
|
|
series: [
|
|
[{% endraw %}{{ statistics_24h }}{% raw %}]
|
|
]
|
|
};
|
|
|
|
var options_24h = {
|
|
width: 800,
|
|
height: 300
|
|
};
|
|
|
|
new Chartist.Line('#hourly', data_24h, options_24h);
|
|
{% endraw %}{% endif %}{% raw %}
|
|
|
|
|
|
var data_week = {
|
|
labels: [{% endraw %}{{ statistics_week_labels }}{% raw %}],
|
|
series: [
|
|
[{% endraw %}{{ statistics_week_past }}{% raw %}],
|
|
[{% endraw %}{{ statistics_week }}{% raw %}]
|
|
]
|
|
};
|
|
|
|
var options_week = {
|
|
width: 800,
|
|
height: 300,
|
|
|
|
seriesBarDistance: 10,
|
|
reverseData: true,
|
|
horizontalBars: true,
|
|
axisY: {
|
|
offset: 70
|
|
}
|
|
};
|
|
|
|
new Chartist.Bar('#week', data_week, options_week);
|
|
|
|
{% endraw %}</script>
|