diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-09-10 15:21:03 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-09-11 12:24:44 +0200 |
commit | 696a81fd1147e301dd69609558da387f17c57228 (patch) | |
tree | a11a1c47b56329af844eaa81c7b68adfec7842cf /ogcp/templates/client_list.html | |
parent | 6b33268b5c03db29cb003acb4e2042c9254402d2 (diff) |
templates: add name and status to client list
Add a client name column to the client list view accessed through
the Dashboard.
Add status column to the client list.
Move client status leyend into a separate file.
Show the client status leyend in client list.
Fix the 0 link speed conditional.
Reuse the data returned by get_scopes() to reduce the number of
requests.
Diffstat (limited to 'ogcp/templates/client_list.html')
-rw-r--r-- | ogcp/templates/client_list.html | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/ogcp/templates/client_list.html b/ogcp/templates/client_list.html index 8a3fd5b..723dce9 100644 --- a/ogcp/templates/client_list.html +++ b/ogcp/templates/client_list.html @@ -8,6 +8,8 @@ <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"> @@ -22,8 +24,10 @@ <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> @@ -31,9 +35,10 @@ <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 %} + {% 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 %} @@ -43,6 +48,31 @@ {{ _('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 %} |