diff --git a/app/static/style.css b/app/static/style.css index 6b6f1a3..7f47e84 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -545,6 +545,20 @@ main { flex-shrink: 0; } +.ct-summary-item.nested { + padding-left: 14px; + opacity: 0.8; +} + +.vm-containers { + margin-top: 6px; + padding-top: 4px; + border-top: 1px dashed #334155; + display: flex; + flex-direction: column; + gap: 2px; +} + /* --- Container / VM Sub-cards --- */ .container-grid { diff --git a/app/templates/index.html b/app/templates/index.html index 1672602..e729df8 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -73,7 +73,16 @@ {% endif %} - {% set containers = d.get('container', []) if d.get('container') else [] %} + {% set containers_raw = d.get('container', []) if d.get('container') else [] %} + {% set child_vms = children_map.get(server.hostname, []) %} + {% set child_names = child_vms|map(attribute='hostname')|list %} + {% set containers = [] %} + {% for ct in containers_raw %} + {% set ct_name = ct.get('name', ct.get('id', '')) %} + {% if ct_name not in child_names %} + {% set _ = containers.append(ct) %} + {% endif %} + {% endfor %} {% if server.is_online %}
@@ -108,7 +117,6 @@
{% endif %} - {% set child_vms = children_map.get(server.hostname, []) %} {% if containers or child_vms %}
{% for vm in child_vms %} @@ -120,6 +128,15 @@ {% if vm_os %}{{ vm_os }}{% endif %} {{ vm.primary_ip or vm.hostname }}
+ {% set vm_cts = vm.details.get('container', []) if vm.details and vm.details.get('container') else [] %} + {% for vct in vm_cts %} + {% set vct_up = vct.get('status', '')|lower in ['running', 'started'] %} +
+ + {{ vct.get('name', vct.get('id', '?')) }} + {% if vct.get('ip') %}{{ vct.get('ip') }}{% endif %} +
+ {% endfor %} {% endfor %} {% for ct in containers %} {% set ct_up = ct.get('status', '')|lower in ['running', 'started'] %} @@ -419,6 +436,20 @@ {% endif %} + {% set vm_containers = vd.get('container', []) if vd.get('container') else [] %} + {% if vm_containers %} +
+ {% for vct in vm_containers %} + {% set vct_up = vct.get('status', '')|lower in ['running', 'started'] %} +
+ + {{ vct.get('name', vct.get('id', '?')) }} + {% if vct.get('type') %}{{ vct.get('type')|upper }}{% endif %} + {% if vct.get('ip') %}{{ vct.get('ip') }}{% endif %} +
+ {% endfor %} +
+ {% endif %} {% else %}
offline