Fix NATS preferences and add message broker (#8221)

* Fix NATS preferences and add message broker.

* Fix on LuaEngineNtop
This commit is contained in:
Nicolò Maio 2024-02-23 19:57:39 +01:00 committed by GitHub
parent 77fb2a76c2
commit c443e03825
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 157 additions and 31 deletions

View file

@ -12,14 +12,18 @@ local hasClickHouse = hasClickHouseSupport()
local hasLdap = ntop.hasLdapSupport()
local max_nindex_retention = 0
local flow_db_utils = nil
local message_broker_api = nil
if ntop.isPro() or ntop.isnEdgeEnterprise() then
package.path = dirs.installdir .. "/scripts/lua/pro/modules/?.lua;" .. package.path
package.path = dirs.installdir .. "/scripts/lua/pro/enterprise/modules/?.lua;" .. package.path
if hasClickHouse then
flow_db_utils = require("flow_db_utils")
_, max_nindex_retention = flow_db_utils.getRetention()
end
message_broker_api = require "message_broker_api"
end
-- This table is used both to control access to the preferences and to filter preferences results
@ -306,7 +310,7 @@ local menu_subpages = {{
label = i18n("prefs.message_broker"),
advanced = false,
pro_only = false,
hidden = not (ntop.isEnterpriseM()) or true, -- TODO: correctly hide or show this preference
hidden = not (ntop.isEnterpriseM()) or not (message_broker_api and message_broker_api.checkStatus()),
entries = {
toggle_message_broker = {
title = i18n("prefs.toggle_message_broker_title"),