summaryrefslogtreecommitdiffstats
path: root/routers/admin/admin.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/admin/admin.go')
-rw-r--r--routers/admin/admin.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go
index 45bdbfe7f2..9f155ff008 100644
--- a/routers/admin/admin.go
+++ b/routers/admin/admin.go
@@ -352,7 +352,16 @@ func Monitor(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("admin.monitor")
ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminMonitor"] = true
- ctx.Data["Processes"] = process.GetManager().Processes
+ ctx.Data["Processes"] = process.GetManager().Processes()
ctx.Data["Entries"] = cron.ListTasks()
ctx.HTML(200, tplMonitor)
}
+
+// MonitorCancel cancels a process
+func MonitorCancel(ctx *context.Context) {
+ pid := ctx.ParamsInt64("pid")
+ process.GetManager().Cancel(pid)
+ ctx.JSON(200, map[string]interface{}{
+ "redirect": ctx.Repo.RepoLink + "/admin/monitor",
+ })
+}