Skip to content

Commit

Permalink
fix log-view performance issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Sep 22, 2024
1 parent a518583 commit 6a74153
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ansibleguy-webui/aw/static/js/jobs/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ function addLogLines($this) {
if (!hidden && !stopped) {
$.get("/api/job/" + job_id + "/" + exec_id + "/log/" + logLineStart, function(data) {
if (data.lines.length > 0) {
for (let line of data.lines) {
document.getElementById(logElement).innerHTML += line;
logElementEnd.scrollIntoView({ behavior: "smooth", block: "end", inline: "end" });
}
document.getElementById(logElement).innerHTML += data.lines.join('');
logElementEnd.scrollIntoView({ behavior: "smooth", block: "end", inline: "end" });
$this.attr("aw-log-line", parseInt(logLineStart) + data.lines.length);
}
});
Expand Down Expand Up @@ -52,7 +50,6 @@ function updateApiTableDataJobLogs(row, row2, entry) {
let actionsTemplate = document.getElementById(ELEM_ID_TMPL_ACTIONS).innerHTML;
actionsTemplate = actionsTemplate.replaceAll('${ID}', entry.id);
actionsTemplate = actionsTemplate.replaceAll('${JOB_ID}', entry.job);
console.log("TEST", entry.status_name.toLowerCase());
if (entry.status_name.toLowerCase() == 'waiting') {
actionsTemplate = actionsTemplate.replaceAll('${DISABLE}', 'disabled');
} else {
Expand Down

0 comments on commit 6a74153

Please sign in to comment.