mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-24 12:23:11 +00:00
Premier graph et création des fichiers
This commit is contained in:
parent
d7c2b2f5e8
commit
5f8d0976b9
4 changed files with 46 additions and 0 deletions
27
logs/templates/logs/aff_charts.html
Normal file
27
logs/templates/logs/aff_charts.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
{% comment %}
|
||||
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
|
||||
se veut agnostique au réseau considéré, de manière à être installable en
|
||||
quelques clics.
|
||||
|
||||
Copyright © 2017 Gabriel Détraz
|
||||
Copyright © 2017 Goulven Kermarec
|
||||
Copyright © 2017 Augustin Lemesle
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
{% endcomment %}
|
||||
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.bundle.min.js"></script>
|
||||
{{ ActiveUser.as_html }}
|
|
@ -52,6 +52,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<i class="fa fa-users"></i>
|
||||
{% trans "Users" %}
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-charts" %}">
|
||||
<i class="fa fa-users"></i>
|
||||
{% trans "Charts" %}
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ urlpatterns = [
|
|||
url(r'^stats_models/$', views.stats_models, name='stats-models'),
|
||||
url(r'^stats_users/$', views.stats_users, name='stats-users'),
|
||||
url(r'^stats_actions/$', views.stats_actions, name='stats-actions'),
|
||||
url(r'^stats_charts/$', views.charts, name='stats-charts'),
|
||||
url(
|
||||
r'(?P<application>\w+)/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$',
|
||||
views.history,
|
||||
|
|
|
@ -51,6 +51,9 @@ from django.utils.translation import ugettext as _
|
|||
from reversion.models import Revision
|
||||
from reversion.models import Version, ContentType
|
||||
|
||||
from .charts import (
|
||||
ActiveUserChart,
|
||||
)
|
||||
from users.models import (
|
||||
User,
|
||||
ServiceUser,
|
||||
|
@ -533,3 +536,14 @@ def history(request, application, object_name, object_id):
|
|||
{'reversions': reversions, 'object': instance}
|
||||
)
|
||||
|
||||
@login_required
|
||||
def charts(request):
|
||||
"""Sert les graphiques des statistiques"""
|
||||
|
||||
ActiveUser = ActiveUserChart()
|
||||
|
||||
return render(
|
||||
request,
|
||||
'logs/aff_charts.html',
|
||||
{'ActiveUser': ActiveUser}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue