fix(gaiia): correct Interface MAC field name, relabel auto-match button

- Interface MAC field is `if_phys_address`, not `mac_address`
- Button now says "Auto-Match All" since it matches by MAC, IP, and site
This commit is contained in:
Graham McIntire 2026-05-11 16:20:35 -05:00
parent 3483d9d5f0
commit fb2d4b9b1a
2 changed files with 4 additions and 4 deletions

View file

@ -264,8 +264,8 @@ defmodule Towerops.Gaiia do
|> join(:inner, [si], sd in SnmpDevice, on: si.snmp_device_id == sd.id)
|> join(:inner, [_si, sd], d in Device, on: sd.device_id == d.id)
|> where([_si, _sd, d], d.organization_id == ^organization_id)
|> where([si], not is_nil(si.mac_address) and si.mac_address != "")
|> select([si, sd], {sd.device_id, si.mac_address})
|> where([si], not is_nil(si.if_phys_address) and si.if_phys_address != "")
|> select([si, sd], {sd.device_id, si.if_phys_address})
|> Repo.all()
|> Enum.group_by(fn {device_id, _mac} -> device_id end, fn {_device_id, mac} -> normalize_mac(mac) end)
end

View file

@ -139,10 +139,10 @@
class="inline-flex items-center gap-1.5 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700"
>
<.icon name="hero-bolt" class="h-4 w-4" />
{t("Auto-Match by IP")}
{t("Auto-Match All")}
</button>
<span class="text-sm text-gray-500 dark:text-gray-400">
{t("Links devices to Gaiia items with matching IP addresses.")}
{t("Links by MAC, IP, or site assignment.")}
</span>
</div>
<div class="overflow-hidden rounded-lg border border-gray-200 dark:border-white/10">