【调整】修改版本号

【调整】错误记录表索引
【调整】新增monitor静态文件路由
pull/295/head
v-me-50 2025-07-17 16:09:00 +08:00
parent 85734cfcf8
commit 3e5a41a7e7
5 changed files with 10 additions and 2 deletions

View File

@ -87,6 +87,7 @@ func GetInfo(id string) (map[string]any, error) {
"target": dataMap["target"],
"monitor_type": dataMap["monitor_type"],
"valid": dataMap["valid"],
"last_time": dataMap["last_time"],
}
info, ok := dataMap["info"].(string)

View File

@ -188,7 +188,7 @@ func Restart() {
}
func GetVersion() (map[string]string, error) {
version := "v1.0.6"
version := "v1.0.7"
update := "0"
newVersionObj, err := http.Get("https://download.allinssl.com/version.json")
if err != nil {

View File

@ -366,6 +366,8 @@ create table monitor
info TEXT not null,
msg TEXT not null
);
create index if not exists err_record_monitor_id_index
on err_record (monitor_id);
`)
}

View File

@ -108,6 +108,7 @@ func Register(r *gin.Engine) {
staticFS, _ := fs.Sub(static.BuildFS, "build/static")
r.StaticFS("/static", http.FS(staticFS))
r.StaticFS("/auto-deploy/static", http.FS(staticFS))
r.StaticFS("/monitor/static", http.FS(staticFS))
// favicon.ico
r.GET("/favicon.ico", func(c *gin.Context) {

View File

@ -118,11 +118,15 @@ func Monitor() {
// 此处应该发送错误邮件
if checkErr != "" {
// 更新监控记录
valid := -1 // 状态为异常
if certInfo != nil && certInfo.Valid {
valid = 1 // 状态为正常
}
gs.Where("id=?", []interface{}{id}).Update(map[string]any{
"last_time": now.Format("2006-01-02 15:04:05"),
"except_end_time": now.Format("2006-01-02 15:04:05"),
"info": certJson,
"valid": -1, // 状态为异常
"valid": valid, // 状态为异常
})
// 新增错误记录
if certInfo == nil || !certInfo.Valid {