-- -- (C) 2013-26 - ntop.org -- -- -- NOTE: see scripts/lua/modules/prefs_menu.lua for displaying -- or hidign menu entries -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path package.path = dirs.installdir .. "/scripts/lua/modules/timeseries/drivers/?.lua;" .. package.path -- for influxdb if ((dirs.scriptdir ~= nil) and (dirs.scriptdir ~= "")) then package.path = dirs.scriptdir .. "/lua/modules/?.lua;" .. package.path end require "lua_utils" require "prefs_utils" local template = require "template_utils" local recording_utils = require "recording_utils" local data_retention_utils = require "data_retention_utils" local page_utils = require("page_utils") local ts_utils = require("ts_utils") local influxdb = require("influxdb") local script_manager = require("script_manager") local info = ntop.getInfo() local auth = require "auth" local prefs = ntop.getPrefs() local email_peer_pattern = [[^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*)$]] sendHTTPContentTypeHeader('text/html') local alerts_disabled = false local product = ntop.getInfo().product local message_info = "" local message_severity = "alert-warning" -- ########################################### local function create_table(title) print('
]] end -- ================================================================================ function printLLMProviders() create_table() local default_anthropic_url = "https://api.anthropic.com/v1/" local default_anthropic_model = "claude-opus-4-5" local default_openai_url = "https://api.openai.com/v1/" local default_openai_model = "gpt-4o" local default_local_llm_url = "http://localhost:11434/v1/" local default_local_llm_model = "Qwen3.5-9B" -- Local LLM add_section(i18n("prefs.llm_local")) prefsInputFieldPrefs(subpage_active.entries["local_llm_url"].title, subpage_active.entries["local_llm_url"].description, "ntopng.prefs.llm", "local_llm_url", default_local_llm_url, "text", true, true, true, { attributes = { spellcheck = "false", maxlength = 255 } }) prefsInputFieldPrefs(subpage_active.entries["local_llm_token"].title, subpage_active.entries["local_llm_token"].description, "ntopng.prefs.llm", "local_llm_token", "", "password", true, true, false, { attributes = { spellcheck = "false", maxlength = 255 } }) prefsInputFieldPrefs(subpage_active.entries["local_llm_model"].title, subpage_active.entries["local_llm_model"].description, "ntopng.prefs.llm", "local_llm_model", default_local_llm_model, "text", true, false, false, { attributes = { spellcheck = "false", maxlength = 128 } }) -- Anthropic add_section(i18n("prefs.llm_anthropic")) prefsInputFieldPrefs(subpage_active.entries["anthropic_url"].title, subpage_active.entries["anthropic_url"].description, "ntopng.prefs.llm", "anthropic_url", default_anthropic_url, "text", true, true, true, { attributes = { spellcheck = "false", maxlength = 255 } }) prefsInputFieldPrefs(subpage_active.entries["anthropic_token"].title, subpage_active.entries["anthropic_token"].description, "ntopng.prefs.llm", "anthropic_token", "", "password", true, true, false, { attributes = { spellcheck = "false", maxlength = 255 } }) prefsInputFieldPrefs(subpage_active.entries["anthropic_model"].title, subpage_active.entries["anthropic_model"].description, "ntopng.prefs.llm", "anthropic_model", default_anthropic_model, "text", true, false, false, { attributes = { spellcheck = "false", maxlength = 128 } }) -- OpenAI add_section(i18n("prefs.llm_openai")) prefsInputFieldPrefs(subpage_active.entries["openai_url"].title, subpage_active.entries["openai_url"].description, "ntopng.prefs.llm", "openai_url", default_openai_url, "text", true, true, true, { attributes = { spellcheck = "false", maxlength = 255 } }) prefsInputFieldPrefs(subpage_active.entries["openai_token"].title, subpage_active.entries["openai_token"].description, "ntopng.prefs.llm", "openai_token", "", "password", true, true, false, { attributes = { spellcheck = "false", maxlength = 255 } }) prefsInputFieldPrefs(subpage_active.entries["openai_model"].title, subpage_active.entries["openai_model"].description, "ntopng.prefs.llm", "openai_model", default_openai_model, "text", true, false, false, { attributes = { spellcheck = "false", maxlength = 128 } }) end_table() end -- ================================================================================ function printActiveMonitoring() print(' ]] end function printAlerts() print(' ]] end -- ================================================================================ function printProtocolPrefs() print(' ]] end -- ================================================================================ function printNetworkDiscovery() print(']] end -- ================================================================================ function printNotifications() print(' ]] end -- ================================================================================ function printTelemetry() print(' ]] end -- ================================================================================ function printRecording() print(']] end -- ================================================================================ -- ##################### local function printMenuEntriesPrefs() if ntop.isEnterpriseM() then print('