From 12cd422702bc6294e68a2c93f21171ca9a8a410a Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 26 Oct 2015 19:49:30 +0000 Subject: [PATCH 1/2] Updated devices Graphs links to use non-static time references --- html/js/librenms.js | 4 ++-- html/pages/devices.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/html/js/librenms.js b/html/js/librenms.js index 05e5fc471..576362bc6 100644 --- a/html/js/librenms.js +++ b/html/js/librenms.js @@ -99,8 +99,8 @@ $(document).ready(function() { }); function submitCustomRange(frmdata) { - var reto = /to=([0-9])+/g; - var refrom = /from=([0-9])+/g; + var reto = /to=([0-9a-zA-Z\-])+/g; + var refrom = /from=([0-9a-zA-Z\-])+/g; var tsto = moment(frmdata.dtpickerto.value).unix(); var tsfrom = moment(frmdata.dtpickerfrom.value).unix(); frmdata.selfaction.value = frmdata.selfaction.value.replace(reto, 'to=' + tsto); diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php index 2e9c53815..5692a283f 100644 --- a/html/pages/devices.inc.php +++ b/html/pages/devices.inc.php @@ -51,7 +51,7 @@ foreach ($menu_options as $option => $text) { if ($vars['format'] == 'graph_'.$option) { echo(""); } - echo('' . $text . ''); + echo('' . $text . ''); if ($vars['format'] == 'graph_'.$option) { echo(""); } From 7775d6d07e0e8155cd7844e26fe8542948dd2651 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 26 Oct 2015 20:43:14 +0000 Subject: [PATCH 2/2] Changed from is_numeric to empty as variables can now contain non-numeric --- html/pages/devices.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php index 5692a283f..10b000fcc 100644 --- a/html/pages/devices.inc.php +++ b/html/pages/devices.inc.php @@ -91,13 +91,13 @@ list($format, $subformat) = explode("_", $vars['format'], 2); if($format == "graph") { - if (!is_numeric($vars['from'])) { + if (empty($vars['from'])) { $graph_array['from'] = $config['time']['day']; } else { $graph_array['from'] = $vars['from']; } - if (!is_numeric($vars['to'])) { + if (empty($vars['to'])) { $graph_array['to'] = $config['time']['now']; } else {