diff --git a/deployment/static/deployment/js/event_source.js b/deployment/static/deployment/js/event_source.js index 7bfebab..fb4ac0e 100644 --- a/deployment/static/deployment/js/event_source.js +++ b/deployment/static/deployment/js/event_source.js @@ -30,6 +30,22 @@ var start = function (url) { status.innerHTML = message.status; var button = tr.querySelector("th[name='deploy']"); + if (message.status == "RUNNING") { + var innerBtn = document.createElement("button"); + innerBtn.setAttribute("disabled", ""); + innerBtn.setAttribute("type", "button"); + innerBtn.className = "btn btn-primary btn-sm" + + innerSpan = document.createElement("span"); + innerSpan.setAttribute("role", "status"); + innerSpan.innerHTML = "Deploying..."; + + innerBtn.appendChild(innerSpan); + + button.innerHTML = ""; + button.appendChild(innerBtn); + } + if (message.status == "SUCCESS") { button.innerHTML = ""; } diff --git a/deployment/static/deployment/js/event_source_details.js b/deployment/static/deployment/js/event_source_details.js index f22bbf5..ef985c1 100644 --- a/deployment/static/deployment/js/event_source_details.js +++ b/deployment/static/deployment/js/event_source_details.js @@ -23,8 +23,14 @@ var start = function (url) { console.log("status: " + message.status); console.log("progress: " + message.progress); + var status = document.getElementById("status"); + status.setAttribute("value", message.status) + var progress = document.getElementById("deployment-progress"); - progress.style["width"] = message.progress+"%"; + // no progress in `PENDING` state + if (progress !== undefined) { + progress.style["width"] = message.progress+"%"; + } if (message.status == "SUCCESS") { setTimeout(() => window.location.reload(), 1000); diff --git a/templates/deployment/board.html b/templates/deployment/board.html index de4651f..96f5295 100644 --- a/templates/deployment/board.html +++ b/templates/deployment/board.html @@ -51,6 +51,12 @@ Deploying... + {% elif deployment.status == "PENDING" %} + + + {% else %} {% endif %} diff --git a/templates/deployment/details.html b/templates/deployment/details.html index 5dba50c..8025f4e 100644 --- a/templates/deployment/details.html +++ b/templates/deployment/details.html @@ -37,7 +37,7 @@ - {% if deployment.status == "RUNNING" %} + {% if deployment.status == "RUNNING" or deployment.status == "PENDING" %}
@@ -88,7 +88,7 @@ {% endblock %} {% block script %} - {% if deployment.status == "RUNNING" %} + {% if deployment.status == "RUNNING" or deployment.status == "PENDING" %} {% endif %}