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