This commit is contained in:
David Brazda
2024-02-24 20:32:01 +07:00
parent 73fef65309
commit ca3565132d
5 changed files with 68 additions and 20 deletions

View File

@ -468,7 +468,8 @@ function refresh_logfile() {
$('#log-content').html("no records");
}
else {
$('#log-content').html(response.lines.join('\n'));
var escapedLines = response.lines.map(line => escapeHtml(line));
$('#log-content').html(escapedLines.join('\n'));
}
},
error: function(xhr, status, error) {
@ -478,6 +479,14 @@ function refresh_logfile() {
})
}
function escapeHtml(text) {
return text
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
function delete_arch_rows(ids) {
$.ajax({
url:"/archived_runners/",