Skip to content

Commit e776c3a

Browse files
committed
disable execution restart-button if it contains extra-vars (fix #87)
1 parent 57633fc commit e776c3a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ansibleguy-webui/aw/static/js/jobs/logs.js

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ function updateApiTableDataJobLogs(row, row2, entry) {
5555
} else {
5656
actionsTemplate = actionsTemplate.replaceAll('${disable}', '');
5757
}
58+
if (entry.user != null && entry.command != null && entry.command.includes(' -e ')) {
59+
actionsTemplate = actionsTemplate.replaceAll('${disable_restart}', 'disabled');
60+
} else {
61+
actionsTemplate = actionsTemplate.replaceAll('${disable_restart}', '');
62+
}
5863
row.cells[4].innerHTML = actionsTemplate;
5964

6065
let logsTemplates = document.getElementById("aw-api-data-tmpl-logs").innerHTML;

src/ansibleguy-webui/aw/templates/jobs/logs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</tr>
2828
</table>
2929
<div id="aw-api-data-tmpl-actions" hidden="hidden">
30-
<button class="btn btn-primary aw-btn-action aw-api-click" title="Restart Job" aw-api-endpoint="job" aw-api-item="${JOB_ID}" aw-api-method="post">
30+
<button class="btn btn-primary aw-btn-action aw-api-click" title="Restart Job" aw-api-endpoint="job" aw-api-item="${JOB_ID}" aw-api-method="post" ${DISABLE_RESTART}>
3131
{% include "../button/icon/run.html" %}
3232
</button>
3333
<button class="btn btn-danger aw-btn-action aw-api-click" title="Stop Execution" aw-api-endpoint="job"

0 commit comments

Comments
 (0)