-- -- (C) 2013-21 - ntop.org -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path require "lua_utils" local plugins_utils = require("plugins_utils") local user_scripts = require("user_scripts") local page_utils = require("page_utils") sendHTTPContentTypeHeader('text/html') page_utils.set_active_menu_entry(page_utils.menu_entries.plugins) dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") -- print[[
]] local ifid = interface.getId() local edition = _GET["edition"] or "" -- ####################################################### if(isAdministrator() and (_POST["action"] == "reload")) then plugins_utils.loadPlugins() user_scripts.loadDefaultConfig() end -- ####################################################### local function printPlugins() local plugins = plugins_utils.getLoadedPlugins() print[[]] for _, plugin in pairsByField(plugins, "title", asc) do local available = "" -- Availability if(plugin.edition == "enterprise_m") then available = "Enterprise M" if((edition ~= "") and (edition ~= "enterprise_m")) then goto skip end elseif(plugin.edition == "enterprise_l") then available = "Enterprise L" if((edition ~= "") and (edition ~= "enterprise_l")) then goto skip end elseif(plugin.edition == "pro") then available = "Pro" if((edition ~= "") and (edition ~= "pro")) then goto skip end else available = "Community" if((edition ~= "") and (edition ~= "community")) then goto skip end end print(string.format([[]], plugin.title, plugin.description, plugin.path, available)) ::skip:: end print[[
]] print(i18n("plugins_overview.plugin")) print[[]] print(i18n("show_alerts.alert_description")) print[[]] print(i18n("plugins_overview.source_location")) print[[]] print(i18n("availability")) print[[
%s%s%s%s
]] end -- ####################################################### print([[
]]) page_utils.print_page_title(i18n("plugins_overview.loaded_plugins")) print([[
]]) print[[
]] if isAdministrator() then print[[
]] end print("
") printPlugins() print([[ ]]) dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")