This commit is contained in:
2023-08-31 16:27:32 +08:00
parent a15d5568ef
commit b0ad4f0a19

View File

@@ -399,8 +399,10 @@ func ParseRawMsg2Html(w http.ResponseWriter, r *http.Request) {
return
}
log.Trace("traceData:", traceData)
pathFile := traceData.DecMsg
if traceData.DecMsg == "" {
htmlFile := fmt.Sprintf("traceDecMessage-%d-%d.html", traceData.TaskID, traceData.ID)
pathFile := config.GetYamlConfig().OMC.FrontTraceDir + "/" + htmlFile
pathFile = config.GetYamlConfig().OMC.FrontTraceDir + "/" + htmlFile
command := fmt.Sprintf("ipdata2html -f %s -t %d -i N%d -d %x", pathFile, traceData.Timestamp, traceData.IfType, traceData.RawMsg)
out, err := run.ExecCmd(command, "/")
log.Tracef("Exec output: %v", string(out))
@@ -416,6 +418,6 @@ func ParseRawMsg2Html(w http.ResponseWriter, r *http.Request) {
services.ResponseInternalServerError500ProcessError(w, err)
return
}
}
services.ResponseHtmlContent(w, http.StatusOK, pathFile)
}