2017-03-09 03:39:06 +00:00
|
|
|
package web
|
|
|
|
|
2017-06-29 07:15:33 +00:00
|
|
|
import "github.com/shunfei/cronsun/conf"
|
2017-03-09 03:39:06 +00:00
|
|
|
|
2017-03-16 02:19:57 +00:00
|
|
|
type Configuration struct{}
|
2017-03-09 03:39:06 +00:00
|
|
|
|
2017-06-29 07:15:33 +00:00
|
|
|
func (cnf *Configuration) Configuratios(ctx *Context) {
|
2017-12-07 07:37:01 +00:00
|
|
|
r := struct {
|
|
|
|
Security *conf.Security `json:"security"`
|
|
|
|
Alarm bool `json:"alarm"`
|
|
|
|
LogExpirationDays int `json:"log_expiration_days"`
|
2017-03-16 02:19:57 +00:00
|
|
|
}{
|
|
|
|
Security: conf.Config.Security,
|
2017-04-07 08:28:41 +00:00
|
|
|
Alarm: conf.Config.Mail.Enable,
|
2017-12-07 07:37:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if conf.Config.Web.LogCleaner.EveryMinute > 0 {
|
|
|
|
r.LogExpirationDays = conf.Config.Web.LogCleaner.ExpirationDays
|
|
|
|
}
|
|
|
|
|
|
|
|
outJSON(ctx.W, r)
|
2017-03-09 03:39:06 +00:00
|
|
|
}
|