Merge "Hacking on AJAX"
[laas.git] / src / templates / dashboard / lab_detail.html
1 {% extends "base.html" %}
2 {% load staticfiles %}
3
4 {% block extrahead %}
5     {{block.super}}
6     <script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang=yaml"></script>
7 {% endblock %}
8
9 {% block content %}
10 <div class="row">
11     <div class="col-lg-4">
12         <div class="card my-2">
13             <div class="card-header d-flex">
14                 <h4>Lab Profile</h4>
15                 <button class="btn btn-outline-secondary ml-auto" data-toggle="collapse" data-target="#panel_overview">Expand</button>
16             </div>
17             <div class="collapse show" id="panel_overview">
18                 <div class="card-body">
19                     <table class="table">
20                         <tr>
21                             <td>Lab Name: </td>
22                             <td>{{lab.name}}</td>
23                         </tr>
24                         <tr>
25                             <td>Lab Location: </td>
26                             <td>{{lab.location}}</td>
27                         </tr>
28                         <tr>
29                             <td>Lab Email: </td>
30                             <td>{{lab.contact_email}}</td>
31                         </tr>
32                         {% if lab.contact_phone %}
33                             <tr>
34                                 <td>Lab Phone: </td>
35                                 <td>{{lab.contact_phone}}</td>
36                             </tr>
37                         {% endif %}
38                         <tr>
39                             <td>Lab Status: </td>
40                             {% if lab.status < 100 %}
41                                 <td>
42                                     <div class="rounded-circle bg-success square-20 d-inline-block"></div>
43                                     Up
44                                 </td>
45                             {% elif lab.status < 200 %}
46                                 <td>
47                                     <div class="rounded-circle bg-warning square-20 d-inline-block"></div>
48                                     Temporarily Offline
49                                 </td>
50                             {% else %}
51                                 <td>
52                                     <div class="rounded-circle bg-danger square-20 d-inline-block"></div>
53                                     Offline Indefinitely
54                                 </td>
55                             {% endif %}
56                         </tr>
57                     </table>
58                 </div>
59             </div>
60         </div>
61         <div class="card my-2">
62             <div class="card-header d-flex">
63                 <h4 class="d-inline-block">Host Profiles</h4>
64                 <button data-toggle="collapse" data-target="#profile_panel" class="btn btn-outline-secondary ml-auto">Expand</button>
65             </div>
66             <div class="collapse show" id="profile_panel">
67                 <div class="card-body">
68                     <table class="table">
69                         {% for profile in hostprofiles %}
70                             <tr>
71                                 <td>{{profile.name}}</td>
72                                 <td>{{profile.description}}</td>
73                                 <td><a href="/resource/profiles/{{ profile.id }}" class="btn btn-info">Profile</a></td>
74                             </tr>
75                         {% endfor %}
76                     </table>
77                 </div>
78             </div>
79         </div>
80
81
82         <div class="card my-2">
83             <div class="card-header d-flex">
84                 <h4 class="d-inline">Networking Capabilities</h4>
85                 <button data-toggle="collapse" data-target="#network_panel" class="btn btn-outline-secondary ml-auto">Expand</button>
86             </div>
87
88             <div class="collapse show" id="network_panel">
89                 <div class="card-body">
90                     <table class="table">
91                         <tr>
92                             <td>Block Size: (number of VLANs allowed per deployment)</td><td>{{lab.vlan_manager.block_size}}</td>
93                         </tr>
94                         <tr>
95                             <td>Overlapping Vlans Allowed (user can pick which VLANs they wish to use): </td>
96                             <td>{{lab.vlan_manager.allow_overlapping}}</td>
97                         </tr>
98                     </table>
99                 </div>
100             </div>
101         </div>
102         <div class="card my-2">
103             <div class="card-header d-flex">
104                 <h4>Images</h4>
105                 <button data-toggle="collapse" data-target="#image_panel" class="btn btn-outline-secondary ml-auto">Expand</button>
106             </div>
107             <div class="collapse show" id="image_panel">
108                 <div class="card-body">
109                     <table class="table">
110                         <tr>
111                             <th>Name</th>
112                             <th>Owner</th>
113                             <th>For Host Type</th>
114                             <th>Description</th>
115                         </tr>
116                         {% for image in images %}
117                             <tr>
118                                 <td>{{image.name}}</td>
119                                 <td>{{image.owner}}</td>
120                                 <td>{{image.host_type}}</td>
121                                 <td>{{image.description}}</td>
122                             </tr>
123                         {% endfor %}
124                     </table>
125                 </div>
126             </div>
127         </div>
128
129     </div>
130     <div class="col-lg-8">
131         <div class="card my-2">
132             <div class="card-header d-flex">
133                 <h4>Lab Hosts</h4>
134                 <button data-toggle="collapse" data-target="#lab_hosts_panel" class="btn btn-outline-secondary ml-auto">Expand</button>
135             </div>
136
137             <div class="collapse show" id="lab_hosts_panel">
138                 <div class="card-body">
139                     <table class="table">
140                         <tr>
141                             <th>Name</th>
142                             <th>Profile</th>
143                             <th>Booked</th>
144                             <th>Working</th>
145                             <th>Vendor</th>
146                         </tr>
147                         {% for host in lab.host_set.all %}
148                             <tr>
149                                 <td>{{host.labid}}</td>
150                                 <td>{{host.profile}}</td>
151                                 <td>{{host.booked}}</td>
152                                 {% if host.working %}
153                                     <td class="bg-success text-white">{{host.working}}</td>
154                                 {% else %}
155                                     <td>{{host.working}}</td>
156                                 {% endif %}
157                                 <td>{{host.vendor}}</td>
158                             </tr>
159                         {% endfor %}
160                     </table>
161                 </div>
162             </div>
163         </div>
164     </div>
165
166 </div>
167
168
169 {% endblock content %}
170