update highlight
This commit is contained in:
parent
43e8299bf1
commit
783ed9684b
|
|
@ -8,7 +8,37 @@ export default class LogsController {
|
||||||
public async showLog({request, response}: HttpContextContract) {
|
public async showLog({request, response}: HttpContextContract) {
|
||||||
try {
|
try {
|
||||||
// fghf
|
// fghf
|
||||||
console.log(request.params().name);
|
const checkSpecialVersion = (paragraph) => {
|
||||||
|
try {
|
||||||
|
const regex = /\(CAT[1-9]K.*Version 16\.9\.[2-9]/;
|
||||||
|
const regex1 =
|
||||||
|
/\(CAT[1-9]K.*Version 1[7-9]\.[0-9]\.[0-9]/;
|
||||||
|
const regex2 =
|
||||||
|
/\(CAT[1-9]K.*Version [2-9][0-9]\.[0-9]\.[0-9]/;
|
||||||
|
// Use the regular expression to find the match
|
||||||
|
const match = paragraph.match(regex);
|
||||||
|
const match1 = paragraph.match(regex1);
|
||||||
|
const match2 = paragraph.match(regex2);
|
||||||
|
if (match || match1 || match2) {
|
||||||
|
if (match) {
|
||||||
|
return match[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match1) {
|
||||||
|
return match1[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match2) {
|
||||||
|
return match2[0];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let fileDetect = await LogDetectFile.findBy(
|
let fileDetect = await LogDetectFile.findBy(
|
||||||
"file_name",
|
"file_name",
|
||||||
request.params().name
|
request.params().name
|
||||||
|
|
@ -71,7 +101,7 @@ export default class LogsController {
|
||||||
if (
|
if (
|
||||||
listExcludeErr.filter((err) => data[u - 1].includes(err)).length === 0
|
listExcludeErr.filter((err) => data[u - 1].includes(err)).length === 0
|
||||||
) {
|
) {
|
||||||
if (MODEL_SPECIAL.filter((i) => data[u - 1].includes(i)).length > 0) {
|
if (MODEL_SPECIAL.filter((i) => data[u - 1].includes(i)).length > 0 || checkSpecialVersion(data[u-1])!=="") {
|
||||||
modelSpecialDetected.push(data[u - 1]);
|
modelSpecialDetected.push(data[u - 1]);
|
||||||
} else {
|
} else {
|
||||||
issueSpecialDetected.push(data[u - 1]);
|
issueSpecialDetected.push(data[u - 1]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue