From d510a2864de4d3df397f75a39b401349a8e7c025 Mon Sep 17 00:00:00 2001 From: Armingol Date: Mon, 13 Nov 2023 14:14:40 +0100 Subject: [PATCH] Changes in the HW inventory tab --- .../service/templates/device/inventory.html | 90 ++++++++----------- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/src/webui/service/templates/device/inventory.html b/src/webui/service/templates/device/inventory.html index 17c14785a..96e4b342a 100644 --- a/src/webui/service/templates/device/inventory.html +++ b/src/webui/service/templates/device/inventory.html @@ -73,34 +73,53 @@ -
+ +{% macro render_item(item, components, depth=0) %} + {% if depth < 10 %} + {%if item.type != 'CHASSIS' %} +
  • {{ item.name }} + +
  • + {% endif %} + {% endif %} +{% endmacro %} +
    -
    +
      -
    • Components +
    • Components
        - {% for item in (device.components|sort(true, attribute='name')) %} - {% if item.parent |length < 1 or item.type=='CHASSIS' %} -
      • {{item.name}} -
          - {% for comp in (device.components|sort(true, attribute='name')) %} - {% if item.name == comp.parent %} -
        • {{comp.name}}
        • - {% endif %} - {% endfor %} -
        -
      • - {% endif %} + {% for item in device.components | sort(reverse = false, attribute='name') %} + {% if item.parent | length < 1 or item.type == 'CHASSIS' %} +
      • {{ item.name }} +
          +
        • Component UUID: {{item.component_uuid.uuid}}
        • +
        • Attributes: {{item.attributes}}
        • + {% for comp in device.components | sort(reverse = false, attribute='name') %} + {% if item.name == comp.parent %} + {{ render_item(comp, device.components) }} + {% endif %} + {% endfor %} +
        +
      • + {% endif %} {% endfor %}
    - + - -
    - {% if device.components|length > 1 %} -
    - - - - - - - - - - - - {% for component in (device.components|sort(true, attribute='name')) %} - - - - - - - - {% endfor %} - -
    Component UUIDNameTypeParentAttributes
    - {{ component.component_uuid.uuid }} - - {{ component.name }} - - {{ component.type }} - - {{ component.parent }} - - {{ component.attributes }} -
    - {% endif %}
    {% endblock %} -- GitLab