luci-app-statistics: adjust graph size fallback to defaults
authorHannu Nyman <hannu.nyman@iki.fi>
Wed, 10 Nov 2021 20:27:43 +0000 (22:27 +0200)
committerHannu Nyman <hannu.nyman@iki.fi>
Wed, 10 Nov 2021 20:27:43 +0000 (22:27 +0200)
Adjust the fallback timespan and graph width to the current config
defaults. (The default width in /etc/config/luci_statistics has been
600 already since commit 7ab8b51bd in March 2010.)

Expose the graph height in the config file and
increase it from 100 to 150 to keep the original aspect ratio.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js
applications/luci-app-statistics/root/etc/config/luci_statistics

index 19e34e4bc6eae6652ce51117d3a52db7451b27b1..0e8414ff2f5ce4825ce1022dbda5f71a7acd3ad3 100644 (file)
@@ -149,9 +149,9 @@ return baseclass.extend({
                            hostname = data[1];
 
                        this.opts.host      = uci.get('luci_statistics', 'collectd', 'Hostname')        || hostname;
-                       this.opts.timespan  = uci.get('luci_statistics', 'rrdtool', 'default_timespan') || 900;
-                       this.opts.width     = uci.get('luci_statistics', 'rrdtool', 'image_width')      || 400;
-                       this.opts.height    = uci.get('luci_statistics', 'rrdtool', 'image_height')     || 100;
+                       this.opts.timespan  = uci.get('luci_statistics', 'rrdtool', 'default_timespan') || 3600;
+                       this.opts.width     = uci.get('luci_statistics', 'rrdtool', 'image_width')      || 600;
+                       this.opts.height    = uci.get('luci_statistics', 'rrdtool', 'image_height')     || 150;
                        this.opts.rrdpath   = (uci.get('luci_statistics', 'collectd_rrdtool', 'DataDir') || '/tmp/rrd').replace(/\/$/, '');
                        this.opts.rrasingle = (uci.get('luci_statistics', 'collectd_rrdtool', 'RRASingle') == '1');
                        this.opts.rramax    = (uci.get('luci_statistics', 'collectd_rrdtool', 'RRAMax') == '1');
index 581a1f5a2c8fb04f54ea15e57662deefd9a5051b..7ed2c5c1901122f0c4fc007d2a7357560eea84f3 100644 (file)
@@ -12,6 +12,7 @@ config statistics 'collectd'
 config statistics 'rrdtool'
        option default_timespan '1hour'
        option image_width '600'
+       option image_height '150'
        option image_path '/tmp/rrdimg'
 
 # output plugins