fix: remove duplicate age_text/severity_color that conflicted with sub-agent's versions

This commit is contained in:
Graham McIntire 2026-02-13 19:00:46 -06:00
parent 5fb585d4fd
commit f64a1690fd

View file

@ -261,22 +261,6 @@ defmodule ToweropsWeb.AlertLive.Index do
end
end
defp age_text(nil), do: ""
defp age_text(dt) do
diff = DateTime.diff(DateTime.utc_now(), dt, :second)
cond do
diff < 60 -> "just now"
diff < 3600 -> "#{div(diff, 60)}m ago"
diff < 86400 -> "#{div(diff, 3600)}h ago"
true -> "#{div(diff, 86400)}d ago"
end
end
defp severity_color("critical"), do: "text-red-600 dark:text-red-400"
defp severity_color("warning"), do: "text-yellow-600 dark:text-yellow-400"
defp severity_color("info"), do: "text-blue-600 dark:text-blue-400"
defp severity_color(_), do: "text-gray-600 dark:text-gray-400"
defp format_number(number) when is_integer(number) do
number
|> Integer.to_string()