Fixes missing mac filter (#9099)

This commit is contained in:
Matteo Biscosi 2025-04-03 08:49:25 +02:00
parent dd19e209f0
commit 55c1f82308
4 changed files with 48 additions and 2 deletions

View file

@ -87,6 +87,10 @@ if isEmptyString(device_ip) then
device_ip = nil
end
if isEmptyString(mac) then
mac = nil
end
local rsp = {}
local mapping_column_lua_c = {

View file

@ -12,6 +12,7 @@ require "lua_utils_get"
local rest_utils = require "rest_utils"
local rsp = {}
local country = _GET["country"]
local mac = _GET["mac"]
local asn = _GET["asn"]
local ip_version_filters = {{
@ -345,4 +346,23 @@ if (not isEmptyString(asn)) then
}
end
local mac_filter = {{
key = "mac",
value = "",
label = i18n("all")
}, {
key = "mac",
value = mac,
label = mac
}}
if (not isEmptyString(mac)) then
rsp[#rsp + 1] = {
action = "mac",
label = i18n("mac_address"),
name = "mac",
value = mac_filter
}
end
rest_utils.answer(rest_utils.consts.success.ok, rsp)