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
|
@ -14,6 +14,7 @@ import (
|
|||
|
||||
"code.gitea.io/gitea/models/auth"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/modules/cache"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
@ -247,6 +248,7 @@ func APIContexter() func(http.Handler) http.Handler {
|
|||
Resp: NewResponse(w),
|
||||
Data: map[string]interface{}{},
|
||||
Locale: locale,
|
||||
Cache: cache.GetCache(),
|
||||
Repo: &Repository{
|
||||
PullRequest: &PullRequest{},
|
||||
},
|
||||
|
|
|
@ -9,9 +9,11 @@ import "code.gitea.io/gitea/modules/log"
|
|||
// Federation settings
|
||||
var (
|
||||
Federation = struct {
|
||||
Enabled bool
|
||||
Enabled bool
|
||||
ShareUserStatistics bool
|
||||
}{
|
||||
Enabled: true,
|
||||
Enabled: true,
|
||||
ShareUserStatistics: true,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue