Skip to content

Commit

Permalink
fix highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed Oct 18, 2024
1 parent 6afec00 commit 55ee0e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
23 changes: 16 additions & 7 deletions front/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ <h5 class="modal-title" id="exampleModalLabel">Add filter</h5>
for(var k in data) {
name = data[k].Name;
host = data[k].Host;
$('#clusters').append(new Option(name, host,true,true));
$('#clusters').append(new Option(name, host,false,false));
}
$("#loading").addClass('invisible');
}
});
});
Expand All @@ -240,11 +239,11 @@ <h5 class="modal-title" id="exampleModalLabel">Add filter</h5>
contentType: 'application/json',
success: function (data) {
var str = "";
$('#igs').append(new Option("Select...", "",true,true));
for(var k in data) {
index = data[k].index;
$('#igs').append(new Option(index, index,false,false));
}
$("#loading").addClass('invisible');
}
});
}
Expand Down Expand Up @@ -272,7 +271,6 @@ <h5 class="modal-title" id="exampleModalLabel">Add filter</h5>
mapping.push(k);
}
$("#fields").html(str);
$("#loading").addClass('invisible');
}
});
});
Expand Down Expand Up @@ -445,12 +443,19 @@ <h5 class="modal-title" id="exampleModalLabel">Add filter</h5>
}
}
str+="</tr></thead><tbody>";
term = xql.replace(new RegExp(" ", "gi"), (match) => `|`);
if (xql !="") {
term = xql.replace(new RegExp(" ", "gi"), (match) => `|`);
}

for (var k in res) {
str += "<tr>";
if ( fields.length == 0 ) {
r = JSON.stringify(res[k]._source)
s = r.replace(new RegExp(term, "gi"), (match) => `<mark>${match}</mark>`);
if (xql !="") {
s = r.replace(new RegExp(term, "gi"), (match) => `<mark>${match}</mark>`);
} else {
s = r
}
str += "<td>"+ res[k]._source[tf[0]] +"</td>";
str += "<td style='word-wrap: break-word !important; word-break: break-word;'>"+ s +"</td>";
} else {
Expand All @@ -460,7 +465,11 @@ <h5 class="modal-title" id="exampleModalLabel">Add filter</h5>
continue;
} else {
r = res[k].fields[f].toString();
s = r.replace(new RegExp(term, "gi"), (match) => `<mark>${match}</mark>`);
if (xql !="") {
s = r.replace(new RegExp(term, "gi"), (match) => `<mark>${match}</mark>`);
} else {
s = r
}
str += "<td>" + s + "</td>";
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

package version

var Version = "extractor/v0.2.3"
var Version = "extractor/v0.2.4"

0 comments on commit 55ee0e3

Please sign in to comment.