diff --git a/lib/towerops/gaiia/inventory_creator.ex b/lib/towerops/gaiia/inventory_creator.ex index 609e19b2..d319f8d4 100644 --- a/lib/towerops/gaiia/inventory_creator.ex +++ b/lib/towerops/gaiia/inventory_creator.ex @@ -206,8 +206,8 @@ defmodule Towerops.Gaiia.InventoryCreator do from(s in Towerops.Snmp.Interface, join: sd in SnmpDevice, on: s.snmp_device_id == sd.id, - where: sd.device_id == ^device.id and not is_nil(s.mac_address) and s.mac_address != "", - select: s.mac_address, + where: sd.device_id == ^device.id and not is_nil(s.if_phys_address) and s.if_phys_address != "", + select: s.if_phys_address, limit: 1 ) ) diff --git a/lib/towerops_web/live/org/gaiia_reconciliation_live.ex b/lib/towerops_web/live/org/gaiia_reconciliation_live.ex index a32bec46..7ec462b3 100644 --- a/lib/towerops_web/live/org/gaiia_reconciliation_live.ex +++ b/lib/towerops_web/live/org/gaiia_reconciliation_live.ex @@ -103,6 +103,10 @@ defmodule ToweropsWeb.Org.GaiiaReconciliationLive do {:noreply, socket} end + def handle_event("create_gaiia_item", %{"device_id" => _, "model_id" => ""}, socket) do + {:noreply, put_flash(socket, :warning, t("Please select a model."))} + end + def handle_event("create_gaiia_item", %{"device_id" => device_id, "model_id" => model_id}, socket) do org_id = socket.assigns.organization.id