aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/base/dashboard/lab_detail.html
blob: cd096f6f69a04b8ef719f2f112da6ed990551200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{% extends "base.html" %}
{% load staticfiles %}

{% block extrahead %}
    {{block.super}}
    <script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang=yaml"></script>
{% endblock %}

{% block content %}
<div class="row">
    <div class="col-lg-4">
        <div class="card mb-3">
            <div class="card-header d-flex">
                <h4>Lab Profile</h4>
            </div>
            <div class="collapse show" id="panel_overview">
                <div class="overflow-auto">
                    <table class="table m-0">
                        <tr>
                            <td>Lab Name: </td>
                            <td>{{lab.name}}</td>
                        </tr>
                        <tr>
                            <td>Lab Location: </td>
                            <td>{{lab.location}}</td>
                        </tr>
                        <tr>
                            <td>Lab Email: </td>
                            <td>{{lab.contact_email}}</td>
                        </tr>
                        {% if lab.contact_phone %}
                            <tr>
                                <td>Lab Phone: </td>
                                <td>{{lab.contact_phone}}</td>
                            </tr>
                        {% endif %}
                        <tr>
                            <td>Lab Status: </td>
                            {% if lab.status < 100 %}
                                <td>
                                    <div class="rounded-circle bg-success square-20 d-inline-block"></div>
                                    Up
                                </td>
                            {% elif lab.status < 200 %}
                                <td>
                                    <div class="rounded-circle bg-warning square-20 d-inline-block"></div>
                                    Temporarily Offline
                                </td>
                            {% else %}
                                <td>
                                    <div class="rounded-circle bg-danger square-20 d-inline-block"></div>
                                    Offline Indefinitely
                                </td>
                            {% endif %}
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div class="card my-3">
            <div class="card-header d-flex">
                <h4 class="d-inline-block">Host Profiles</h4>
            </div>
            <div class="collapse show" id="profile_panel">
                <div class="overflow-auto">
                    <table class="table m-0">
                        {% for flavor in flavors %}
                            <tr>
                                <td>{{flavor.name}}</td>
                                <td>{{flavor.description}}</td>
                                <td><a href="/resource/profile/{{ flavor.flavor_id }}" class="btn btn-info">Profile</a></td>
                            </tr>
                        {% endfor %}
                    </table>
                </div>
            </div>
        </div>

        <div class="card my-3">
            <div class="card-header d-flex">
                <h4 class="d-inline">Networking Capabilities</h4>
            </div>

            <div class="collapse show" id="network_panel">
                <table class="table m-0">
                    <tr>
                        <td>Block Size: (number of VLANs allowed per deployment)</td><td>{{lab.vlan_manager.block_size}}</td>
                    </tr>
                    <tr>
                        <td>Overlapping Vlans Allowed (user can pick which VLANs they wish to use): </td>
                        <td>{{lab.vlan_manager.allow_overlapping|yesno:"Yes,No"}}</td>
                    </tr>
                </table>
            </div>
        </div>

    </div>
    <div class="col-lg-8">
        <div class="card mb-3">
            <div class="card-header d-flex">
                <h4>Lab Hosts</h4>
            </div>

            <div class="collapse show" id="lab_hosts_panel">
                <table class="table m-0">
                    <tr>
                        <th>Name</th>
                        <th>Architecture</th>
                        <th>Profile</th>
                        <th>Booked</th>
                        <th>Working</th>
                    </tr>
                    {% for host in hosts %}
                    <tr>
                        <td>
                            {{ host.name }}
                        </td>
                        <td>
                            {{ host.arch }}
                        </td>
                        <td>
                            <a href="../../resource/profile/{{ host.flavor.id }}">{{ host.flavor.name }}</a>
                        </td>
                        <td>
                        {% if host.allocation != null %}
                        Yes
                        {% else %}
                        No
                        {% endif %}
                        </td>
                        <td>
                        {% if host.allocation.reason == "maintenance" %}
                        No
                        {% else %}
                        Yes
                        {% endif %}
                        </td>
                    </tr>
                {% endfor %}
                </table>
            </div>
        </div>
    </div>

</div>


{% endblock content %}