From e046455389f1030accf1341a6d75992c9b0a9447 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 5 Dec 2011 14:09:24 +0000 Subject: applications/luci-statistics: rework handling of index and detail graphs Instead of coding the display logic into the graph models, simply annotate graph models with .detail = true/false and let the renderer decide which to pick when. --- .../luci-statistics/luasrc/statistics/rrdtool.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'applications/luci-statistics/luasrc/statistics/rrdtool.lua') diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool.lua b/applications/luci-statistics/luasrc/statistics/rrdtool.lua index 871e055d9..b540dd15f 100644 --- a/applications/luci-statistics/luasrc/statistics/rrdtool.lua +++ b/applications/luci-statistics/luasrc/statistics/rrdtool.lua @@ -513,20 +513,20 @@ function Graph.render( self, plugin, plugin_instance, is_index ) -- get diagram definitions for i, opts in ipairs( self:_forcelol( def.rrdargs( self, plugin, plugin_instance, nil, is_index ) ) ) do + if not is_index or not opts.detail then + _images[i] = { } - _images[i] = { } + -- get diagram definition instances + local diagrams = self:_generic( opts, plugin, plugin_instance, nil, i ) - -- get diagram definition instances - local diagrams = self:_generic( opts, plugin, plugin_instance, nil, i ) + -- render all diagrams + for j, def in ipairs( diagrams ) do + -- remember image + _images[i][j] = def[1] - -- render all diagrams - for j, def in ipairs( diagrams ) do - - -- remember image - _images[i][j] = def[1] - - -- exec - self:_rrdtool( def ) + -- exec + self:_rrdtool( def ) + end end end -- cgit v1.2.3