luci-app-statistics: rrdtool add canvas height option
authorFlorian Eckert <fe@dev.tdt.de>
Mon, 4 Mar 2019 15:07:11 +0000 (16:07 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 7 Mar 2019 14:14:11 +0000 (15:14 +0100)
Added configuration parameters to also configure the height of the rrd images.

config statistics 'rrdtool'
option image_height '200'

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-statistics/luasrc/statistics/rrdtool.lua

index b9f48a45bdf0f48f38aeb28b02fa45e5419ff357..f827e923099c6891b6a67e093ff46481898698b1 100644 (file)
@@ -26,6 +26,7 @@ function Graph.__init__( self, timespan, opts )
        opts.rramax    = opts.rramax    or ( sections.collectd_rrdtool.RRAMax == "1" )
        opts.host      = opts.host      or sections.collectd.Hostname        or sys.hostname()
        opts.width     = opts.width     or sections.rrdtool.image_width      or 400
+       opts.height    = opts.height    or sections.rrdtool.image_height     or 100
        opts.rrdpath   = opts.rrdpath   or sections.collectd_rrdtool.DataDir or "/tmp/rrd"
        opts.imgpath   = opts.imgpath   or sections.rrdtool.image_path       or "/tmp/rrdimg"
        opts.rrdpath   = opts.rrdpath:gsub("/$","")
@@ -40,7 +41,8 @@ function Graph.__init__( self, timespan, opts )
        self.args = {
                "-a", "PNG",
                "-s", "NOW-" .. opts.timespan,
-               "-w", opts.width
+               "-w", opts.width,
+               "-h", opts.height
        }
 
        -- store options