9
9
asymkey_model "code.gitea.io/gitea/models/asymkey"
10
10
"code.gitea.io/gitea/models/auth"
11
11
"code.gitea.io/gitea/models/db"
12
+ git_model "code.gitea.io/gitea/models/git"
12
13
issues_model "code.gitea.io/gitea/models/issues"
13
14
"code.gitea.io/gitea/models/organization"
14
15
access_model "code.gitea.io/gitea/models/perm/access"
@@ -29,7 +30,8 @@ type Statistic struct {
29
30
Mirror , Release , AuthSource , Webhook ,
30
31
Milestone , Label , HookTask ,
31
32
Team , UpdateTask , Project ,
32
- ProjectBoard , Attachment int64
33
+ ProjectBoard , Attachment ,
34
+ Branches , Tags , CommitStatus int64
33
35
IssueByLabel []IssueByLabelCount
34
36
IssueByRepository []IssueByRepositoryCount
35
37
}
@@ -58,6 +60,9 @@ func GetStatistic(ctx context.Context) (stats Statistic) {
58
60
stats .Counter .Watch , _ = e .Count (new (repo_model.Watch ))
59
61
stats .Counter .Star , _ = e .Count (new (repo_model.Star ))
60
62
stats .Counter .Access , _ = e .Count (new (access_model.Access ))
63
+ stats .Counter .Branches , _ = e .Count (new (git_model.Branch ))
64
+ stats .Counter .Tags , _ = e .Where ("is_draft=?" , false ).Count (new (repo_model.Release ))
65
+ stats .Counter .CommitStatus , _ = e .Count (new (git_model.CommitStatus ))
61
66
62
67
type IssueCount struct {
63
68
Count int64
0 commit comments