From a1b164b1062eb7ba6b724ebe84d8d7e0b308e234 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 9 Sep 2024 09:54:06 +0200 Subject: templates: add efi data to /client/info Show EFI info obtained through GET /efi. --- ogcp/templates/actions/client_details.html | 5 +++ ogcp/templates/efi_inspector.html | 55 ++++++++++++++++++++++++++++++ ogcp/views.py | 11 +++++- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 ogcp/templates/efi_inspector.html diff --git a/ogcp/templates/actions/client_details.html b/ogcp/templates/actions/client_details.html index 6bccace..e462205 100644 --- a/ogcp/templates/actions/client_details.html +++ b/ogcp/templates/actions/client_details.html @@ -41,7 +41,12 @@ {% set readonly_disk_inspector = True %} {% include 'disk_inspector.html' %} +
{% include 'cache_inspector.html' %} +
+ +{% include 'efi_inspector.html' %} + {% endblock %} diff --git a/ogcp/templates/efi_inspector.html b/ogcp/templates/efi_inspector.html new file mode 100644 index 0000000..43f1bc7 --- /dev/null +++ b/ogcp/templates/efi_inspector.html @@ -0,0 +1,55 @@ +{% if efi_data is defined %} + +{% if efi_data['entries']|length > 0 %} + +
+ + + + + + + + + + + + {% for entry_data in efi_data['entries'] %} + + + + + + + {% endfor %} + +
{{ _('Order') }}{{ _('Active') }}{{ _('Name') }}{{ _('Description') }}
+

+ {% if entry_data['order'] is defined %} + {{ entry_data['order'] }} + {% else %} + - + {% endif %} +

+
+

+ {% if entry_data['active'] == 1 %} + {{ _('yes') }} + {% else %} + {{ _('no') }} + {% endif %} +

+
+

{{ entry_data['name'] }}

+
+

{{ entry_data['description'] }}

+
+
+ +{% else %} +
+ {{ _('No EFI contents') }} +
+{% endif %} + +{% endif %} diff --git a/ogcp/views.py b/ogcp/views.py index af0f3fa..77bad42 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1551,6 +1551,14 @@ def action_client_info(): get_cache_info(clients_info, storage_data, images_data, client_images) + r = server.get('/efi', payload={'clients': [ip]}) + if not r: + return ogserver_down('commands') + if r.status_code != requests.codes.ok: + return ogserver_error('commands') + + efi_data = r.json()['clients'][0] + scopes, clients = get_scopes(set(ips)) return render_template('actions/client_details.html', form=form, @@ -1560,7 +1568,8 @@ def action_client_info(): selected_disk=selected_disk, images_data=images_data, storage_data=storage_data, - client_images=client_images) + client_images=client_images, + efi_data=efi_data) @app.route('/action/client/update', methods=['GET', 'POST']) @login_required -- cgit v1.2.3-18-g5258