diff --git a/control/service.go b/control/service.go index b050ac3..e774435 100644 --- a/control/service.go +++ b/control/service.go @@ -62,5 +62,8 @@ func (srv Service) Load() error { ctlAPI.GET("tasks", auth.ACAdmin(), func(c *gin.Context) { server.OK(c, task.GetProfile()) }) + ctlAPI.GET("task", auth.ACAdmin(), func(c *gin.Context) { + server.OK(c, task.GetTasks()) + }) return nil } diff --git a/task/profile.go b/task/profile.go index a4ff4ad..cf2d5a2 100644 --- a/task/profile.go +++ b/task/profile.go @@ -31,14 +31,11 @@ type Report struct { } type Profile struct { - Tasks map[string]*Task Scheduled []*Report `json:"scheduled"` } func GetProfile() *Profile { - p := &Profile{ - Tasks: GetTasks(), - } + p := &Profile{} entries := c.Entries() for i := 0; i < len(entries); i++ { t, ok := entries[i].Job.(*_task)