Extracted 5 shared helper functions into ToweropsWeb.AgentLive.Helpers: - agent_status/1 - Determines online/warning/offline/never status - status_badge_class/1 - Returns Tailwind CSS classes for status badges - status_dot_class/1 - Returns CSS classes for animated status dots - format_last_seen/1 - Formats DateTime as human-readable time ago - format_uptime/1 - Formats uptime seconds as days/hours/minutes Removed duplicate code from: - lib/towerops_web/live/agent_live/index.ex - lib/towerops_web/live/agent_live/show.ex Both modules now import the shared helpers, following DRY principle. This reduces code duplication and makes status formatting consistent across all agent-related pages. |
||
|---|---|---|
| .. | ||
| admin | ||
| agent_live | ||
| alert_live | ||
| equipment_live | ||
| graph_live | ||
| org | ||
| org_live | ||
| site_live | ||
| dashboard_live.ex | ||
| dashboard_live.html.heex | ||