💬 update notification text [skip ci]

This commit is contained in:
naiba
2022-04-30 19:23:19 +08:00
parent cc5d8da952
commit 36432e31b2
6 changed files with 104 additions and 48 deletions

View File

@@ -87,7 +87,7 @@ var funcMap = template.FuncMap{
}
},
"tf": func(t time.Time) string {
return t.In(singleton.Loc).Format("2006年1月2号 15:04:05")
return t.In(singleton.Loc).Format("02/01/2006 15:04:05")
},
"len": func(slice []interface{}) string {
return strconv.Itoa(len(slice))
@@ -99,7 +99,7 @@ var funcMap = template.FuncMap{
return template.HTML(`<` + s + `>`) // #nosec
},
"stf": func(s uint64) string {
return time.Unix(int64(s), 0).In(singleton.Loc).Format("2006年1月2号 15:04")
return time.Unix(int64(s), 0).In(singleton.Loc).Format("02/01/2006 15:04")
},
"sf": func(duration uint64) string {
return time.Duration(time.Duration(duration) * time.Second).String()
@@ -151,7 +151,7 @@ var funcMap = template.FuncMap{
"dayBefore": func(i int) string {
year, month, day := time.Now().Date()
today := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
return today.AddDate(0, 0, i-29).Format("1月2号")
return today.AddDate(0, 0, i-29).Format("02/01")
},
"className": func(percent float32) string {
if percent == 0 {
@@ -165,16 +165,7 @@ var funcMap = template.FuncMap{
}
return "danger"
},
"statusName": func(percent float32) string {
if percent == 0 {
return "无数据"
}
if percent > 95 {
return "良好"
}
if percent > 80 {
return "低可用"
}
return "故障"
"statusName": func(val float32) string {
return singleton.StatusCodeToString(singleton.GetStatusCode(val))
},
}