diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-05 14:09:24 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-05 14:09:24 +0000 |
commit | e046455389f1030accf1341a6d75992c9b0a9447 (patch) | |
tree | 45b2e4589a57df3f79356ef0fd2f755c56d8095c /applications/luci-statistics/luasrc/statistics/rrdtool.lua | |
parent | 239672e76b6005c300682f467be4855a8b7fe648 (diff) |
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.
Diffstat (limited to 'applications/luci-statistics/luasrc/statistics/rrdtool.lua')
-rw-r--r-- | applications/luci-statistics/luasrc/statistics/rrdtool.lua | 22 |
1 files changed, 11 insertions, 11 deletions
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 |