mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
修复管理后台页面新添加CoverIgnoreAll类型服务需要重启docker镜像的问题.
This commit is contained in:
parent
004f4c9ef2
commit
bcb2610f0a
@ -235,6 +235,7 @@ func (ma *memberAPI) addOrEditMonitor(c *gin.Context) {
|
||||
m.Cover = mf.Cover
|
||||
m.Notify = mf.Notify == "on"
|
||||
m.Duration = mf.Duration
|
||||
err = m.InitSkipServers()
|
||||
}
|
||||
if err == nil {
|
||||
if m.ID == 0 {
|
||||
|
@ -79,3 +79,15 @@ func (m *Monitor) AfterFind(tx *gorm.DB) error {
|
||||
func IsServiceSentinelNeeded(t uint64) bool {
|
||||
return t != TaskTypeCommand && t != TaskTypeTerminal && t != TaskTypeUpgrade
|
||||
}
|
||||
|
||||
func (m *Monitor) InitSkipServers() error {
|
||||
var skipServers []uint64
|
||||
if err := json.Unmarshal([]byte(m.SkipServersRaw), &skipServers); err != nil {
|
||||
return err
|
||||
}
|
||||
m.SkipServers = make(map[uint64]bool)
|
||||
for i := 0; i < len(skipServers); i++ {
|
||||
m.SkipServers[skipServers[i]] = true
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user