towerops/lib/towerops_web
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
..
components Add Agents navigation link to authenticated layout 2026-01-13 13:14:23 -06:00
controllers Fix protobuf body parsing causing 400 errors on agent heartbeat 2026-01-14 18:35:20 -06:00
live Deduplicate agent status helper functions 2026-01-14 19:12:06 -06:00
plugs Fix agent IP detection to use real client IP from proxy headers 2026-01-14 17:04:59 -06:00
endpoint.ex Fix protobuf body parsing causing 400 errors on agent heartbeat 2026-01-14 18:35:20 -06:00
gettext.ex init 2025-12-21 11:10:43 -06:00
router.ex Implement all quick win improvements for agent UI and functionality 2026-01-14 18:46:03 -06:00
telemetry.ex format 2025-12-21 11:31:08 -06:00
user_auth.ex Streamline login flow and fix test failures 2026-01-13 13:08:24 -06:00