towerops/lib/towerops_web/live
Graham McIntire 96706b2cf8
Deduplicate agent status helper functions
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.
2026-01-14 19:12:06 -06:00
..
admin Add superuser system with user impersonation for admin support 2026-01-06 12:50:10 -06:00
agent_live Deduplicate agent status helper functions 2026-01-14 19:12:06 -06:00
alert_live Fix impersonation to show correct user data and banner 2026-01-06 13:22:13 -06:00
equipment_live Enhance agent assignment UI with clear inheritance indicators 2026-01-14 16:20:20 -06:00
graph_live Refactor credo issues: reduce complexity and nesting depth 2026-01-06 13:55:16 -06:00
org Enhance agent assignment UI with clear inheritance indicators 2026-01-14 16:20:20 -06:00
org_live Fix impersonation to show correct user data and banner 2026-01-06 13:22:13 -06:00
site_live Enhance agent assignment UI with clear inheritance indicators 2026-01-14 16:20:20 -06:00
dashboard_live.ex fix dialyzer things 2026-01-03 12:56:40 -06:00
dashboard_live.html.heex Fix impersonation to show correct user data and banner 2026-01-06 13:22:13 -06:00