diff options
author | smos <seth.mos@dds.nl> | 2010-08-05 09:18:45 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2010-08-05 09:18:45 +0200 |
commit | 5bc838242b567687d39baeaf2321a35902220ff8 (patch) | |
tree | b3bfdd31b16a08ab732b1ed2aa01b2bfe7c5225f /usr | |
parent | fb95b3244ad91a974db84645f2fd3cdcb7d60eab (diff) | |
download | pfsense-5bc838242b567687d39baeaf2321a35902220ff8.zip pfsense-5bc838242b567687d39baeaf2321a35902220ff8.tar.gz |
Add 12 hour period starting from 8 in the morning. Thinking that would correspond better to human workdays.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/status_rrd_graph.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 97454c9..989269e 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -194,7 +194,7 @@ $ui_databases = array_merge($dbheader, $databases); $styles = array('inverse' => 'Inverse', 'absolute' => 'Absolute'); -$graphs = array("day", "week", "month", "quarter", "year", "4year"); +$graphs = array("12hour", "day", "week", "month", "quarter", "year", "4year"); $periods = array("current" => "Current Period", "previous" => "Previous Period"); $pgtitle = array("Status","RRD Graphs"); @@ -217,6 +217,18 @@ function get_dates($curperiod, $graph) { $offset = 0; } switch($graph) { + case "12hour": + switch($offset) { + case 0; + $houroffset = 0; + break; + default: + $houroffset = ($offset * 12) - 12; + break; + } + $start = mktime((8 + $houroffset), 0, 0, $curmonth, $curday, $curyear); + $end = mktime((8 + $houroffset) + 12, 0, 0, $curmonth, $curday, $curyear); + break; case "day": $start = mktime(0, 0, 0, $curmonth, ($curday + $offset), $curyear); $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear); |