diff --git a/src/webui/service/templates/device/inventory.html b/src/webui/service/templates/device/inventory.html
index 17c14785a89658b59e07373bc7d939e234937631..96e4b342a28dbfd68cd0d945bfd0123edfeaf2af 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 }}
+
+ - Component UUID: {{item.component_uuid.uuid}}
+ - Attributes: {{item.attributes}}
+ {% for comp in components | sort(reverse = false, attribute='name') %}
+ {% if item.name == comp.parent %}
+ {{ render_item(comp, components, depth + 1) }}
+ {% endif %}
+ {% endfor %}
+
+
+ {% 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 %}
-
-
-
-
- Component UUID |
- Name |
- Type |
- Parent |
- Attributes |
-
-
-
- {% for component in (device.components|sort(true, attribute='name')) %}
-
-
- {{ component.component_uuid.uuid }}
- |
-
- {{ component.name }}
- |
-
- {{ component.type }}
- |
-
- {{ component.parent }}
- |
-
- {{ component.attributes }}
- |
-
- {% endfor %}
-
-
- {% endif %}
{% endblock %}