add to pool shortcut for interface and local network (#4093)

This commit is contained in:
gabryon99 2020-10-16 18:02:22 +02:00
parent 4608c52596
commit d9bba4b4b2
4 changed files with 75 additions and 1 deletions

View file

@ -20,6 +20,9 @@ local format_utils = require "format_utils"
local top_talkers_utils = require "top_talkers_utils"
local internals_utils = require "internals_utils"
local page_utils = require("page_utils")
local ui_utils = require("ui_utils")
local interface_pools = require ("interface_pools")
require "lua_utils"
require "prefs_utils"
@ -31,6 +34,7 @@ local recording_utils = require "recording_utils"
local companion_interface_utils = require "companion_interface_utils"
local storage_utils = require "storage_utils"
local have_nedge = ntop.isnEdge()
if ntop.isPro() then
@ -1411,6 +1415,7 @@ elseif(page == "config") then
return
end
local interface_pools_instance = interface_pools:create()
local messages = {}
-- Flow dump check
@ -1434,6 +1439,13 @@ elseif(page == "config") then
end
end
if _SERVER["REQUEST_METHOD"] == "POST" then
-- bind interface to pool
if (_POST["pool"]) then
interface_pools_instance:bind_member(ifid, tonumber(_POST["pool"]))
end
end
if not table.empty(messages) then
printMessageBanners(messages)
print("<br>")
@ -1460,6 +1472,16 @@ elseif(page == "config") then
</td>
</tr>]]
-- Interface Pool
print([[
<tr>
<th>]].. i18n("pools.pool") ..[[</th>
<td>
]].. ui_utils.render_pools_dropdown(interface_pools_instance, ifid, "interface") ..[[
</td>
</tr>
]])
-- Interface speed
if not have_nedge then
print[[