mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Reworks get_pool_data.lua to use the new host pools lua class
This commit is contained in:
parent
7b106473d4
commit
ca6bd55132
2 changed files with 41 additions and 3 deletions
|
|
@ -4,8 +4,9 @@
|
|||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/pools/?.lua;" .. package.path
|
||||
require "lua_utils"
|
||||
local host_pools_utils = require "host_pools_utils"
|
||||
local host_pools = require "host_pools"
|
||||
local json = require("dkjson")
|
||||
|
||||
sendHTTPContentTypeHeader('text/html')
|
||||
|
|
@ -14,11 +15,14 @@ sendHTTPContentTypeHeader('text/html')
|
|||
|
||||
local pool = tonumber(_GET["pool"])
|
||||
|
||||
-- Instantiate host pools
|
||||
local host_pools_instance = host_pools:create()
|
||||
|
||||
local n = interface.getHostPoolStats(pool)
|
||||
local res = {}
|
||||
|
||||
for k, v in pairs(n) do
|
||||
res = host_pools_utils.hostpool2record(interface.getId(), k, v)
|
||||
res = host_pools_instance:hostpool2record(interface.getId(), k, v)
|
||||
break
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue