Skip to content

Commit

Permalink
updated log-UI for small screens
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Feb 28, 2024
1 parent 4b681af commit cd4d6b4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/ansibleguy-webui/aw/static/css/aw.css
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ td div hr {

.aw-execution-logs {
white-space: pre-wrap;
word-break: break-word;
padding: 1% 1.5%;
color: var(--awSoftWhite);
background-color: var(--awLogs);
Expand Down
6 changes: 5 additions & 1 deletion src/ansibleguy-webui/aw/static/css/aw_mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
.aw-responsive-med {
display: none;
}

.aw-execution-logs {
font-size: small;
}

}

@media only screen and (max-width: 500px) { /* mobile devices */
Expand Down Expand Up @@ -107,7 +112,6 @@
.aw-responsive-med {
display: none;
}

}

@include media-breakpoint-between(xs,sm){
Expand Down
11 changes: 6 additions & 5 deletions src/ansibleguy-webui/aw/static/js/jobs/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,23 @@ function addLogLines($this) {
}

function updateApiTableDataJobLogs(row, row2, entry) {
row.innerHTML = document.getElementById('aw-api-data-tmpl-row').innerHTML;
row.setAttribute("id_job", entry.job);
row.setAttribute("id_execution", entry.id);
row2.setAttribute("id_execution", entry.id);

row.insertCell(0).innerHTML = shortExecutionStatus(entry);
row.insertCell(1).innerText = entry.job_name;
row.cells[0].innerHTML = shortExecutionStatus(entry);
row.cells[1].innerText = entry.job_name;
if (entry.job_comment == "") {
row.insertCell(2).innerText = "-";
row.cells[2].innerText = "-";
} else {
row.insertCell(2).innerText = entry.job_comment;
row.cells[2].innerText = entry.job_comment;
}

let actionsTemplate = document.getElementById("aw-api-data-tmpl-actions").innerHTML;
actionsTemplate = actionsTemplate.replaceAll('${ID}', entry.id);
actionsTemplate = actionsTemplate.replaceAll('${JOB_ID}', entry.job);
row.insertCell(3).innerHTML = actionsTemplate;
row.cells[3].innerHTML = actionsTemplate;

let logsTemplates = document.getElementById("aw-api-data-tmpl-logs").innerHTML;
logsTemplates = logsTemplates.replaceAll('${ID}', entry.id);
Expand Down
10 changes: 8 additions & 2 deletions src/ansibleguy-webui/aw/templates/jobs/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
<tr>
<th>Run</th>
<th>Job</th>
<th>Comment</th>
<th>Show Logs</th>
<th class="aw-responsive-med">Comment</th>
<th>Actions</th>
</tr>
<tr id="aw-api-data-tmpl-row" hidden="hidden">
<td></td>
<td></td>
<td class="aw-responsive-med"></td>
<td></td>
</tr>
</table>
<div id="aw-api-data-tmpl-actions" hidden="hidden">
Expand Down

0 comments on commit cd4d6b4

Please sign in to comment.