Simon Tiplady
Dabbler
- Joined
- Jun 19, 2015
- Messages
- 20
My system is not likely to change much on a minute by minute scale, so having the Reporting graphs default to "hourly" is not useful for me. An overview of daily or maybe even weekly could be more useful.
I know this update won't persist past system upgrades, but it's only 2 lines of code to change...
The file you need to change is /usr/local/www/freenasUI/static/lib/js/freeadmin/RRDControl.js
I used vi to edit the file and changed the default unit from "hourly" to "daily" (options are "hourly", "daily", "weekly", "monthly", "yearly"), you can find this near the top of the file, in my file it was on line 21.
(Ignore the line numbers in the code snippet above)
You also need to make the zoomIn button active, normally when the scale is set to hourly you can't zoom in any further, to fix this, go to line 44 and comment it out (add // to the start of the line), or remove it.
It might be nice to remember the last used value in a cookie and to use that value, maybe I'll do that another day...
I know this update won't persist past system upgrades, but it's only 2 lines of code to change...
The file you need to change is /usr/local/www/freenasUI/static/lib/js/freeadmin/RRDControl.js
I used vi to edit the file and changed the default unit from "hourly" to "daily" (options are "hourly", "daily", "weekly", "monthly", "yearly"), you can find this near the top of the file, in my file it was on line 21.
Code:
var RRDControl = declare("freeadmin.RRDControl", [ _Widget, _Templated ], { templateString : template, name : "", value: "", href: "", step: 0, unit: "weekly", // <-- Change this value
(Ignore the line numbers in the code snippet above)
You also need to make the zoomIn button active, normally when the scale is set to hourly you can't zoom in any further, to fix this, go to line 44 and comment it out (add // to the start of the line), or remove it.
Code:
zoomIn = new Button({ id: "rrd_" + me.name + "_zoomIn", label: this.zoomInButton.innerHTML, onClick: function(e) { var newunit = me.zoomInUnit(me.unit) if(newunit == me.unit || newunit == 'hourly') { zoomIn.set('disabled', true); } else { zoomOut.set('disabled', false); } me.unit = newunit; me.query(); }, //disabled: true, // delete or comment out this line }, this.zoomInButton);
It might be nice to remember the last used value in a cookie and to use that value, maybe I'll do that another day...