mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 00:11:49 +02:00
Merge pull request #2211 from laf/issue-2200
Updated devices Graphs links to use non-static time references
This commit is contained in:
+2
-2
@@ -99,8 +99,8 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function submitCustomRange(frmdata) {
|
function submitCustomRange(frmdata) {
|
||||||
var reto = /to=([0-9])+/g;
|
var reto = /to=([0-9a-zA-Z\-])+/g;
|
||||||
var refrom = /from=([0-9])+/g;
|
var refrom = /from=([0-9a-zA-Z\-])+/g;
|
||||||
var tsto = moment(frmdata.dtpickerto.value).unix();
|
var tsto = moment(frmdata.dtpickerto.value).unix();
|
||||||
var tsfrom = moment(frmdata.dtpickerfrom.value).unix();
|
var tsfrom = moment(frmdata.dtpickerfrom.value).unix();
|
||||||
frmdata.selfaction.value = frmdata.selfaction.value.replace(reto, 'to=' + tsto);
|
frmdata.selfaction.value = frmdata.selfaction.value.replace(reto, 'to=' + tsto);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ foreach ($menu_options as $option => $text) {
|
|||||||
if ($vars['format'] == 'graph_'.$option) {
|
if ($vars['format'] == 'graph_'.$option) {
|
||||||
echo("<span class='pagemenu-selected'>");
|
echo("<span class='pagemenu-selected'>");
|
||||||
}
|
}
|
||||||
echo('<a href="' . generate_url($vars, array('format' => 'graph_'.$option, 'from' => $config['time']['day'], 'to' => $config['time']['now'])) . '">' . $text . '</a>');
|
echo('<a href="' . generate_url($vars, array('format' => 'graph_'.$option, 'from' => '-24h', 'to' => 'now')) . '">' . $text . '</a>');
|
||||||
if ($vars['format'] == 'graph_'.$option) {
|
if ($vars['format'] == 'graph_'.$option) {
|
||||||
echo("</span>");
|
echo("</span>");
|
||||||
}
|
}
|
||||||
@@ -91,13 +91,13 @@ list($format, $subformat) = explode("_", $vars['format'], 2);
|
|||||||
|
|
||||||
if($format == "graph") {
|
if($format == "graph") {
|
||||||
|
|
||||||
if (!is_numeric($vars['from'])) {
|
if (empty($vars['from'])) {
|
||||||
$graph_array['from'] = $config['time']['day'];
|
$graph_array['from'] = $config['time']['day'];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$graph_array['from'] = $vars['from'];
|
$graph_array['from'] = $vars['from'];
|
||||||
}
|
}
|
||||||
if (!is_numeric($vars['to'])) {
|
if (empty($vars['to'])) {
|
||||||
$graph_array['to'] = $config['time']['now'];
|
$graph_array['to'] = $config['time']['now'];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user