mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-05 21:20:06 +00:00
💥 v2.0 必须更新面板,新增服务监控
This commit is contained in:
@@ -34,14 +34,16 @@ func init() {
|
||||
}
|
||||
|
||||
func initDB() {
|
||||
dao.DB.AutoMigrate(model.Server{}, model.User{}, model.Notification{}, model.AlertRule{})
|
||||
dao.DB.AutoMigrate(model.Server{}, model.User{},
|
||||
model.Notification{}, model.AlertRule{}, model.Monitor{},
|
||||
model.MonitorHistory{})
|
||||
// load cache
|
||||
var servers []model.Server
|
||||
dao.DB.Find(&servers)
|
||||
for _, s := range servers {
|
||||
innerS := s
|
||||
innerS.Host = &model.Host{}
|
||||
innerS.State = &model.State{}
|
||||
innerS.State = &model.HostState{}
|
||||
dao.ServerList[innerS.ID] = &innerS
|
||||
}
|
||||
dao.ReSortServer()
|
||||
@@ -50,5 +52,6 @@ func initDB() {
|
||||
func main() {
|
||||
go controller.ServeWeb(dao.Conf.HTTPPort)
|
||||
go rpc.ServeRPC(5555)
|
||||
go rpc.DispatchTask(time.Minute * 10)
|
||||
alertmanager.Start()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user