{# (C) 2020 - ntop.org Defined fields: * hook_name: contains the name for the current rendered hook * hook_conf: contains the configuration for the current rendered hook * user_script: contains data about the loaded user script #} {% local displaying_value local selected_measure local min_duration = tonumber(hook_conf.script_conf.min_duration) local measure = { minutes = {min = 1, max = 59, multiplier = 60, key = "minutes"}, hours = {min = 1, max = 23, multiplier = 3600, key = "hours"}, days = {min = 1, max = 365, multiplier = 86400, key = "seconds"} } if min_duration < 3600 then selected_measure = measure.minutes elseif min_duration >= 3600 and min_duration < 86400 then selected_measure = measure.hours else selected_measure = measure.days end displaying_value = min_duration / selected_measure.multiplier %}