mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Support relative time for graphs again (#10359)
This commit is contained in:
@@ -55,7 +55,7 @@ foreach ($menu_options as $option => $text) {
|
||||
if ($vars['format'] == 'graph_' . $option) {
|
||||
$listoptions .= '<span class="pagemenu-selected">';
|
||||
}
|
||||
$listoptions .= '<a href="' . generate_url($vars, array('format' => 'graph_' . $option, 'from' => '-24h', 'to' => 'now')) . '">' . $text . '</a>';
|
||||
$listoptions .= '<a href="' . generate_url($vars, array('format' => 'graph_' . $option, 'from' => '-24hour', 'to' => 'now')) . '">' . $text . '</a>';
|
||||
if ($vars['format'] == 'graph_' . $option) {
|
||||
$listoptions .= '</span>';
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ if (session('widescreen')) {
|
||||
}
|
||||
|
||||
if (!is_numeric($vars['from'])) {
|
||||
$vars['from'] = $config['time']['day'];
|
||||
$vars['from'] = strtotime($vars['from']) ?: Config::get('time.day');
|
||||
}
|
||||
if (!is_numeric($vars['to'])) {
|
||||
$vars['to'] = $config['time']['now'];
|
||||
$vars['to'] = strtotime($vars['to']) ?: Config::get('time.now');
|
||||
}
|
||||
|
||||
preg_match('/^(?P<type>[A-Za-z0-9]+)_(?P<subtype>.+)/', $vars['type'], $graphtype);
|
||||
|
||||
Reference in New Issue
Block a user