mirror of
https://github.com/samsonjs/retrogit.git
synced 2026-03-25 09:25:49 +00:00
Add totals to admin page.
This commit is contained in:
parent
8cb1302b1d
commit
f39b6e5e17
2 changed files with 9 additions and 1 deletions
|
|
@ -541,14 +541,18 @@ func usersAdminHandler(w http.ResponseWriter, r *http.Request) *AppError {
|
|||
}
|
||||
|
||||
users := make([]*AdminUserData, 0)
|
||||
totalRepos := 0
|
||||
for _ = range accounts {
|
||||
select {
|
||||
case r := <-ch:
|
||||
users = append(users, r)
|
||||
totalRepos += len(r.Repos.AllRepos)
|
||||
}
|
||||
}
|
||||
var data = map[string]interface{}{
|
||||
"Users": users,
|
||||
"Users": users,
|
||||
"TotalUsers": len(users),
|
||||
"TotalRepos": totalRepos,
|
||||
}
|
||||
return templates["users-admin"].Render(w, data)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
<link rel="stylesheet" href="/static/admin.css">
|
||||
|
||||
<div class="blurb">
|
||||
{{.TotalUsers}} users with {{.TotalRepos}} repositories.
|
||||
</div>
|
||||
|
||||
<table id="users-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
|||
Loading…
Reference in a new issue