mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-08 07:41:10 +08:00
修改监控为证书监控支持文件导入和smtp监控
监控支持多渠道通知 将静态文件打包到二进制文件
This commit is contained in:
@@ -65,15 +65,15 @@ func GetCertCount() (map[string]int, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func GetSiteMonitorCount() (map[string]any, error) {
|
||||
s, err := public.NewSqlite("data/site_monitor.db", "")
|
||||
func GetMonitorCount() (map[string]any, error) {
|
||||
s, err := public.NewSqlite("data/monitor.db", "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer s.Close()
|
||||
cert, err := s.Query(`select count(*) as count,
|
||||
count(case when state='异常' then 1 end ) as exception
|
||||
from site_monitor`)
|
||||
count(case when valid=-1 then 1 end ) as exception
|
||||
from monitor`)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -144,18 +144,18 @@ func GetOverviewData() (map[string]any, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
siteMonitorCount, err := GetSiteMonitorCount()
|
||||
workflowHistory, err := GetWorkflowHistory()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
workflowHistory, err := GetWorkflowHistory()
|
||||
monitorCount, err := GetMonitorCount()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := make(map[string]any)
|
||||
result["workflow"] = workflowCount
|
||||
result["cert"] = certCount
|
||||
result["site_monitor"] = siteMonitorCount
|
||||
result["monitor"] = monitorCount
|
||||
result["workflow_history"] = workflowHistory
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user