Merge "Prefetches Collaborators"
[laas.git] / src / templates / resource / steps / define_hardware.html
1 {% extends "workflow/viewport-element.html" %}
2 {% load staticfiles %}
3
4 {% load bootstrap4 %}
5
6 {% block content %}
7 <p>Note that not all labs host every kind of machine.
8 As you make your selections, labs and hosts that are not compatible
9 with your current configuration will become unavailable.</p>
10 <h4>NOTE: Only PTL's are able to create multi-node PODs. See <a href="https://google.com">here</a>
11     for more details</h4>
12 <form id="define_hardware_form" action="/wf/workflow/" method="post">
13     {% csrf_token %}
14     {{form.filter_field|default:"<p>No Form</p>"}}
15 </form>
16 {% endblock content %}
17 {% block onleave %}
18 var normalize = function(data){
19     //converts the top level keys in data to map to lists
20     var normalized = {}
21     for( var key in data ){
22         normalized[key] = [];
23         for( var subkey in data[key] ){
24             normalized[key].push(data[key][subkey]);
25         }
26     }
27     return normalized;
28 }
29 var data = result;
30 data = JSON.stringify(data);
31 document.getElementById("filter_field").value = data;
32 var formData = $("#define_hardware_form").serialize();
33 req = new XMLHttpRequest();
34 req.open('POST', '/wf/workflow/', false);
35 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
36 req.send(formData);
37 {% endblock %}