update
This commit is contained in:
parent
7a57f7c9d2
commit
b12a03b82f
1 changed files with 64 additions and 27 deletions
|
|
@ -871,38 +871,75 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<!-- Count Sensors (DHCP Leases, Connections, etc.) -->
|
||||
<%= if @count_sensors && length(@count_sensors) > 0 do %>
|
||||
<%= if (@general_counters && length(@general_counters) > 0) || (@firewall_counters && length(@firewall_counters) > 0) do %>
|
||||
<div class="bg-white dark:bg-gray-800/50 rounded-lg border border-gray-200 dark:border-white/10">
|
||||
<div class="px-4 py-3 border-b border-gray-200 dark:border-white/10">
|
||||
<h3 class="text-sm font-semibold text-gray-900 dark:text-white">Counters</h3>
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<dl class="space-y-1">
|
||||
<%= for sensor <- @count_sensors do %>
|
||||
<div class="flex justify-between py-1.5 border-b border-gray-100 dark:border-white/5">
|
||||
<dt class="text-sm text-gray-600 dark:text-gray-400">
|
||||
<.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}
|
||||
</.link>
|
||||
</dt>
|
||||
<dd class="text-sm font-medium text-gray-900 dark:text-white">
|
||||
<%= 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}
|
||||
<div class="p-4 space-y-4">
|
||||
<!-- General Counters -->
|
||||
<%= if @general_counters && length(@general_counters) > 0 do %>
|
||||
<dl class="space-y-1">
|
||||
<%= for sensor <- @general_counters do %>
|
||||
<div class="flex justify-between py-1.5 border-b border-gray-100 dark:border-white/5">
|
||||
<dt class="text-sm text-gray-600 dark:text-gray-400">
|
||||
<.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}
|
||||
</.link>
|
||||
</dt>
|
||||
<dd class="text-sm font-medium text-gray-900 dark:text-white">
|
||||
<%= 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 %>
|
||||
</dd>
|
||||
</div>
|
||||
<% end %>
|
||||
</dl>
|
||||
</dd>
|
||||
</div>
|
||||
<% end %>
|
||||
</dl>
|
||||
<% end %>
|
||||
<!-- Firewall Counters -->
|
||||
<%= if @firewall_counters && length(@firewall_counters) > 0 do %>
|
||||
<div>
|
||||
<h4 class="text-xs font-semibold text-gray-700 dark:text-gray-300 mb-2 uppercase tracking-wider">
|
||||
Firewall
|
||||
</h4>
|
||||
<dl class="space-y-1">
|
||||
<%= for sensor <- @firewall_counters do %>
|
||||
<div class="flex justify-between py-1.5 border-b border-gray-100 dark:border-white/5">
|
||||
<dt class="text-sm text-gray-600 dark:text-gray-400">
|
||||
<.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}
|
||||
</.link>
|
||||
</dt>
|
||||
<dd class="text-sm font-medium text-gray-900 dark:text-white">
|
||||
<%= 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 %>
|
||||
</dd>
|
||||
</div>
|
||||
<% end %>
|
||||
</dl>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue