diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-20 16:04:56 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-20 16:04:56 -0400 |
commit | 06631ab91f5d84b48d6f71ac8eaf4df740ba0282 (patch) | |
tree | 8bfcccc57550c016b90a73fc57cc24942d508096 /routers/admin | |
parent | 686348974b1a1f6f11cab5244df2362f99e0a124 (diff) | |
download | gitea-06631ab91f5d84b48d6f71ac8eaf4df740ba0282.tar.gz gitea-06631ab91f5d84b48d6f71ac8eaf4df740ba0282.zip |
Basic admin data table, models changes
Diffstat (limited to 'routers/admin')
-rw-r--r-- | routers/admin/admin.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go index c7523b7f59..a37f1207c9 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -5,20 +5,35 @@ package admin import ( + "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/middleware" ) func Dashboard(ctx *middleware.Context) { ctx.Data["Title"] = "Admin Dashboard" + ctx.Data["Stats"] = models.GetStatistic() ctx.HTML(200, "admin/dashboard") } func Users(ctx *middleware.Context) { ctx.Data["Title"] = "User Management" + + var err error + ctx.Data["Users"], err = models.GetUsers(100, 0) + if err != nil { + ctx.Handle(200, "admin.Users", err) + return + } ctx.HTML(200, "admin/users") } func Repositories(ctx *middleware.Context) { ctx.Data["Title"] = "Repository Management" + var err error + ctx.Data["Repos"], err = models.GetRepos(100, 0) + if err != nil { + ctx.Handle(200, "admin.Repositories", err) + return + } ctx.HTML(200, "admin/repos") } |