diff options
author | Justin Choquette <jchoquette@iol.unh.edu> | 2023-08-08 11:33:57 -0400 |
---|---|---|
committer | Justin Choquette <jchoquette@iol.unh.edu> | 2023-08-18 11:59:01 -0400 |
commit | ecadb07367d31c0929212618e120130f54af78da (patch) | |
tree | f626ef347f6fa7cb7f9ee962539a5f769bc3d471 /src/templates/base/booking/booking_detail.html | |
parent | a6168306c08e8d5b207b9acc48869180d194ff01 (diff) |
MVP
Change-Id: Ib590302f49e7e66f8d04841fb6cb97baf623f51a
Signed-off-by: Justin Choquette <jchoquette@iol.unh.edu>
Diffstat (limited to 'src/templates/base/booking/booking_detail.html')
-rw-r--r-- | src/templates/base/booking/booking_detail.html | 64 |
1 files changed, 52 insertions, 12 deletions
diff --git a/src/templates/base/booking/booking_detail.html b/src/templates/base/booking/booking_detail.html index e4687ad..33b0486 100644 --- a/src/templates/base/booking/booking_detail.html +++ b/src/templates/base/booking/booking_detail.html @@ -61,8 +61,7 @@ code { <div class="card mb-3"> <div class="card-header d-flex"> <h4 class="d-inline">Deployment Progress</h4> - <p>These are the different tasks that have to be completed before your deployment is ready. - If this is taking a really long time, let us know <a href="mailto:{{contact_email}}">here!</a></p> + <p class="mx-3">Your resources are being prepared. If this is taking a really long time, please contact us <a href="mailto:{{contact_email}}">here!</a></p> <!-- <button data-toggle="collapse" data-target="#panel_tasks" class="btn btn-outline-secondary ml-auto">Expand</button> --> </div> <div class="collapse show" id="panel_tasks"> @@ -75,23 +74,18 @@ code { {% for host in statuses %} <tr> <td> - <!-- Success, - Reimage, - InProgress, - Failure, - Import, --> - {% if host.status is 'Success' %} + {% if 'Success' in host.status %} <div class="rounded-circle bg-success square-20"></div> - {% elif host.status is 'InProgress' %} - <div class="spinner-border text-primary square-20"></div> + {% elif 'Fail' in host.status %} + <div class="rounded-circle bg-danger square-20"></div> {% else %} - <div class="rounded-circle bg-secondary square-20"></div> + <div class="spinner-border text-primary square-20"></div> {% endif %} </td> <td> {{ host.hostname }} </td> - <td> + <td id="{{host.instance_id}}"> {{ host.status }} </td> </tr> @@ -102,4 +96,50 @@ code { </div> </div> +<div class="row"> + <div class="col-5"> + <div class="card mb-3"> + <div class="card-header d-flex"> + Diagnostic Information + </div> + <div> + <table class="table m-0"> + <tr> + <th></th> + <th>Aggregate ID</th> + <td>{{booking.aggregateId}}</td> + </tr> + </table> + </div> + </div> + </div> +</div> + +<script> +setInterval(function(){ + fetchBookingStatus(); +}, 5000); + + +async function fetchBookingStatus() { + req = new XMLHttpRequest(); + var url = "status"; + req.open("GET", url, true); + req.onerror = function() { alert("oops"); } + req.onreadystatechange = function() { + if(req.readyState === 4) { + statuses = JSON.parse(req.responseText) + updateStatuses(statuses) + } + } + req.send(); +} + +async function updateStatuses(statuses) { + for (const s of statuses) { + document.getElementById(s.instance_id).innerText = s.status + } +} +</script> + {% endblock content %} |