5 Star 3 Fork 0

Gitee 极速下载 / revel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/robfig/revel/releases
克隆/下载
status.go 577 Bytes
一键复制 编辑 原始数据 按行查看 历史
Shane Logsdon 提交于 2013-12-07 16:37 . Update status.go
package controllers
import (
"github.com/robfig/cron"
"github.com/robfig/revel"
"github.com/robfig/revel/modules/jobs/app/jobs"
"strings"
)
type Jobs struct {
*revel.Controller
}
func (c Jobs) Status() revel.Result {
if _, ok := c.Request.Header["X-Forwarded-For"]; ok || !strings.HasPrefix(c.Request.RemoteAddr, "127.0.0.1:") {
return c.Forbidden("%s is not local", c.Request.RemoteAddr)
}
entries := jobs.MainCron.Entries()
return c.Render(entries)
}
func init() {
revel.TemplateFuncs["castjob"] = func(job cron.Job) *jobs.Job {
return job.(*jobs.Job)
}
}
1
https://gitee.com/mirrors/revel.git
git@gitee.com:mirrors/revel.git
mirrors
revel
revel
e8aac16df9e9

搜索帮助