bump copyright, added stats page and updated dependencies

This commit is contained in:
ston1th 2020-01-11 11:32:27 +01:00
commit 0265d820fe
111 changed files with 9556 additions and 3835 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2019 Marius Schellenberger
// Copyright (C) 2020 Marius Schellenberger
// This file is auto-generated by templates.sh
// using the contents of the templates directory
@ -151,6 +151,7 @@ const (
{{if .Login}}
{{if .Admin}}
<li class="nav-item"><a class="nav-link" href="/users">Users</a></li>
<li class="nav-item"><a class="nav-link" href="/stats">Stats</a></li>
{{else}}
<li class="nav-item"><a class="nav-link" href="/user/edit/{{.User}}">Profile</a></li>
{{end}}
@ -625,6 +626,39 @@ const (
{{end}}
</div>
{{end}}
{{end}}`
stats = `{{define "body"}}
<div class="page-header">
<div class="row">
<h2>{{.BodyTitle}}</h2>
</div>
</div>
<div class="row">
<table class="table table-stripped table-hover">
<tbody>
<tr>
<td><b>Goroutines</b></td>
<td>{{.Data.Goroutines}}</td>
</tr>
<tr>
<td><b>Memory usage</b></td>
<td>{{.Data.Alloc}} MiB</td>
</tr>
<tr>
<td><b>Memory allocated</b></td>
<td>{{.Data.Sys}} MiB</td>
</tr>
<tr>
<td><b>Documents</b></td>
<td>{{.Data.Docs}}</td>
</tr>
<tr>
<td><b>Go Version</b></td>
<td>{{.Data.GoVersion}}</td>
</tr>
</tbody>
</table>
</div>
{{end}}`
userDel = `{{define "body"}}
{{if .Data}}
@ -1068,6 +1102,8 @@ func (s *HTTPServer) loadTemplates() {
s.templ["userDelHandler"] = parse(index, menu, userDel)
// totp
s.templ["userTotpHandler"] = parse(index, menu, userTotp)
// stats
s.templ["statsHandler"] = parse(index, menu, stats)
if fatal {
log.Fatal("parse: ", errors.New("parsing templates failed"))