summaryrefslogtreecommitdiffstats
path: root/routers/admin/admin.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-06-22 13:14:03 -0400
committerUnknown <joe2010xtmf@163.com>2014-06-22 13:14:03 -0400
commit9924e65ca11770f247723b10fcbdb81dc9534b32 (patch)
tree23995a2838ac24c88ebfd9267b567ec7e4f1a05c /routers/admin/admin.go
parentc280415e0b449b420f4540886b8e16ae3c9e6454 (diff)
downloadgitea-9924e65ca11770f247723b10fcbdb81dc9534b32.tar.gz
gitea-9924e65ca11770f247723b10fcbdb81dc9534b32.zip
In progress of name template name constant
Diffstat (limited to 'routers/admin/admin.go')
-rw-r--r--routers/admin/admin.go27
1 files changed, 18 insertions, 9 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go
index 1567a3001a..140e1e9f63 100644
--- a/routers/admin/admin.go
+++ b/routers/admin/admin.go
@@ -20,6 +20,16 @@ import (
"github.com/gogits/gogs/modules/setting"
)
+const (
+ DASHBOARD base.TplName = "admin/dashboard"
+ USERS base.TplName = "admin/users"
+ REPOS base.TplName = "admin/repos"
+ AUTHS base.TplName = "admin/auths"
+ CONFIG base.TplName = "admin/config"
+ MONITOR_PROCESS base.TplName = "admin/monitor/process"
+ MONITOR_CRON base.TplName = "admin/monitor/cron"
+)
+
var startTime = time.Now()
var sysStatus struct {
@@ -140,7 +150,7 @@ func Dashboard(ctx *middleware.Context) {
ctx.Data["Stats"] = models.GetStatistic()
updateSystemStatus()
ctx.Data["SysStatus"] = sysStatus
- ctx.HTML(200, "admin/dashboard")
+ ctx.HTML(200, DASHBOARD)
}
func Users(ctx *middleware.Context) {
@@ -150,10 +160,10 @@ func Users(ctx *middleware.Context) {
var err error
ctx.Data["Users"], err = models.GetUsers(200, 0)
if err != nil {
- ctx.Handle(500, "admin.Users", err)
+ ctx.Handle(500, "admin.Users(GetUsers)", err)
return
}
- ctx.HTML(200, "admin/users")
+ ctx.HTML(200, USERS)
}
func Repositories(ctx *middleware.Context) {
@@ -166,7 +176,7 @@ func Repositories(ctx *middleware.Context) {
ctx.Handle(500, "admin.Repositories", err)
return
}
- ctx.HTML(200, "admin/repos")
+ ctx.HTML(200, REPOS)
}
func Auths(ctx *middleware.Context) {
@@ -179,7 +189,7 @@ func Auths(ctx *middleware.Context) {
ctx.Handle(500, "admin.Auths", err)
return
}
- ctx.HTML(200, "admin/auths")
+ ctx.HTML(200, AUTHS)
}
func Config(ctx *middleware.Context) {
@@ -235,7 +245,7 @@ func Config(ctx *middleware.Context) {
}
ctx.Data["Loggers"] = loggers
- ctx.HTML(200, "admin/config")
+ ctx.HTML(200, CONFIG)
}
func Monitor(ctx *middleware.Context) {
@@ -247,11 +257,10 @@ func Monitor(ctx *middleware.Context) {
case "process":
ctx.Data["PageIsMonitorProcess"] = true
ctx.Data["Processes"] = process.Processes
- ctx.HTML(200, "admin/monitor/process")
+ ctx.HTML(200, MONITOR_PROCESS)
default:
ctx.Data["PageIsMonitorCron"] = true
ctx.Data["Entries"] = cron.ListEntries()
- ctx.HTML(200, "admin/monitor/cron")
+ ctx.HTML(200, MONITOR_CRON)
}
-
}