alert on core error

This commit is contained in:
Alireza Ahmadi
2024-06-08 20:55:42 +02:00
parent 17f1126c23
commit cf620962bb
2 changed files with 14 additions and 11 deletions
+9
View File
@@ -176,6 +176,15 @@ func (a *APIHandler) loadData(c *gin.Context) (interface{}, error) {
return "", err
}
onlines, err := a.StatsService.GetOnlines()
sysInfo := a.ServerService.GetSingboxInfo()
if sysInfo["running"] == false {
logs := a.ServerService.GetLogs("sing-box", "1", "debug")
if len(logs) > 0 {
data["lastLog"] = logs[0]
}
}
if err != nil {
return "", err
}