🐛 fix service stats

This commit is contained in:
naiba
2022-10-12 23:06:25 +08:00
parent 998784d177
commit 1bb99494e3
9 changed files with 115 additions and 112 deletions

View File

@@ -358,7 +358,7 @@ func handleHttpGetTask(task *pb.Task, result *pb.TaskResult) {
// 检查 SSL 证书信息
if resp.TLS != nil && len(resp.TLS.PeerCertificates) > 0 {
c := resp.TLS.PeerCertificates[0]
result.Data = c.Issuer.CommonName + "|" + c.NotAfter.In(time.Local).String()
result.Data = c.Issuer.CommonName + "|" + c.NotAfter.String()
}
result.Successful = true
} else {

View File

@@ -183,7 +183,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)
today := time.Date(year, month, day, 0, 0, 0, 0, singleton.Loc)
return today.AddDate(0, 0, i-29).Format("01/02")
},
"className": func(percent float32) string {

View File

@@ -13,8 +13,8 @@ import (
func init() {
// 初始化 dao 包
singleton.Init()
singleton.InitConfigFromPath("data/config.yaml")
singleton.InitTimezoneAndCache()
singleton.InitDBFromPath("data/sqlite.db")
singleton.InitLocalizer()
initSystem()