7d018ca39b66c0d67af0116ee0b80708f4844359
[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="panel panel-default">
13             <div class="panel-heading clearfix">
14                 <h4 style="display: inline;">Lab Profile</h4>
15                <a data-toggle="collapse" data-target="#panel_overview" class="btn pull-right" style="line-height: 1;" >Expand</a>
16             </div>
17             <div class="panel-body" id="panel_overview">
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="panel panel-default">
54             <div class="panel-heading clearfix">
55                 <h4 style="display: inline;">Host Profiles</h4>
56
57                <a data-toggle="collapse" data-target="#profile_panel" class="btn pull-right" style="line-height: 1;" >Expand</a>
58             </div>
59             <div class="panel-body pod_panel" id="profile_panel">
60                 <table class="table">
61                     {% for profile in hostprofiles %}
62                     <tr>
63                         <td>{{profile.name}}</td>
64                         <td>{{profile.description}}</td>
65                         <td>{{profile.labs}}</td>
66                         <td><a href="/resource/profiles/{{ profile.id }}" class="btn btn-primary">Profile</a></td>
67                     </tr>
68                     {% endfor %}
69                 </table>
70             </div>
71         </div>
72
73
74         <div class="panel panel-default">
75             <div class="panel-heading clearfix">
76                 <h4 style="display: inline;">Networking Capabilities</h4>
77             <a data-toggle="collapse" data-target="#network_panel" class="btn pull-right" style="line-height: 1;" >Expand</a>
78             </div>
79
80             <div class="panel-body" id="network_panel">
81
82                     <table class="table">
83                         <tr>
84                             <td>Block Size: (number of VLANs allowed per deployment)</td><td>{{lab.vlan_manager.block_size}}</td>
85                         </tr>
86                         <tr>
87                             <td>Overlapping Vlans Allowed (user can pick which VLANs they wish to use): </td>
88                             <td>{{lab.vlan_manager.allow_overlapping}}</td>
89                         </tr>
90                     </table>
91             </div>
92         </div>
93         <div class="panel panel-default">
94             <div class="panel-heading clearfix">
95                 <h4 style="display: inline;">Images</h4>
96             <a data-toggle="collapse" data-target="#image_panel" class="btn pull-right" style="line-height: 1;" >Expand</a>
97             </div>
98             <div class="panel-body" id="image_panel">
99                 <table class="table">
100                     <tr>
101                         <th>Name</th>
102                         <th>Owner</th>
103                         <th>For Host Type</th>
104                         <th>Description</th>
105                     </tr>
106                     {% for image in images %}
107                     <tr>
108                         <td>{{image.name}}</td>
109                         <td>{{image.owner}}</td>
110                         <td>{{image.host_type}}</td>
111                         <td>{{image.description}}</td>
112                     </tr>
113                     {% endfor %}
114                 </table>
115             </div>
116         </div>
117
118     </div>
119     <div class="col-lg-8">
120         <div class="panel panel-default">
121             <div class="panel-heading clearfix">
122                 <h4 style="display: inline;">Lab Hosts</h4>
123                 <p style="display: inline; margin-left: 10px;"></p>
124                <a data-toggle="collapse" data-target="#lab_hosts_panel" class="btn pull-right" style="line-height: 1;" >Expand</a>
125             </div>
126
127             <div class="panel-body" id="lab_hosts_panel">
128                 <table class="table">
129                     <tr>
130                         <th>Name</th>
131                         <th>Profile</th>
132                         <th>Booked</th>
133                         <th>Working</th>
134                         <th>Vendor</th>
135                     </tr>
136                     {% for host in lab.host_set.all %}
137                     <tr>
138                         <td>{{host.labid}}</td>
139                         <td>{{host.profile}}</td>
140                         <td>{{host.booked}}</td>
141                         {% if host.working %}
142                         <td style="background-color: #40B976;">{{host.working}}</td>
143                         {% else %}
144                         <td>{{host.working}}</td>
145                         {% endif %}
146                         <td>{{host.vendor}}</td>
147                     </tr>
148                     {% endfor %}
149                 </table>
150             </div>
151         </div>
152     </div>
153
154 </div>
155
156
157 {% endblock content %}
158