diff --git a/lib/towerops_web/live/device_live/show.html.heex b/lib/towerops_web/live/device_live/show.html.heex index 0afc9b7b..a92e93f4 100644 --- a/lib/towerops_web/live/device_live/show.html.heex +++ b/lib/towerops_web/live/device_live/show.html.heex @@ -871,38 +871,75 @@ <% end %> - <%= if @count_sensors && length(@count_sensors) > 0 do %> + <%= if (@general_counters && length(@general_counters) > 0) || (@firewall_counters && length(@firewall_counters) > 0) do %>

Counters

-
-
- <%= for sensor <- @count_sensors do %> -
-
- <.link - navigate={ - ~p"/devices/#{@device.id}/graph/#{sensor.sensor_type}?sensor_id=#{sensor.id}" - } - class="hover:text-blue-600 dark:hover:text-blue-400 hover:underline" - > - {sensor.sensor_descr} - -
-
- <%= if sensor.latest_reading && sensor.latest_reading.value do %> - {trunc(sensor.latest_reading.value)} - <%= if sensor.sensor_unit && sensor.sensor_unit != "" do %> - {sensor.sensor_unit} +
+ + <%= if @general_counters && length(@general_counters) > 0 do %> +
+ <%= for sensor <- @general_counters do %> +
+
+ <.link + navigate={ + ~p"/devices/#{@device.id}/graph/#{sensor.sensor_type}?sensor_id=#{sensor.id}" + } + class="hover:text-blue-600 dark:hover:text-blue-400 hover:underline" + > + {sensor.sensor_descr} + +
+
+ <%= if sensor.latest_reading && sensor.latest_reading.value do %> + {trunc(sensor.latest_reading.value)} + <%= if sensor.sensor_unit && sensor.sensor_unit != "" do %> + {sensor.sensor_unit} + <% end %> + <% else %> + N/A <% end %> - <% else %> - N/A - <% end %> -
-
- <% end %> -
+
+
+ <% end %> +
+ <% end %> + + <%= if @firewall_counters && length(@firewall_counters) > 0 do %> +
+

+ Firewall +

+
+ <%= for sensor <- @firewall_counters do %> +
+
+ <.link + navigate={ + ~p"/devices/#{@device.id}/graph/#{sensor.sensor_type}?sensor_id=#{sensor.id}" + } + class="hover:text-blue-600 dark:hover:text-blue-400 hover:underline" + > + {sensor.sensor_descr} + +
+
+ <%= if sensor.latest_reading && sensor.latest_reading.value do %> + {trunc(sensor.latest_reading.value)} + <%= if sensor.sensor_unit && sensor.sensor_unit != "" do %> + {sensor.sensor_unit} + <% end %> + <% else %> + N/A + <% end %> +
+
+ <% end %> +
+
+ <% end %>
<% end %>