MCPcopy Index your code
hub / github.com/writefreely/writefreely / handleViewAdminDash

Function handleViewAdminDash

admin.go:118–145  ·  view source on GitHub ↗
(app *App, u *User, w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

116}
117
118func handleViewAdminDash(app *App, u *User, w http.ResponseWriter, r *http.Request) error {
119 p := struct {
120 *UserPage
121 *AdminPage
122 Message string
123
124 UsersCount, CollectionsCount, PostsCount int64
125 }{
126 UserPage: NewUserPage(app, r, u, "Admin", nil),
127 AdminPage: NewAdminPage(app),
128 Message: r.FormValue("m"),
129 }
130
131 // Get user stats
132 p.UsersCount = app.db.GetAllUsersCount()
133 var err error
134 p.CollectionsCount, err = app.db.GetTotalCollections()
135 if err != nil {
136 return err
137 }
138 p.PostsCount, err = app.db.GetTotalPosts()
139 if err != nil {
140 return err
141 }
142
143 showUserPage(w, "admin", p)
144 return nil
145}
146
147func handleViewAdminMonitor(app *App, u *User, w http.ResponseWriter, r *http.Request) error {
148 updateAppStats()

Callers

nothing calls this directly

Calls 6

NewUserPageFunction · 0.85
NewAdminPageFunction · 0.85
showUserPageFunction · 0.85
GetAllUsersCountMethod · 0.65
GetTotalCollectionsMethod · 0.65
GetTotalPostsMethod · 0.65

Tested by

no test coverage detected