This repository has been archived by the owner on Mar 2, 2019. It is now read-only.
/
usage.html
96 lines (87 loc) · 3.05 KB
/
usage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{% extends "frontend/base-usage.html" %}
{% comment %}
tollgate admin usage report page
Copyright 2008-2012 Michael Farrell <http://micolous.id.au/>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load url from future %}
{% load i18n %}
{% load humanize %}
{% block title %}internet usage report ({{ mode }}){% endblock %}
{% block content %}
{% if quota_update_fail %}
<p><strong>Warning:</strong> The firewall controller system is currently down, so this data hasn't been updated. Go start it up again so I can get current usage data.</p>
{% endif %}
<p>A total of {{ total }} was used.</p>
<ul>
{% if perms.frontend.can_toggle_internet %}
<li>
<form method="post" action="{% url 'usage-all-on' %}">{% csrf_token %}
<input type="submit" value="Turn on everyone's internet access that has opted to switch it on" />
</form>
</li>
<li>
<form method="post" action="{% url 'usage-all-really-on' %}">{% csrf_token %}
<input type="submit" value="Turn on everyone's internet access, even if they have disabled it" />
</form>
</li>
<li>
<form method="post" action="{% url 'usage-all-off' %}">{% csrf_token %}
<input type="submit" value="Turn off everyone's internet access" />
</form>
</li>
{% else %}
<li>You're not authorised to toggle other users' internet access, you need <code>can_toggle_internet</code>.</li>
{% endif %}
</ul>
<table class="internet">
<tr>
<th>Forum ID</th>
<th>Username</th>
<th>Full Name</th>
<th>Quota Used</th>
<th>Quota Remaining</th>
<th>Quota Class</th>
<th>Resets</th>
<th title="Average data transfer over last 10 minutes">Speed</td>
<th>Internet On?</th>
</tr>
{% for a in attendances %}
<tr class="{% cycle row1,row2 %}">
<td>{{ a.user_profile.user.id }}</td>
<td>{{ a.user_profile.user.username }}</td>
<td>{{ a.user_profile.user.first_name }} {{ a.user_profile.user.last_name }}</td>
<td>{{ a.quota_used_str }}</td>
{% if a.quota_unmetered %}
<td colspan="3">Unmetered</td>
{% else %}
{% if a.is_revoked %}
<td colspan="3">Revoked</td>
{% else %}
<td>{{ a.quota_remaining_str }}</td>
<td>{{ a.quota_amount_str }}</td>
<td>{{ a.reset_count }}</td>
{% endif %}
{% endif %}
<td>{{ a.last_datapoint_speed }}</td>
<td>
{% if a.user_profile.internet_on %}
<span class="yes">Yes</span>
{% else %}
<span class="no">No</span>
{% endif %}
</td>
<td><a href="{% url 'usage-info' a.id %}">More...</a></td>
</tr>
{% endfor %}
</table>
{% endblock %}