mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix graphs without from or to, also my days only have 24 hours
git-svn-id: http://www.observium.org/svn/observer/trunk@2515 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -13,8 +13,8 @@ if($_SESSION['widescreen'])
|
|||||||
$thumb_width=113;
|
$thumb_width=113;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_numeric($vars['from'])) { $from = $vars['from']; } else { $from = $config['time']['day']; }
|
if (!is_numeric($vars['from'])) { $vars['from'] = $config['time']['day']; }
|
||||||
if (is_numeric($vars['to'])) { $to = $vars['to']; } else { $to = $config['time']['now']; }
|
if (!is_numeric($vars['to'])) { $vars['to'] = $config['time']['now']; }
|
||||||
|
|
||||||
preg_match('/^(?P<type>[A-Za-z0-9]+)_(?P<subtype>.+)/', mres($vars['type']), $graphtype);
|
preg_match('/^(?P<type>[A-Za-z0-9]+)_(?P<subtype>.+)/', mres($vars['type']), $graphtype);
|
||||||
|
|
||||||
@@ -52,13 +52,12 @@ if (!$auth)
|
|||||||
|
|
||||||
echo("<div style='margin: auto;'>");
|
echo("<div style='margin: auto;'>");
|
||||||
|
|
||||||
$thumb_array = array('sixhour' => '6 Hours', 'day' => '25 Hours', 'twoday' => '48 Hours', 'week' => 'One Week', 'twoweek' => 'Two Weeks',
|
$thumb_array = array('sixhour' => '6 Hours', 'day' => '24 Hours', 'twoday' => '48 Hours', 'week' => 'One Week', 'twoweek' => 'Two Weeks',
|
||||||
'month' => 'One Month', 'twomonth' => 'Two Months','year' => 'One Year', 'twoyear' => 'Two Years');
|
'month' => 'One Month', 'twomonth' => 'Two Months','year' => 'One Year', 'twoyear' => 'Two Years');
|
||||||
|
|
||||||
|
|
||||||
foreach ($thumb_array as $period => $text)
|
foreach ($thumb_array as $period => $text)
|
||||||
{
|
{
|
||||||
|
|
||||||
$graph_array['from'] = $config['time'][$period];
|
$graph_array['from'] = $config['time'][$period];
|
||||||
|
|
||||||
$link_array = $vars;
|
$link_array = $vars;
|
||||||
@@ -80,7 +79,7 @@ if (!$auth)
|
|||||||
|
|
||||||
$graph_array['height'] = "300";
|
$graph_array['height'] = "300";
|
||||||
$graph_array['width'] = $graph_width;
|
$graph_array['width'] = $graph_width;
|
||||||
|
|
||||||
echo generate_graph_js_state($graph_array);
|
echo generate_graph_js_state($graph_array);
|
||||||
|
|
||||||
echo("<div style='width: ".$graph_array['width']."; margin: auto;'>");
|
echo("<div style='width: ".$graph_array['width']."; margin: auto;'>");
|
||||||
|
Reference in New Issue
Block a user