Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
b03e37e7
Commit
b03e37e7
authored
Nov 01, 2016
by
chirac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fluidifie le code
parent
64f035ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
logs/templates/logs/aff_stats_users.html
logs/templates/logs/aff_stats_users.html
+6
-4
logs/views.py
logs/views.py
+14
-3
No files found.
logs/templates/logs/aff_stats_users.html
View file @
b03e37e7
{% for key, stats in stats_list.items %}
{% for key_dict, stats_dict in stats_list.items %}
{% for key, stats in stats_dict.items %}
<table
class=
"table table-striped"
>
<h4>
Statistiques par utilisateur
de {{ key }}
</h4>
<h4>
Statistiques par {{ key_dict }}
de {{ key }}
</h4>
<thead>
<tr>
<th>
Utilisateur
</th>
<th>
Nombre d'objets de l'utilisateur
</th>
<th>
{{ key_dict }}
</th>
<th>
Nombre de {{ key }} par {{ key_dict }}
</th>
<th>
Rang
</th>
</tr>
</thead>
...
...
@@ -17,3 +18,4 @@
{% endfor %}
</table>
{% endfor %}
{% endfor %}
logs/views.py
View file @
b03e37e7
...
...
@@ -106,13 +106,22 @@ def stats_models(request):
@
permission_required
(
'cableur'
)
def
stats_users
(
request
):
stats
=
{
'Utilisateur'
:
{
'Machines'
:
User
.
objects
.
annotate
(
num
=
Count
(
'machine'
)).
order_by
(
'-num'
)[:
10
],
'Facture'
:
User
.
objects
.
annotate
(
num
=
Count
(
'facture'
)).
order_by
(
'-num'
)[:
10
],
'Bannissement'
:
User
.
objects
.
annotate
(
num
=
Count
(
'ban'
)).
order_by
(
'-num'
)[:
10
],
'Accès gracieux'
:
User
.
objects
.
annotate
(
num
=
Count
(
'whitelist'
)).
order_by
(
'-num'
)[:
10
],
'Etablissements'
:
School
.
objects
.
annotate
(
num
=
Count
(
'user'
)).
order_by
(
'-num'
)[:
10
],
'Moyen de paiment'
:
Paiement
.
objects
.
annotate
(
num
=
Count
(
'facture'
)).
order_by
(
'-num'
)[:
10
],
'Banque'
:
Banque
.
objects
.
annotate
(
num
=
Count
(
'facture'
)).
order_by
(
'-num'
)[:
10
],
'Droits'
:
User
.
objects
.
annotate
(
num
=
Count
(
'right'
)).
order_by
(
'-num'
)[:
10
],
},
'Etablissement'
:
{
'Utilisateur'
:
School
.
objects
.
annotate
(
num
=
Count
(
'user'
)).
order_by
(
'-num'
)[:
10
],
},
'Moyen de paiement'
:
{
'Utilisateur'
:
Paiement
.
objects
.
annotate
(
num
=
Count
(
'facture'
)).
order_by
(
'-num'
)[:
10
],
},
'Banque'
:
{
'Utilisateur'
:
Banque
.
objects
.
annotate
(
num
=
Count
(
'facture'
)).
order_by
(
'-num'
)[:
10
],
},
}
return
render
(
request
,
'logs/stats_users.html'
,
{
'stats_list'
:
stats
})
...
...
@@ -120,6 +129,8 @@ def stats_users(request):
@
permission_required
(
'cableur'
)
def
stats_actions
(
request
):
stats
=
{
'Utilisateur'
:
{
'Action'
:
User
.
objects
.
annotate
(
num
=
Count
(
'revision'
)).
order_by
(
'-num'
)[:
40
],
},
}
return
render
(
request
,
'logs/stats_users.html'
,
{
'stats_list'
:
stats
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment