mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
feat: show size of DB on the about page
This commit is contained in:
parent
12ca7aa085
commit
0cf5051cf8
22 changed files with 175 additions and 135 deletions
|
@ -22,6 +22,8 @@ func (h *handler) showAboutPage(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
dbSize, dbErr := h.store.DBSize()
|
||||
|
||||
sess := session.New(h.store, request.SessionID(r))
|
||||
view := view.New(h.tpl, r, sess)
|
||||
view.Set("version", version.Version)
|
||||
|
@ -35,5 +37,11 @@ func (h *handler) showAboutPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("postgres_version", h.store.DatabaseVersion())
|
||||
view.Set("go_version", runtime.Version())
|
||||
|
||||
if dbErr != nil {
|
||||
view.Set("db_usage", dbErr)
|
||||
} else {
|
||||
view.Set("db_usage", dbSize)
|
||||
}
|
||||
|
||||
html.OK(w, r, view.Render("about"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue