diff options
Diffstat (limited to 'src/templates')
-rw-r--r-- | src/templates/akraino/booking/booking_table.html | 41 | ||||
-rw-r--r-- | src/templates/akraino/booking/quick_deploy.html | 8 | ||||
-rw-r--r-- | src/templates/base/account/configuration_list.html | 5 | ||||
-rw-r--r-- | src/templates/base/account/resource_list.html | 20 | ||||
-rw-r--r-- | src/templates/base/base.html | 5 | ||||
-rw-r--r-- | src/templates/base/booking/quick_deploy.html | 2 | ||||
-rw-r--r-- | src/templates/base/dashboard/lab_detail.html | 4 | ||||
-rw-r--r-- | src/templates/base/resource/steps/pod_definition.html | 25 |
8 files changed, 76 insertions, 34 deletions
diff --git a/src/templates/akraino/booking/booking_table.html b/src/templates/akraino/booking/booking_table.html new file mode 100644 index 0000000..4afb4d2 --- /dev/null +++ b/src/templates/akraino/booking/booking_table.html @@ -0,0 +1,41 @@ +{% load jira_filters %} + + +<thead> +<tr> + <th>Owner</th> + <th>Purpose</th> + <th>Project</th> + <th>Start</th> + <th>End</th> + <th>Operating System</th> + <th>Pod</th> +</tr> +</thead> +<tbody> +{% for booking in bookings %} + <tr> + <td> + {{ booking.owner.username }} + </td> + <td> + {{ booking.purpose }} + </td> + <td> + {{ booking.project }} + </td> + <td> + {{ booking.start }} + </td> + <td> + {{ booking.end }} + </td> + <td> + {{ booking.resource.get_head_node.config.image.os.name }} + </td> + <td> + {{ booking.resource.get_template_name }} + </td> + </tr> +{% endfor %} +</tbody> diff --git a/src/templates/akraino/booking/quick_deploy.html b/src/templates/akraino/booking/quick_deploy.html index 56a4791..80354d9 100644 --- a/src/templates/akraino/booking/quick_deploy.html +++ b/src/templates/akraino/booking/quick_deploy.html @@ -1,6 +1,14 @@ {% extends "base/booking/quick_deploy.html" %} {% block opnfv %} {% endblock opnfv %} +{% block form-text %} +<p class="my-0"> + Please select a host type you wish to book. + Only available types are shown. + More information can be found here: + <a href="https://wiki.akraino.org/display/AK/Shared+Community+Lab">Akraino Wiki</a> +</p> +{% endblock form-text %} {% block collab %} <div class="col-12 col-lg-4 my-2"> <div class="col border rounded py-2 h-100"> diff --git a/src/templates/base/account/configuration_list.html b/src/templates/base/account/configuration_list.html index 206c203..fee6e83 100644 --- a/src/templates/base/account/configuration_list.html +++ b/src/templates/base/account/configuration_list.html @@ -41,6 +41,11 @@ 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"); } diff --git a/src/templates/base/account/resource_list.html b/src/templates/base/account/resource_list.html index 65b46f1..33ccaff 100644 --- a/src/templates/base/account/resource_list.html +++ b/src/templates/base/account/resource_list.html @@ -29,23 +29,20 @@ {% endfor %} </div> <script> - var grb_mapping = {{grb_mapping|safe|default:"{}"}}; - var booking_mapping = {{booking_mapping|safe|default:"{}"}}; + var active_resources = {{active_resources|safe|default:"{}"}} var current_resource_id = -1; function delete_resource(resource_id) { document.getElementById("confirm_delete_button").removeAttribute("disabled"); - var configs = grb_mapping[resource_id]; var warning = document.createTextNode("Are You Sure?"); var warning_subtext = document.createTextNode("This cannot be undone"); - if(booking_mapping[resource_id]){ - var warning = document.createTextNode("This resource is being used. It cannot be deleted."); + if(active_resources[resource_id]){ + var warning = document.createTextNode("This resource is being used or is scheduled to be used. It cannot be deleted."); var warning_subtext = document.createTextNode("If your booking just ended, you may need to give us a few minutes to clean it up before this can be removed."); document.getElementById("confirm_delete_button").disabled = true; } - else if(configs.length > 0) { - list_configs(configs); - warning_text = "Are You Sure? The following Configurations will also be deleted."; + else { + warning_text = "Are You Sure?"; warning = document.createTextNode(warning_text); } @@ -56,7 +53,7 @@ function set_modal_text(title, text) { var clear = function(node) { while(node.lastChild) { - node.removeChild(node.lastChild); + node.removeChild(node.lastChild); } } var warning_title = document.getElementById("config_warning"); @@ -84,6 +81,11 @@ var formData = ajaxForm.serialize(); req = new XMLHttpRequest(); var url = "delete/" + current_resource_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"); } diff --git a/src/templates/base/base.html b/src/templates/base/base.html index 663741a..cc6d38d 100644 --- a/src/templates/base/base.html +++ b/src/templates/base/base.html @@ -93,12 +93,9 @@ Design a Pod </a> <a href="#" onclick="create_workflow(2)" class="list-group-item list-group-item-action list-group-item-secondary"> - Configure a Pod - </a> - <a href="#" onclick="create_workflow(3)" class="list-group-item list-group-item-action list-group-item-secondary"> Create a Snapshot </a> - <a href="#" onclick="create_workflow(4)" class="list-group-item list-group-item-action list-group-item-secondary"> + <a href="#" onclick="create_workflow(3)" class="list-group-item list-group-item-action list-group-item-secondary"> Configure OPNFV </a> </div> diff --git a/src/templates/base/booking/quick_deploy.html b/src/templates/base/booking/quick_deploy.html index ad9adf2..70b9869 100644 --- a/src/templates/base/booking/quick_deploy.html +++ b/src/templates/base/booking/quick_deploy.html @@ -8,7 +8,9 @@ {% csrf_token %} <div class="row mx-0 px-0"> <div class="col-12 mx-0 px-0 mt-2"> + {% block form-text %} <p class="my-0">Please select a host type you wish to book. Only available types are shown.</p> + {% endblock form-text %} {% bootstrap_field form.filter_field show_label=False %} </div> </div> diff --git a/src/templates/base/dashboard/lab_detail.html b/src/templates/base/dashboard/lab_detail.html index a12c5da..3d90a51 100644 --- a/src/templates/base/dashboard/lab_detail.html +++ b/src/templates/base/dashboard/lab_detail.html @@ -140,9 +140,9 @@ <th>Working</th> <th>Vendor</th> </tr> - {% for host in lab.host_set.all %} + {% for host in hosts %} <tr> - <td>{{host.labid}}</td> + <td>{{host.name}}</td> <td>{{host.profile}}</td> <td>{{host.booked|yesno:"Yes,No"}}</td> {% if host.working %} diff --git a/src/templates/base/resource/steps/pod_definition.html b/src/templates/base/resource/steps/pod_definition.html index 4b8b296..83c4fcb 100644 --- a/src/templates/base/resource/steps/pod_definition.html +++ b/src/templates/base/resource/steps/pod_definition.html @@ -44,29 +44,16 @@ debug = true; {% endif %} - let xml = ''; - {% if xml %} - xml = '{{xml|safe}}'; - {% endif %} - - let hosts = []; - {% for host in hosts %} - hosts.push({{host|safe}}); - {% endfor %} - - let added_hosts = []; - {% for host in added_hosts %} - added_hosts.push({{host|safe}}); - {% endfor %} + const False = false; + const True = true; - let removed_host_ids = {{removed_hosts|safe}}; + let resources = {{resources|safe}}; + let networks = {{networks|safe}}; network_step = new NetworkStep( debug, - xml, - hosts, - added_hosts, - removed_host_ids, + resources, + networks, document.getElementById('graphContainer'), document.getElementById('outlineContainer'), document.getElementById('toolbarContainer'), |