1 {% extends "base.html" %}
7 <script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang=yaml"></script>
18 <div class="col-12 col-lg-5">
19 <div class="card mb-3">
20 <div class="card-header d-flex">
21 <h4 class="d-inline">Overview</h4>
22 <button data-toggle="collapse" data-target="#panel_overview" class="btn btn-outline-secondary ml-auto">Expand</button>
24 <div class="collapse show" id="panel_overview">
25 <table class="table m-0">
28 <td>{{ posix_username }}</td>
32 <td>{{ booking.purpose }}</td>
36 <td>{{ booking.project }}</td>
40 <td>{{ booking.start }}</td>
44 <td>{{ booking.end }}</td>
47 <td>Pod Definition</td>
48 <td>{{ booking.resource.template }}</td>
51 <td>Lab Deployed At</td>
52 <td>{{ booking.lab }}</td>
57 <div class="card my-3">
58 <div class="card-header d-flex">
59 <h4 class="d-inline">Pod</h4>
60 <button data-toggle="collapse" data-target="#pod_panel" class="btn btn-outline-secondary ml-auto">Expand</button>
62 <div class="collapse show" id="pod_panel">
63 <div class="card-body">
64 <h4>{{host.bundle.template.copy_of.name}}</h4>
65 {% for host in booking.resource.get_resources %}
66 <h4>{{host.config.name}}</h4>
67 <div class="overflow-auto">
68 <table class="table m-0">
71 <td>{{host.config.name}}</td>
75 <td>{{host.name}}</td>
79 <td>{{host.template.opnfvRole}}</td>
83 <td>{{host.config.is_head_node}}</td>
86 <td id="host_image_{{host.id}}">
89 class="btn btn-primary ml-4"
91 data-target="#imageModal"
92 onclick="set_image_dropdown('{{host.profile.name}}', {{host.id}});"
93 >Change/Reset</button></td>
97 <td>{{host.profile.ramprofile.first.amount}}G,
98 {{host.profile.ramprofile.first.channels}} channels</td>
103 <table class="table m-0">
106 <td>{{host.profile.cpuprofile.first.architecture}}</td>
110 <td>{{host.profile.cpuprofile.first.cores}}</td>
114 <td>{{host.profile.cpuprofile.first.cpus}}</td>
122 <table class="table m-0">
125 <td>{{host.profile.storageprofile.first.size}} GiB</td>
129 <td>{{host.profile.storageprofile.first.media_type}}</td>
132 <td>Mount Point:</td>
133 <td>{{host.profile.storageprofile.first.name}}</td>
141 <table class="table m-0">
142 {% for intprof in host.profile.interfaceprofile.all %}
145 <table class="table table-sm table-borderless m-0">
148 <td>{{intprof.name}}</td>
152 <td>{{intprof.speed}}</td>
167 <div class="card my-3">
168 <div class="card-header d-flex">
169 <h4 class="d-inline">Diagnostic Information</h4>
170 <button data-toggle="collapse" data-target="#diagnostics_panel" class="btn btn-outline-secondary ml-auto">Expand</button>
172 <div class="collapse" id="diagnostics_panel">
173 <div class="card-body">
174 <table class="table m-0">
177 <td>{{booking.job.id}}</td>
182 {% for host in booking.resource.get_resources %}
185 <table class="table m-0">
188 <td>{{host.name}}</td>
193 {% for ci_file in host.config.cloud_init_files.all %}
195 <td>{{ci_file.id}}</td>
197 <div class="modal fade" id="ci_file_modal_{{ci_file.id}}" tabindex="-1" role="dialog" aria-hidden="true">
198 <div class="modal-dialog modal-xl" role="document">
199 <div class="modal-content">
200 <div class="modal-header">
201 <h4 class="modal-title d-inline float-left">Cloud Config Content</h4>
202 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
203 <span aria-hidden="true">×</span>
206 <div class="card-body">
207 <pre class="prettyprint lang-yaml m-0 border-0 text-break pre-wrap">
214 <button class="btn btn-primary" data-toggle="modal" data-target="#ci_file_modal_{{ci_file.id}}">Show File Content</button>
228 <div class="card mb-3">
229 <div class="card-header d-flex">
230 <h4 class="d-inline">Deployment Progress</h4>
231 <p>These are the different tasks that have to be completed before your deployment is ready.
232 If this is taking a really long time, let us know <a href="mailto:{{contact_email}}">here!</a></p>
233 <button data-toggle="collapse" data-target="#panel_tasks" class="btn btn-outline-secondary ml-auto">Expand</button>
235 <div class="collapse show" id="panel_tasks">
236 <table class="table m-0">
240 <th>Lab Response</th>
243 {% for task in booking.job.get_tasklist %}
246 {% if task.status < 100 %}
247 <div class="rounded-circle bg-secondary square-20"></div>
248 {% elif task.status < 200 %}
249 <div class="spinner-border text-primary square-20"></div>
251 <div class="rounded-circle bg-success square-20"></div>
255 {% if task.status < 100 %}
257 {% elif task.status < 200 %}
264 {% if task.message %}
265 {% if task.type_str == "Access Task" and user_id != task.config.user.id %}
266 Message from Lab: <pre>--secret--</pre>
268 Message from Lab: <pre class="text-break pre-wrap">{{ task.message }}</pre>
271 No response provided (yet)
282 <div class="card my-3">
283 <div class="card-header d-flex">
284 <h4 class="d-inline">PDF</h4>
285 <button data-toggle="collapse" data-target="#pdf_panel" class="btn btn-outline-secondary ml-auto">Expand</button>
287 <div class="collapse show" id="pdf_panel">
288 <div class="card-body">
289 <pre class="prettyprint lang-yaml m-0 border-0 text-break pre-wrap">
299 <div class="modal fade" id="imageModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
300 <div class="modal-dialog" role="document">
301 <div class="modal-content">
302 <div class="modal-header">
303 <h4 class="modal-title d-inline float-left" id="exampleModalLabel">Host Image</h4>
304 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
305 <span aria-hidden="true">×</span>
308 <div class="modal-body">
309 <form id="image_host_form">
311 <select class="form-control" id="image_select" name="image_id">
313 <input id="host_id_input" type="hidden" name="host_id">
316 <div class="modal-footer d-flex flex-column">
318 <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button>
319 <button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#modal_warning" aria-expanded="false">Reset Host</button>
321 <div class="border-top collapse mt-3 py-2 text-center w-100" id="modal_warning">
322 <h3>Are You Sure?</h3>
323 <p>This will wipe the disk and reimage the host</p>
324 <button class="btn btn-outline-secondary" data-dismiss="modal">Nevermind</button>
325 <button class="btn btn-danger" data-dismiss="modal" onclick="submit_image_form();">I'm Sure</button>
333 var image_mapping = {{image_mapping|safe}};
334 var current_host_id = 0;
335 function set_image_dropdown(profile_name, host_id) {
336 document.getElementById("host_id_input").value = host_id;
337 current_host_id = host_id;
338 var dropdown = document.getElementById("image_select");
339 var length = dropdown.length;
341 for(i=length-1; i>=0; i--){
342 dropdown.options.remove(i);
344 var images = image_mapping[profile_name];
345 var image_length = images.length;
346 for(i=0; i<image_length; i++){
347 var opt = document.createElement("OPTION");
348 opt.value = images[i].value;
349 opt.appendChild(document.createTextNode(images[i].name));
350 dropdown.options.add(opt);
353 document.getElementById("modal_warning").classList.add("collapse");
356 function submit_image_form() {
357 var ajaxForm = $("#image_host_form");
358 var formData = ajaxForm.serialize();
359 req = new XMLHttpRequest();
360 req.open("POST", "/booking/modify/{{booking.id}}/image/", true);
361 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
362 req.onerror = function() { alert("problem submitting form"); }
363 req.onreadystatechange = function() {
364 if(req.readyState === 4) {
365 node = document.getElementById("host_image_" + current_host_id);
366 text = document.createTextNode(req.responseText);
367 node.replaceChild(text, node.firstChild);
373 {% endblock content %}