Merge "Fixes a typo"
[pharos-tools.git] / dashboard / 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 id="panel_overview" class="card-body collapse show">
18                 <table class="table">
19                     <tr>
20                         <td>Lab Name: </td><td>{{lab.name}}</td>
21                     </tr>
22                     <tr>
23                         <td>Lab Location: </td><td>{{lab.location}}</td>
24                     </tr>
25                     <tr>
26                         <td>Lab Email: </td>
27                         <td>{{lab.contact_email}}</td>
28                     </tr>
29                     {% if lab.contact_phone %}
30                     <tr>
31                         <td>Lab Phone: </td>
32                         <td>{{lab.contact_phone}}</td>
33                     </tr>
34                     {% endif %}
35                     <tr>
36                         <td>Lab Status: </td>
37                         {% if lab.status < 100 %}
38                         <td><div style="border-radius: 50%; background:#40B976; height: 20px; width: 20px; display: inline-block;"></div>
39                         Up</td>
40                         {% elif lab.status < 200 %}
41                         <td>
42                         <div style="border-radius: 50%; background:#eeee00; height: 20px; width: 20px; display: inline-block;"></div>
43                         Temporarily Offline</td>
44                         {% else %}
45                         <td>
46                         <div style="border-radius: 50%; background:#e50000; height: 20px; width: 20px; display: inline-block;"></div>
47                         Offline Indefinitely</td>
48                         {% endif %}
49                     </tr>
50                 </table>
51             </div>
52         </div>
53         <div class="card my-2">
54             <div class="card-header d-flex">
55                 <h4 class="d-inline-block">Host Profiles</h4>
56                <button data-toggle="collapse" data-target="#profile_panel" class="btn btn-outline-secondary ml-auto" style="line-height: 1;" >Expand</button>
57             </div>
58             <div id="profile_panel" class="card-body collapse show">
59                 <table class="table">
60                     {% for profile in hostprofiles %}
61                     <tr>
62                         <td>{{profile.name}}</td>
63                         <td>{{profile.description}}</td>
64                         <td><a href="/resource/profiles/{{ profile.id }}" class="btn btn-info">Profile</a></td>
65                     </tr>
66                     {% endfor %}
67                 </table>
68             </div>
69         </div>
70
71
72         <div class="card my-2">
73             <div class="card-header d-flex">
74                 <h4 style="display: inline;">Networking Capabilities</h4>
75             <button data-toggle="collapse" data-target="#network_panel" class="btn btn-outline-secondary ml-auto" style="line-height: 1;" >Expand</button>
76             </div>
77
78             <div class="card-body collapse show" id="network_panel">
79                 <table class="table">
80                     <tr>
81                         <td>Block Size: (number of VLANs allowed per deployment)</td><td>{{lab.vlan_manager.block_size}}</td>
82                     </tr>
83                     <tr>
84                         <td>Overlapping Vlans Allowed (user can pick which VLANs they wish to use): </td>
85                         <td>{{lab.vlan_manager.allow_overlapping}}</td>
86                     </tr>
87                 </table>
88             </div>
89         </div>
90         <div class="card my-2">
91             <div class="card-header d-flex">
92                 <h4>Images</h4>
93                 <button data-toggle="collapse" data-target="#image_panel" class="btn btn-outline-secondary ml-auto">Expand</button>
94             </div>
95             <div class="card-body collapse show" id="image_panel">
96                 <table class="table">
97                     <tr>
98                         <th>Name</th>
99                         <th>Owner</th>
100                         <th>For Host Type</th>
101                         <th>Description</th>
102                     </tr>
103                     {% for image in images %}
104                     <tr>
105                         <td>{{image.name}}</td>
106                         <td>{{image.owner}}</td>
107                         <td>{{image.host_type}}</td>
108                         <td>{{image.description}}</td>
109                     </tr>
110                     {% endfor %}
111                 </table>
112             </div>
113         </div>
114
115     </div>
116     <div class="col-lg-8">
117         <div class="card my-2">
118             <div class="card-header d-flex">
119                 <h4>Lab Hosts</h4>
120                 <button data-toggle="collapse" data-target="#lab_hosts_panel" class="btn btn-outline-secondary ml-auto">Expand</button>
121             </div>
122
123             <div class="card-body collapse show" id="lab_hosts_panel">
124                 <table class="table">
125                     <tr>
126                         <th>Name</th>
127                         <th>Profile</th>
128                         <th>Booked</th>
129                         <th>Working</th>
130                         <th>Vendor</th>
131                     </tr>
132                     {% for host in lab.host_set.all %}
133                     <tr>
134                         <td>{{host.labid}}</td>
135                         <td>{{host.profile}}</td>
136                         <td>{{host.booked}}</td>
137                         {% if host.working %}
138                         <td style="background-color: #40B976;">{{host.working}}</td>
139                         {% else %}
140                         <td>{{host.working}}</td>
141                         {% endif %}
142                         <td>{{host.vendor}}</td>
143                     </tr>
144                     {% endfor %}
145                 </table>
146             </div>
147         </div>
148     </div>
149
150 </div>
151
152
153 {% endblock content %}
154