mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-19 00:10:15 +00:00
Federation: return useful statistic information for nodeinfo (#19561)
Add statistic information for total user count, active user count, issue count and comment count for `/nodeinfo`
This commit is contained in:
parent
509d811243
commit
e2a3f3d259
11 changed files with 78 additions and 16 deletions
|
@ -49,7 +49,7 @@ type IssueByRepositoryCount struct {
|
|||
// GetStatistic returns the database statistics
|
||||
func GetStatistic() (stats Statistic) {
|
||||
e := db.GetEngine(db.DefaultContext)
|
||||
stats.Counter.User = user_model.CountUsers()
|
||||
stats.Counter.User = user_model.CountUsers(nil)
|
||||
stats.Counter.Org = organization.CountOrganizations()
|
||||
stats.Counter.PublicKey, _ = e.Count(new(asymkey_model.PublicKey))
|
||||
stats.Counter.Repo = repo_model.CountRepositories(true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue