X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=applications%2Fluci-app-statistics%2Fluasrc%2Fstatistics%2Frrdtool.lua;h=5d4ad9859d0a1e39691fc80935f34a5b86df55e3;hb=854dd6691709cd3c3a628f2453fa4733bbe0875f;hp=dbcae9dc6be42c79701c4a61662c0b6deac719f4;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92;p=project%2Fluci.git diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua index dbcae9dc6..5d4ad9859 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua @@ -1,17 +1,5 @@ ---[[ - -Luci statistics - rrdtool interface library / diagram model interpreter -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ - -]]-- +-- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich +-- Licensed to the public under the Apache License 2.0. module("luci.statistics.rrdtool", package.seeall) @@ -409,6 +397,7 @@ function Graph._generic( self, opts, plugin, plugin_instance, dtype, index ) transform_rpn = dopts.transform_rpn or "0,+", noarea = dopts.noarea or false, title = dopts.title or nil, + weight = dopts.weight or nil, ds = dsource, type = dtype, instance = dinst, @@ -469,12 +458,24 @@ function Graph._generic( self, opts, plugin, plugin_instance, dtype, index ) _ti ( _args, "-X" ) _ti ( _args, opts.units_exponent ) end + if opts.alt_autoscale then + _ti ( _args, "-A" ) + end + if opts.alt_autoscale_max then + _ti ( _args, "-M" ) + end -- store additional rrd options if opts.rrdopts then for i, o in ipairs(opts.rrdopts) do _ti( _args, o ) end end + -- sort sources + table.sort(_sources, function(a, b) + local x = a.weight or a.index or 0 + local y = b.weight or b.index or 0 + return x < y + end) -- create DEF statements for each instance for i, source in ipairs(_sources) do