-- -- (C) 2013-24 - ntop.org -- 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 ui_utils = require "ui_utils" local graph_utils = require "graph_utils" local template = require "template_utils" local host_pools = require "host_pools" interface.select(ifname) local ifstats = interface.getStats() -- Instantiate host pools local host_pools_instance = host_pools:create() local base_url = ntop.getHttpPrefix().."/lua/if_stats.lua" local page_params = {} page_params.ifid = ifstats.id page_params.page = "pools" local devices_mode_filter = "" if not isEmptyString(_GET["unassigned_devices"]) then page_params.unassigned_devices = _GET["unassigned_devices"] devices_mode_filter = '' end if isAdministrator() and (_POST["member"] ~= nil) and (_POST["pool"] ~= nil) then -- change member pool host_pools_instance:bind_member(_POST["member"], _POST["pool"]) end print("

"..i18n("unknown_devices.unassigned_devices").."

") print( template.gen("modal_confirm_dialog.html", { dialog={ id = "assign_device_dialog", action = "assignDevicePool(mac_to_assign)", title = i18n("unknown_devices.assign_device_pool"), message = i18n("unknown_devices.select_pool", {mac=""}) .. '

', custom_alert_class = "", confirm = i18n("unknown_devices.assign_pool"), } }) ) local pools = host_pools_instance:get_num_pools() local no_pools = (pools < 2) local notes = { {content = i18n("unknown_devices.no_pools"), hidden = not no_pools}, {content = i18n("unknown_devices.devices_only_note")}, } print [[
]] print(ui_utils.render_notes(notes)) print[[ ]]