Hide Layer-7 settings when traffic setting is off

Closes #1455
This commit is contained in:
emanuele-f 2017-09-19 15:06:00 +02:00
parent fe67dc9e4f
commit c95032d655

View file

@ -742,9 +742,11 @@ function printStatsTimeseries()
field = "toggle_interface_traffic_rrd_creation",
default = "1",
pref = "interface_rrd_creation",
to_switch = elementToSwitch,
to_switch = {"row_interfaces_ndpi_timeseries_creation"},
})
local showElement = ntop.getPref("ntopng.prefs.interface_rrd_creation") == "1"
retVal = multipleTableButtonPrefs(subpage_active.entries["toggle_ndpi_timeseries_creation"].title,
subpage_active.entries["toggle_ndpi_timeseries_creation"].description,
l7_rrd_labels, l7_rrd_values,
@ -752,7 +754,7 @@ function printStatsTimeseries()
"primary",
"interfaces_ndpi_timeseries_creation",
"ntopng.prefs.interface_ndpi_timeseries_creation", nil,
elementToSwitch, showElementArray, javascriptAfterSwitch)
elementToSwitch, showElementArray, javascriptAfterSwitch, showElement)
print('<tr><th colspan=2 class="info">'..i18n('prefs.local_hosts_timeseries')..'</th></tr>')
@ -768,9 +770,11 @@ function printStatsTimeseries()
field = "toggle_local_hosts_traffic_rrd_creation",
default = "1",
pref = "host_rrd_creation",
to_switch = elementToSwitch,
to_switch = {"row_hosts_ndpi_timeseries_creation"},
})
local showElement = ntop.getPref("ntopng.prefs.host_rrd_creation") == "1"
retVal = multipleTableButtonPrefs(subpage_active.entries["toggle_ndpi_timeseries_creation"].title,
subpage_active.entries["toggle_ndpi_timeseries_creation"].description,
l7_rrd_labels, l7_rrd_values,
@ -778,7 +782,7 @@ function printStatsTimeseries()
"primary",
"hosts_ndpi_timeseries_creation",
"ntopng.prefs.host_ndpi_timeseries_creation", nil,
elementToSwitch, showElementArray, javascriptAfterSwitch)
elementToSwitch, showElementArray, javascriptAfterSwitch, showElement)
print('<tr><th colspan=2 class="info">'..i18n('prefs.other_timeseries')..'</th></tr>')