Set ntopng.prefs.beta_score redis key to enable score supprot (beta)

This commit is contained in:
Alfredo Cardigliano 2019-09-10 09:39:32 +02:00
parent 8637573838
commit 3fcded57fa
5 changed files with 21 additions and 10 deletions

View file

@ -10,6 +10,8 @@ local custom_column_utils = require "custom_column_utils"
local json = require "dkjson"
local have_nedge = ntop.isnEdge()
local debug_score = (ntop.getPref("ntopng.prefs.beta_score") == "1")
sendHTTPContentTypeHeader('text/html')
-- Table parameters
@ -294,8 +296,10 @@ for _key, _value in pairsByKeys(vals, funct) do
column_name = column_name .. " <i class='fa fa-ban fa-lg' title='"..i18n("hosts_stats.blocking_traffic_policy_popup_msg").."'></i>"
end
if(value["score"] > 0) then
column_name = column_name .. string.format(" [<b>score: %u</b>]", value["score"])
if debug_score then
if(value["score"] > 0) then
column_name = column_name .. string.format(" [<b>score: %u</b>]", value["score"])
end
end
record["column_name"] = column_name