fix: add remaining missing helpers (device_status_dot, alert_dot, urgency_dot)

This commit is contained in:
Graham McIntire 2026-02-13 18:46:23 -06:00
parent 1d77204769
commit 0b837a7f6d

View file

@ -208,6 +208,20 @@ defmodule ToweropsWeb.TraceLive.Index do
defp loss_color(v) when v <= 5, do: "text-yellow-600 dark:text-yellow-400"
defp loss_color(_), do: "text-red-600 dark:text-red-400"
defp device_status_dot(:up), do: "bg-green-500"
defp device_status_dot(:down), do: "bg-red-500"
defp device_status_dot(_), do: "bg-gray-400"
defp alert_dot(%{severity: "critical"}), do: "bg-red-500"
defp alert_dot(%{severity: "warning"}), do: "bg-yellow-500"
defp alert_dot(%{alert_type: "down"}), do: "bg-red-500"
defp alert_dot(_), do: "bg-orange-400"
defp urgency_dot("critical"), do: "bg-red-500"
defp urgency_dot("high"), do: "bg-orange-500"
defp urgency_dot("medium"), do: "bg-yellow-500"
defp urgency_dot(_), do: "bg-blue-400"
defp airtime_quality(nil), do: :unknown
defp airtime_quality(v) when v <= 50, do: :good
defp airtime_quality(v) when v <= 80, do: :warning