Laas Dashboard Front End Improvements
[laas.git] / src / templates / base / resource / steps / pod_definition.html
1 {% extends "workflow/viewport-element.html" %}
2 {% block extrahead %}
3 <title>Pod Definition Prototype</title>
4
5 <!-- Loads and initializes the library -->
6 <script>
7     var mxLoadStylesheets = false;
8 </script>
9 {% endblock extrahead %}
10
11 <!-- Calls the main function after the page has loaded. Container is dynamically created. -->
12 {% block content %}
13 <div class="h-100 w-100 position-relative">
14     <div class="h-100 w-100 position-absolute overflow-hidden">
15         <div class="row h-100">
16             <div id="graphParent" class="col h-100">
17                 <div class="d-flex bg-light border align-items-center">
18                     <div id="toolbarContainer"></div>
19                     <div class="ml-4 text-info">Hold right click to drag</div>
20                 </div>
21                 <!-- Creates a container for the sidebar -->
22                 <div id="graphContainer" class="border h-100"></div>
23             </div>
24
25             <div id="network_select" class="col-2">
26                 <!-- Creates a container for the outline -->
27                 <div id="outlineContainer" class="border mb-2"></div>
28                 <button id="btn_add_network" type="button" class="btn btn-primary w-100 mb-2" onclick="network_step.newNetworkWindow();">Add Network</button>
29                 <ul id="network_list" class="list-group">
30                 </ul>
31                 <button type="button" class="d-none" onclick="network_step.submitForm();">Submit</button>
32             </div>
33         </div>
34     </div>
35 </div>
36 <form id="step_form" method="post">
37     {% csrf_token %}
38     <input type="hidden" id="hidden_xml_input" name="xml">
39 </form>
40 <script>
41     //gather context data
42     try {
43         let debug = false;
44         {% if debug %}
45         debug = true;
46         {% endif %}
47
48         const False = false;
49         const True = true;
50
51         let resources = {{resources|safe}};
52         let networks = {{networks|safe}};
53
54         network_step = new NetworkStep(
55             debug,
56             resources,
57             networks,
58             document.getElementById('graphContainer'),
59             document.getElementById('outlineContainer'),
60             document.getElementById('toolbarContainer'),
61             document.getElementById('sidebarContainer')
62         );
63         form_submission_callbacks.push(() => network_step.prepareForm());
64     } catch (e) {
65         console.log(e)
66     }
67
68 </script>
69 {% endblock content %}
70 {% block onleave %}
71 network_step.submitForm();
72 {% endblock %}