mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add default from/to for a graph, allow negative from to subtract time from to/now
git-svn-id: http://www.observium.org/svn/observer/trunk@2905 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
$from = mres($_GET['from']);
|
||||
$to = mres($_GET['to']);
|
||||
$width = mres($_GET['width']);
|
||||
$height = mres($_GET['height']);
|
||||
$title = mres($_GET['title']);
|
||||
@@ -9,6 +7,11 @@ $vertical = mres($_GET['vertical']);
|
||||
$legend = mres($_GET['legend']);
|
||||
$id = mres($_GET['id']);
|
||||
|
||||
$from = (isset($_GET['from']) ? mres($_GET['from']) : time() - 60*60*24);
|
||||
$to = (isset($_GET['to']) ? mres($_GET['to']) : time());
|
||||
|
||||
if ($from < 0) { $from = $to + $from; }
|
||||
|
||||
$graphfile = $config['temp_dir'] . "/" . strgen() . ".png";
|
||||
|
||||
preg_match('/^(?P<type>[A-Za-z0-9]+)_(?P<subtype>.+)/', mres($_GET['type']), $graphtype);
|
||||
|
Reference in New Issue
Block a user