mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-10 00:42:14 +00:00
- Show confirmation alert when trying to delete some item - Disable VLAN field for mac addresses in Host Pools and handle accordingly - Remove Host Pool id column - Remove Full Name user field minimum length restriction - Other fixes
38 lines
949 B
Lua
38 lines
949 B
Lua
--
|
|
-- (C) 2017 - ntop.org
|
|
--
|
|
|
|
dirs = ntop.getDirs()
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|
|
|
require "lua_utils"
|
|
local host_pools_utils = require "host_pools_utils"
|
|
local json = require "dkjson"
|
|
|
|
sendHTTPHeader('text/html; charset=iso-8859-1')
|
|
|
|
local ifid = _GET["ifid"]
|
|
local pool_id = _GET["pool"]
|
|
local res = {data={}, sort={{"column_", "asc"}}, totalRows=0}
|
|
|
|
if((ifid ~= nil) and (isAdministrator())) then
|
|
if pool_id ~= nil then
|
|
for _,member in ipairs(host_pools_utils.getPoolMembers(ifid, pool_id)) do
|
|
res.data[#res.data + 1] = {
|
|
column_member = member.address,
|
|
column_vlan = member.vlan,
|
|
}
|
|
end
|
|
else
|
|
for _,pool in ipairs(host_pools_utils.getPoolsList(ifid)) do
|
|
res.data[#res.data + 1] = {
|
|
column_pool_id = pool.id,
|
|
column_pool_name = pool.name,
|
|
}
|
|
end
|
|
end
|
|
end
|
|
|
|
res.totalRows = #res.data
|
|
|
|
return print(json.encode(res, nil, 1))
|