diff options
Diffstat (limited to 'src/templates/base')
-rw-r--r-- | src/templates/base/account/configuration_list.html | 85 | ||||
-rw-r--r-- | src/templates/base/account/details.html | 1 | ||||
-rw-r--r-- | src/templates/base/base.html | 5 | ||||
-rw-r--r-- | src/templates/base/booking/booking_delete.html | 1 | ||||
-rw-r--r-- | src/templates/base/booking/booking_detail.html | 65 | ||||
-rw-r--r-- | src/templates/base/booking/booking_table.html | 2 | ||||
-rw-r--r-- | src/templates/base/booking/quick_deploy.html | 33 |
7 files changed, 94 insertions, 98 deletions
diff --git a/src/templates/base/account/configuration_list.html b/src/templates/base/account/configuration_list.html deleted file mode 100644 index fee6e83..0000000 --- a/src/templates/base/account/configuration_list.html +++ /dev/null @@ -1,85 +0,0 @@ -{% extends "base.html" %} -{% block content %} -<div class="row"> -{% for config in configurations %} - <div class="col-12 col-md-6 col-lg-4 col-xl-3 mb-3"> - <div class="card h-100"> - <div class="card-header"> - <h3>Configuration {{config.id}}</h3> - </div> - <ul class="list-group list-group-flush h-100"> - <li class="list-group-item">id: {{config.id}}</li> - <li class="list-group-item">name: {{config.name}}</li> - <li class="list-group-item">description: {{config.description}}</li> - <li class="list-group-item">resource: {{config.bundle}}</li> - </ul> - <div class="card-footer"> - <button - class="btn btn-danger w-100" - onclick='delete_config({{config.id}});' - data-toggle="modal" - data-target="#configModal" - >Delete</button> - </div> - </div> - </div> -{% empty %} - <div class="col"> - <p>You don't have any configurations. You can create a configuration by configuring a pod.</p> - </div> -{% endfor %} -</div> - -<script> - var current_config_id = -1; - function delete_config(config_id) { - current_config_id = config_id; - } - - function submit_delete_form() { - var ajaxForm = $("#config_delete_form"); - var formData = ajaxForm.serialize(); - req = new XMLHttpRequest(); - var url = "delete/" + current_config_id; - req.onreadystatechange = function() { - if (this.readyState == 4 && this.status == 200) { - location.reload(); - } - }; - req.open("POST", url, true); - req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - req.onerror = function() { alert("problem submitting form"); } - req.send(formData); - } -</script> - -<div class="modal fade" id="configModal" tabindex="-1" role="dialog" aria-hidden="true"> - <div class="modal-dialog" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <h4 class="modal-title d-inline float-left">Delete Configuration?</h4> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"> - <span aria-hidden="true">×</span> - </button> - </div> - <form id="config_delete_form"> - {% csrf_token %} - </form> - <div class="modal-footer d-flex flex-column"> - <div class="mb-2"> - <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button> - <button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#warning">Delete</button> - </div> - <div class="collapse w-100 text-center border-top" id="warning"> - <div class="p-4"> - <h3>Are You Sure?</h3> - <p>This cannot be undone</p> - <button class="btn btn-outline-secondary" data-dismiss="modal">Nevermind</button> - <button class="btn btn-danger" data-dismiss="modal" onclick="submit_delete_form();">I'm Sure</button> - </div> - </div> - </div> - </div> - </div> -</div> -{% endblock %} diff --git a/src/templates/base/account/details.html b/src/templates/base/account/details.html index 3092ad0..ad59c9a 100644 --- a/src/templates/base/account/details.html +++ b/src/templates/base/account/details.html @@ -4,6 +4,5 @@ <h1>Account Details</h1> <a class="btn btn-primary" href="{% url 'account:my-resources' %}">My Resources</a> <a class="btn btn-primary" href="{% url 'account:my-bookings' %}">My Bookings</a> -<a class="btn btn-primary" href="{% url 'account:my-configurations' %}">My Configurations</a> <a class="btn btn-primary" href="{% url 'account:my-images' %}">My Snapshots</a> {% endblock content %} diff --git a/src/templates/base/base.html b/src/templates/base/base.html index a628ab4..351bd9a 100644 --- a/src/templates/base/base.html +++ b/src/templates/base/base.html @@ -87,7 +87,7 @@ {% else %} <a href="{% url 'account:login' %}" class="dropdown-item Anuket-Text"> <i class="fas fa-sign-in-alt"></i> - Login with Jira + Login </a> {% endif %} {% endif %} @@ -156,9 +156,6 @@ <a href="{% url 'account:my-bookings' %}" class="list-group-item list-group-item-action list-group-item-secondary dropDown-bg"> My Bookings </a> - <a href="{% url 'account:my-configurations' %}" class="list-group-item list-group-item-action list-group-item-secondary dropDown-bg"> - My Configurations - </a> <a href="{% url 'account:my-images' %}" class="list-group-item list-group-item-action list-group-item-secondary dropDown-bg"> My Snapshots </a> diff --git a/src/templates/base/booking/booking_delete.html b/src/templates/base/booking/booking_delete.html index b89eb15..4afa370 100644 --- a/src/templates/base/booking/booking_delete.html +++ b/src/templates/base/booking/booking_delete.html @@ -1,4 +1,3 @@ -{% load jira_filters %} {% load bootstrap4 %} <p> diff --git a/src/templates/base/booking/booking_detail.html b/src/templates/base/booking/booking_detail.html index a014fea..4a8f35a 100644 --- a/src/templates/base/booking/booking_detail.html +++ b/src/templates/base/booking/booking_detail.html @@ -7,6 +7,12 @@ <script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang=yaml"></script> {% endblock %} +<style> +code { + overflow: scroll; +} +</style> + {% block content %} <div class="row"> <div class="col-12 col-lg-5"> @@ -154,6 +160,65 @@ </div> </div> </div> + <div class="card my-3"> + <div class="card-header d-flex"> + <h4 class="d-inline">Diagnostic Information</h4> + <button data-toggle="collapse" data-target="#diagnostics_panel" class="btn btn-outline-secondary ml-auto">Expand</button> + </div> + <div class="collapse" id="diagnostics_panel"> + <div class="card-body"> + <table class="table m-0"> + <tr> + <th>Job ID: </th> + <td>{{booking.job.id}}</td> + </tr> + <tr> + <th>CI Files</th> + </tr> + {% for host in booking.resource.get_resources %} + <tr> + <td> + <table class="table m-0"> + <tr> + <th>Host:</th> + <td>{{host.name}}</td> + </tr> + <tr> + <th>Configs:</th> + </tr> + {% for ci_file in host.config.cloud_init_files.all %} + <tr> + <td>{{ci_file.id}}</td> + <td> + <div class="modal fade" id="ci_file_modal_{{ci_file.id}}" tabindex="-1" role="dialog" aria-hidden="true"> + <div class="modal-dialog modal-xl" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h4 class="modal-title d-inline float-left">Cloud Config Content</h4> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + <div class="card-body"> + <pre class="prettyprint lang-yaml m-0 border-0 text-break pre-wrap"> +{{ci_file.text}} + </pre> + </div> + </div> + </div> + </div> + <button class="btn btn-primary" data-toggle="modal" data-target="#ci_file_modal_{{ci_file.id}}">Show File Content</button> + </td> + </tr> + {% endfor %} + </table> + </td> + </tr> + {% endfor %} + </table> + </div> + </div> + </div> </div> <div class="col"> <div class="card mb-3"> diff --git a/src/templates/base/booking/booking_table.html b/src/templates/base/booking/booking_table.html index 1b95433..b4a713a 100644 --- a/src/templates/base/booking/booking_table.html +++ b/src/templates/base/booking/booking_table.html @@ -1,4 +1,4 @@ -{% load jira_filters %} + <thead> diff --git a/src/templates/base/booking/quick_deploy.html b/src/templates/base/booking/quick_deploy.html index 5dc41e2..c51e234 100644 --- a/src/templates/base/booking/quick_deploy.html +++ b/src/templates/base/booking/quick_deploy.html @@ -3,6 +3,13 @@ {% load bootstrap4 %} {% block content %} +<style> +/* hides images not in use. Not applied globally since doesn't make sense in all cases */ +select option:disabled { + display:none; +} +</style> + {% bootstrap_form_errors form type='non_fields' %} <form id="quick_booking_form" action="/booking/quick/" method="POST" class="form class="Anuket-Text""> {% csrf_token %} @@ -18,7 +25,7 @@ </div> </div> <div class="row justify-content-center"> - <div class="col-12 col-lg-4 my-2"> + <div class="col-12 col-lg-6 my-2"> <div class="col border rounded py-2 h-100"> {% bootstrap_field form.purpose %} {% bootstrap_field form.project %} @@ -31,19 +38,26 @@ </div> </div> {% block collab %} - <div class="col-12 col-lg-4 my-2"> + <div class="col-12 col-lg-6 my-2"> <div class="col border rounded py-2 h-100"> <label>Collaborators</label> {{ form.users }} </div> </div> {% endblock collab %} - <div class="col-12 col-lg-4 my-2"> + </div> + <div class="row justify-content-center"> + <div class="col-12 col-lg-6 my-2"> <div class="col border rounded py-2 h-100"> {% bootstrap_field form.hostname %} {% bootstrap_field form.image %} </div> </div> + <div class="col-12 col-lg-6 my-2"> + <div class="col border rounded py-2 h-100"> + {% bootstrap_field form.global_cloud_config %} + </div> + </div> <div class="col-12 d-flex mt-2 justify-content-end"> <button id="quick_booking_confirm" onclick="submit_form();" type="button" class="btn btn-success">Confirm</button> </div> @@ -88,15 +102,22 @@ function imageFilter() { var drop = document.getElementById("id_image"); var lab_pk = get_selected_value("lab"); - var host_pk = get_selected_value("resource"); + var profile_pk = get_selected_value("resource"); for (const childNode of drop.childNodes) { var image_object = sup_image_dict[childNode.value]; if (image_object) //weed out empty option { + console.log("image object:"); + console.log(image_object); const img_at_lab = image_object.lab == lab_pk; - const profiles = resource_profile_map[host_pk]; - const img_in_template = profiles && profiles.indexOf(image_object.host_profile) > -1 + const profiles = resource_profile_map[profile_pk]; + console.log("profiles are:"); + console.log(profiles); + console.log("profile map is:"); + console.log(resource_profile_map); + console.log("host profile is" + image_object.architecture); + const img_in_template = profiles && profiles.indexOf(image_object.architecture) > -1 childNode.disabled = !img_at_lab || !img_in_template; } } |