summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/client_list.html
blob: 723dce95e5817cf24cf4265f9cf72302f395a26c (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
{% extends 'base.html' %}

{% set btn_back = true %}

{% block content %}

<h2 class="mx-5 subhead-heading">{{_('Connected clients')}}</h2>

<div class="container mx-5">

{% include 'client_status_leyend.html' %}

{% for server_id, server_data in servers_data.items() %}
<div class="accordion card" id="shellAccordion">
    <div class="card-header" id="heading_1">
        <h2 class="mb-0">
            <button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapse_{{ loop.index }}" aria-expanded="true" aria-controls="collapse_{{ loop.index }}">
                <h4>{{ server_data.name}}</h4>
            </button>
        </h2>
    </div>
    <div id="collapse_{{ loop.index }}" class="collapse show" aria-labelledby="heading_{{ loop.index }}">
        <div class="card-body">
            <table class="table table-hover">
                <thead class="thead-light">
                    <tr>
                        <th>{{ _('Name') }}</th>
                        <th>{{ _('IP') }}</th>
                        <th>{{ _('Link speed') }}</th>
                        <th>{{ _('Status') }}</th>
                        <th>{{ _('Details') }}</th>
                    </tr>
                </thead>

                <tbody data-target="cache-fieldset" id="cacheTable" class="text-left">
                    {% for client_data in server_data.clients %}
                    <tr data-toggle="fieldset-entry">
                        <td>{{ client_data.name }}</td>
                        <td>{{ client_data.addr }}</td>
                        <td>
                            {% if client_data.speed is not none and client_data.speed > 0 %}
                                {% if client_data.speed >= 1000 %}
                                    {{ (client_data.speed / 1000) | int }} Gb/s
                                {% else %}
                                    {{ client_data.speed }} Mb/s
                                {% endif %}
                            {% else %}
                                {{ _('Not available') }}
                            {% endif %}
                        </td>
                        <td>
                            <i class="nav-icon fa-circle
                                {% if client_data.state == 'OPG' and client_data.last_cmd.result == 'failure' %}
                                    fas text-warning fa-times-circle
                                {% elif client_data.state == 'OPG' %}
                                    fas text-warning
                                {% elif client_data.state == 'LNX' %}
                                    fas text-linux
                                {% elif client_data.state == 'LNX' %}
                                    fas fa-user-circle text-linux
                                {% elif client_data.state == 'WIN' %}
                                    fas text-windows
                                {% elif client_data.state == 'WIN' %}
                                    fas fa-user-circle text-windows
                                {% elif client_data.state == 'BSY' %}
                                    fas text-danger
                                {% elif client_data.state == 'VDI' %}
                                    fas text-success
                                {% elif client_data.state == 'WOL_SENT' %}
                                    fas text-wol
                                {% else %}
                                    far
                                {% endif %}
                            "></i>
                        </td>
                        <td><a href="{{ url_for('action_client_info', client_ip = client_data.addr) }}">{{ _('View details') }}</a></td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endfor %}

</div>

{% endblock %}