Fix community chart default timeframe selection

Fixes #2582
This commit is contained in:
emanuele-f 2019-05-20 18:47:33 +02:00
parent 24066c48a3
commit a94f3422fb

View file

@ -585,7 +585,7 @@ function getMinZoomResolution(schema)
if schema_obj then
if schema_obj.options.step >= 300 then
return '10m'
return '30m'
elseif schema_obj.options.step >= 60 then
return '5m'
end
@ -612,8 +612,6 @@ function drawGraphs(ifid, schema, tags, zoomLevel, baseurl, selectedEpoch, optio
local debug_rrd = false
options = options or {}
if(zoomLevel == nil) then zoomLevel = "5m" end
if((selectedEpoch == nil) or (selectedEpoch == "")) then
-- Refresh the page every minute unless:
-- ** a specific epoch has been selected or
@ -644,15 +642,16 @@ print[[
</script>]]
end
local min_zoom = getMinZoomResolution(schema)
local min_zoom_k = 1
if(zoomLevel == nil) then zoomLevel = min_zoom end
if ntop.isPro() then
_ifstats = interface.getStats()
drawProGraph(ifid, schema, tags, zoomLevel, baseurl, options)
return
end
local min_zoom = getMinZoomResolution(schema)
local min_zoom_k = 1
nextZoomLevel = zoomLevel;
epoch = tonumber(selectedEpoch);