update format file log
This commit is contained in:
parent
1257e2344e
commit
90028e1108
|
|
@ -60,7 +60,8 @@ Route.get("/api/log/showLog/:name?", async ({ request, response }) => {
|
|||
"select * from log_reports where id_file = " + fileDetect?.id_ldf
|
||||
);
|
||||
|
||||
let detectedLines = [];
|
||||
let modelSpecialDetected = [];
|
||||
let issueSpecialDetected = [];
|
||||
let listLine = logsDetect[0]
|
||||
.map((obj) => obj.line)
|
||||
.filter((value, index, self) => {
|
||||
|
|
@ -78,6 +79,11 @@ Route.get("/api/log/showLog/:name?", async ({ request, response }) => {
|
|||
i.$original.key === "CATCH_FAULTY"
|
||||
);
|
||||
|
||||
let MODEL_SPECIAL = allValue.filter(
|
||||
(i) =>
|
||||
i.$original.key === "MODEL_SPECIAL"
|
||||
);
|
||||
|
||||
let listExcludeErr = allValue
|
||||
.filter((i) => i.$original.key === "EXCLUDE_ERR")
|
||||
.map((obj) => obj.$original.value);
|
||||
|
|
@ -105,10 +111,17 @@ Route.get("/api/log/showLog/:name?", async ({ request, response }) => {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
listLine.map((u) => {
|
||||
if (listExcludeErr.filter((err) => data[u - 1].includes(err)).length === 0) {
|
||||
// console.log(data[u - 1])
|
||||
detectedLines.push(data[u - 1]);
|
||||
if(MODEL_SPECIAL.filter((i)=>data[u - 1].includes(i)).length>0){
|
||||
modelSpecialDetected.push(data[u - 1])
|
||||
}else{
|
||||
issueSpecialDetected.push(data[u - 1])
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
// console.log(data)
|
||||
|
|
@ -139,9 +152,9 @@ Route.get("/api/log/showLog/:name?", async ({ request, response }) => {
|
|||
border-color: -internal-light-dark(rgb(118, 118, 118), rgb(133, 133, 133));\
|
||||
border-image: initial;\
|
||||
padding: 2px;'>" +
|
||||
"<b>Detected lines in file:</b>\n" +
|
||||
detectedLines.join("\n") +
|
||||
"\n\n" +
|
||||
"<b>"+request.params().name+"</b>\n\n<b>Detected lines in file:</b>\n<b>Extra items:</b>\n" +
|
||||
modelSpecialDetected.join("\n") +
|
||||
"\n\n<b>Extra items:</b>\n" + issueSpecialDetected.join("\n")+"\n\n"+
|
||||
data.join("\n") +
|
||||
"</div>\
|
||||
</body>\
|
||||
|
|
|
|||
Loading…
Reference in New Issue