From d98ed41e288b3e9eadb6c9fbaa99d9d1fff1b041 Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Sat, 7 Sep 2024 00:00:48 -0400 Subject: [PATCH] WIP: Refactor display of host facts The idea is to highlight the most important facts in the most human-readable way possible with good UX. The full list of facts can probably still be made available for those who need it. --- .../templates/partials/tables/host_facts.html | 126 ++++++++++++------ 1 file changed, 82 insertions(+), 44 deletions(-) diff --git a/ara/ui/templates/partials/tables/host_facts.html b/ara/ui/templates/partials/tables/host_facts.html index b9f3be55..e80b6152 100644 --- a/ara/ui/templates/partials/tables/host_facts.html +++ b/ara/ui/templates/partials/tables/host_facts.html @@ -1,48 +1,86 @@ -{% load pygments_highlights %} -
-
-
- +{% load datetime_formatting %} +
+ +
+
+
System Information: {{ host.facts.ansible_fqdn }}
+
+
    +
  • Uptime: {{ host.facts.ansible_uptime_seconds | duration_from_seconds }}
  • +
  • Load average: {{ host.facts.ansible_loadavg.15m | floatformat:2 }}, {{ host.facts.ansible_loadavg.5m | floatformat:2 }}, {{ host.facts.ansible_loadavg.1m | floatformat:2 }}
  • +
  • Processor: {{ host.facts.ansible_processor.2 }} ({{ host.facts.ansible_processor_cores }} cores, {{ host.facts.ansible_processor_nproc }} threads)
  • +
  • OS: {{ host.facts.ansible_distribution }} {{ host.facts.ansible_distribution_version }}
  • +
  • Kernel: {{ host.facts.ansible_kernel }}
  • +
  • Python: {{ host.facts.ansible_python.version.major }}.{{ host.facts.ansible_python.version.minor }}.{{ host.facts.ansible_python.version.micro }}
  • +
  • Default ipv4: {{ host.facts.ansible_default_ipv4.address }} on {{ host.facts.ansible_default_ipv4.interface }} ({{ host.facts.ansible_default_ipv4.macaddress }})
  • +
  • Default ipv6: {{ host.facts.ansible_default_ipv6.address }} on {{ host.facts.ansible_default_ipv6.interface }} ({{ host.facts.ansible_default_ipv6.macaddress }})
  • +
+
-
-
- {% if host.facts.items %} -
- - - - - - - - - {% for fact, value in host.facts.items %} - - - {# Some facts are VERY LONG uninterrupted single lines (looking at you ansible_ssh_host_key_rsa_public) #} - - - {% endfor %} - -
FactValue
- {{ fact }} - - {{ value | format_data | safe }} -
+
+
+
Memory
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
totalusedfreebuff/cacheavailable
Mem:{{ host.facts.ansible_memory_mb.real.total }} MB{{ host.facts.ansible_memory_mb.real.used }} MB{{ host.facts.ansible_memory_mb.real.free }} MB{{ host.facts.ansible_memory_mb.nocache.free }} MB{{ host.facts.ansible_memory_mb.nocache.used }} MB
Swap:{{ host.facts.ansible_memory_mb.swap.total }} MB{{ host.facts.ansible_memory_mb.swap.used }} MB{{ host.facts.ansible_memory_mb.swap.free }} MB
+
+
+
+
+
Disk Partitions
+
+
+ + + + + + + + + + + + {% for mount in host.facts.ansible_mounts %} + + + + + + + + {% endfor %} + +
FilesystemTypeSizeAvailableMounted on
{{ mount.device }}{{ mount.fstype }}{{ mount.size_total | filesizeformat }}{{ mount.size_available | filesizeformat }}{{ mount.mount }}
+
+
- {% else %} -

No recorded host facts found.

-

Host facts are saved automatically when the setup module is used or when gather_facts: true is set.

- {% endif %} -
-