通知内 IP 脱敏

This commit is contained in:
naiba
2021-05-27 20:48:12 +08:00
parent 06914eed99
commit 2b05dcfc23
9 changed files with 76 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ func UpdateIP() {
for {
ipv4 := fetchGeoIP(ipv4Servers, false)
ipv6 := fetchGeoIP(ipv6Servers, true)
cachedIP = fmt.Sprintf("ip(v4:%s,v6:%s)", ipv4.IP, ipv6.IP)
cachedIP = fmt.Sprintf("ip(v4:%s,v6:[%s])", ipv4.IP, ipv6.IP)
if ipv4.CountryCode != "" {
cachedCountry = ipv4.CountryCode
} else if ipv6.CountryCode != "" {

View File

@@ -292,10 +292,13 @@ func (ma *memberAPI) addOrEditCron(c *gin.Context) {
Type: model.TaskTypeCommand,
})
} else {
dao.SendNotification(fmt.Sprintf("计划任务:%s服务器%d 离线,无法执行。", cr.Name, cr.Servers[j]), false)
dao.SendNotification(fmt.Sprintf("计划任务:%s服务器%s 离线,无法执行。", cr.Name, dao.ServerList[cr.Servers[j]].Name), false)
}
}
})
if err != nil {
panic(err)
}
delete(dao.Crons, cr.ID)
dao.Crons[cr.ID] = &cr

View File

@@ -95,7 +95,7 @@ func loadCrons() {
Type: model.TaskTypeCommand,
})
} else {
dao.SendNotification(fmt.Sprintf("计划任务:%s服务器%d 离线,无法执行。", cr.Name, cr.Servers[j]), false)
dao.SendNotification(fmt.Sprintf("计划任务:%s服务器%s 离线,无法执行。", cr.Name, dao.ServerList[cr.Servers[j]].Name), false)
}
}
})