Add the log tables to the debug page.

This commit is contained in:
Azareal 2019-06-05 11:46:45 +10:00
parent a339a3eb69
commit 05a8adb25e
3 changed files with 42 additions and 1 deletions

View File

@ -621,6 +621,11 @@ type DebugPageDatabase struct {
Attachments int Attachments int
Polls int Polls int
LoginLogs int
RegLogs int
ModLogs int
AdminLogs int
Views int Views int
ViewsAgents int ViewsAgents int
ViewsForums int ViewsForums int

View File

@ -80,6 +80,24 @@ func Debug(w http.ResponseWriter, r *http.Request, user c.User) c.RouteError {
if err != nil { if err != nil {
return c.InternalError(err,w,r) return c.InternalError(err,w,r)
} }
loginLogs, err := count("login_logs")
if err != nil {
return c.InternalError(err,w,r)
}
regLogs, err := count("registration_logs")
if err != nil {
return c.InternalError(err,w,r)
}
modLogs, err := count("moderation_logs")
if err != nil {
return c.InternalError(err,w,r)
}
adminLogs, err := count("administration_logs")
if err != nil {
return c.InternalError(err,w,r)
}
views, err := count("viewchunks") views, err := count("viewchunks")
if err != nil { if err != nil {
return c.InternalError(err,w,r) return c.InternalError(err,w,r)
@ -112,7 +130,7 @@ func Debug(w http.ResponseWriter, r *http.Request, user c.User) c.RouteError {
if err != nil { if err != nil {
return c.InternalError(err,w,r) return c.InternalError(err,w,r)
} }
debugDatabase := c.DebugPageDatabase{c.Topics.Count(),c.Users.Count(),c.Rstore.Count(),c.Prstore.Count(),c.Activity.Count(),likes,attachs,polls,views,viewsAgents,viewsForums,viewsLangs,viewsReferrers,viewsSystems,postChunks,topicChunks} debugDatabase := c.DebugPageDatabase{c.Topics.Count(),c.Users.Count(),c.Rstore.Count(),c.Prstore.Count(),c.Activity.Count(),likes,attachs,polls,loginLogs,regLogs,modLogs,adminLogs,views,viewsAgents,viewsForums,viewsLangs,viewsReferrers,viewsSystems,postChunks,topicChunks}
staticSize, err := c.DirSize("./public/") staticSize, err := c.DirSize("./public/")
if err != nil { if err != nil {

View File

@ -121,6 +121,24 @@
<div class="grid_item grid_stat"><span>?</span></div> <div class="grid_item grid_stat"><span>?</span></div>
<div class="grid_item grid_stat grid_stat_head"><span>Login Logs</span></div>
<div class="grid_item grid_stat grid_stat_head"><span>Reg Logs</span></div>
<div class="grid_item grid_stat grid_stat_head"><span>Mod Logs</span></div>
<div class="grid_item grid_stat"><span>{{.Database.LoginLogs}}</span></div>
<div class="grid_item grid_stat"><span>{{.Database.RegLogs}}</span></div>
<div class="grid_item grid_stat"><span>{{.Database.ModLogs}}</span></div>
<div class="grid_item grid_stat grid_stat_head"><span>Admin Logs</span></div>
<div class="grid_item grid_stat grid_stat_head"><span>???</span></div>
<div class="grid_item grid_stat grid_stat_head"><span>???</span></div>
<div class="grid_item grid_stat"><span>{{.Database.AdminLogs}}</span></div>
<div class="grid_item grid_stat"><span>?</span></div>
<div class="grid_item grid_stat"><span>?</span></div>
<div class="grid_item grid_stat grid_stat_head"><span>Views</span></div> <div class="grid_item grid_stat grid_stat_head"><span>Views</span></div>
<div class="grid_item grid_stat grid_stat_head"><span>Views Agents</span></div> <div class="grid_item grid_stat grid_stat_head"><span>Views Agents</span></div>
<div class="grid_item grid_stat grid_stat_head"><span>Views Forums</span></div> <div class="grid_item grid_stat grid_stat_head"><span>Views Forums</span></div>