diff --git a/README.md b/README.md
index f821c2d..02d67d5 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
LOGO designed by 熊大 .
-
+
:trollface: 哪吒监控 一站式轻监控轻运维系统。支持系统状态、HTTP(SSL 证书变更、即将到期、到期)、TCP、Ping 监控报警,命令批量执行和计划任务。
diff --git a/cmd/dashboard/controller/member_api.go b/cmd/dashboard/controller/member_api.go index 9c9b3bd..a195237 100644 --- a/cmd/dashboard/controller/member_api.go +++ b/cmd/dashboard/controller/member_api.go @@ -457,7 +457,6 @@ type settingForm struct { ViewPassword string EnableIPChangeNotification string IgnoredIPNotification string - Oauth2Type string GRPCHost string Cover uint8 } @@ -479,7 +478,6 @@ func (ma *memberAPI) updateSetting(c *gin.Context) { dao.Conf.Site.Theme = sf.Theme dao.Conf.Site.CustomCode = sf.CustomCode dao.Conf.Site.ViewPassword = sf.ViewPassword - dao.Conf.Oauth2.Type = sf.Oauth2Type dao.Conf.Oauth2.Admin = sf.Admin if err := dao.Conf.Save(); err != nil { c.JSON(http.StatusOK, model.Response{ diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go index 1f1d030..fe6cb58 100644 --- a/cmd/dashboard/main.go +++ b/cmd/dashboard/main.go @@ -1,7 +1,9 @@ package main import ( + "bytes" "context" + "fmt" "log" "time" @@ -56,6 +58,7 @@ func initSystem() { model.Notification{}, model.AlertRule{}, model.Monitor{}, model.MonitorHistory{}, model.Cron{}, model.Transfer{}) + dao.LoadNotifications() loadServers() //加载服务器列表 loadCrons() //加载计划任务 @@ -153,6 +156,7 @@ func loadCrons() { var crons []model.Cron dao.DB.Find(&crons) var err error + errMsg := new(bytes.Buffer) for i := 0; i < len(crons); i++ { cr := crons[i] @@ -165,9 +169,16 @@ func loadCrons() { if err == nil { dao.Crons[cr.ID] = &cr } else { - log.Println("NEZHA>> 计划任务调度失败", cr, err) + if errMsg.Len() == 0 { + errMsg.WriteString("调度失败的计划任务:[") + } + errMsg.WriteString(fmt.Sprintf("%d,", cr.ID)) } } + if errMsg.Len() > 0 { + msg := errMsg.String() + dao.SendNotification(msg[:len(msg)-1]+"] 这些任务将无法正常执行,请进入后点重新修改保存。", false) + } dao.Cron.Start() } diff --git a/resource/template/dashboard/setting.html b/resource/template/dashboard/setting.html index 4846f68..aaf1b7b 100644 --- a/resource/template/dashboard/setting.html +++ b/resource/template/dashboard/setting.html @@ -8,15 +8,6 @@ -