towerops/lib/towerops_web/live/agent_live
Graham McIntire 6f6627a54d
refactor: consolidate device count calculations in agent_live
Remove duplicate device counting logic by consolidating three identical
implementations into a single reusable function.

**Changes:**
- Refactor agent_live/index.ex mount/3 to use calculate_device_counts/1
- Delete duplicate calculate_cloud_poller_counts/1 function
- Replace all usages with calculate_device_counts/1

**Before:**
- Lines 31-47: Inline counting for agent_tokens and cloud_pollers
- Lines 312-318: calculate_device_counts/1
- Lines 320-326: calculate_cloud_poller_counts/1 (identical logic)

**After:**
- Single calculate_device_counts/1 function used everywhere
- ~20 lines removed

**Benefits:**
- Eliminates triple duplication of counting logic
- Single source of truth for device counting
- Easier to maintain and test

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 17:53:18 -06:00
..
edit.ex more gettext 2026-02-02 13:10:08 -06:00
edit.html.heex enable agent debugging 2026-01-27 13:25:04 -06:00
helpers.ex more dark mode 2026-01-20 17:23:11 -06:00
index.ex refactor: consolidate device count calculations in agent_live 2026-02-04 17:53:18 -06:00
index.html.heex update docker compose instructions 2026-02-03 13:00:51 -06:00
show.ex filter more honeybadger alerts, format dates to users time zone, email template cleanup 2026-02-01 09:27:42 -06:00
show.html.heex filter more honeybadger alerts, format dates to users time zone, email template cleanup 2026-02-01 09:27:42 -06:00