fix(gaiia): correct mac_address to if_phys_address in inventory_creator
Also guard against empty model_id form submission.
This commit is contained in:
parent
7067bc2fa9
commit
97910aa178
2 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue