summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_rrd_graph.php
diff options
context:
space:
mode:
authorDarren Embry <dse@webonastick.com>2012-03-23 13:35:32 -0400
committerDarren Embry <dse@webonastick.com>2012-03-23 13:35:32 -0400
commitce49a7c9f2781bda704e4e561026b5e445ab1fcb (patch)
tree7f9e93f1b4a5e9b727ac1a53528c39302398731f /usr/local/www/status_rrd_graph.php
parentaacd203c5eee3c2560bf3eb8adb8f10601ecc6ef (diff)
downloadpfsense-ce49a7c9f2781bda704e4e561026b5e445ab1fcb.zip
pfsense-ce49a7c9f2781bda704e4e561026b5e445ab1fcb.tar.gz
Add date/time picker to Custom RRD graphs.
from: http://trentrichardson.com/examples/timepicker/
Diffstat (limited to 'usr/local/www/status_rrd_graph.php')
-rwxr-xr-xusr/local/www/status_rrd_graph.php31
1 files changed, 27 insertions, 4 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index 60d1cac..72a2a7b 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -242,7 +242,30 @@ $graph_length = array(
"4year" => 126489600);
$pgtitle = array(gettext("Status"),gettext("RRD Graphs"));
+
+$closehead = false;
include("head.inc");
+?>
+
+<?php if ($curcat === "custom") { ?>
+ <link rel="stylesheet" type="text/css" href="/javascript/jquery-ui-timepicker-addon/css/jquery-ui-timepicker-addon.css" />
+ <link rel="stylesheet" type="text/css" href="/javascript/jquery/jquery-ui.custom.css" />
+ <script type="text/javascript" src="/javascript/jquery-ui-timepicker-addon/js/jquery-ui-timepicker-addon.js"></script>
+ <script type="text/javascript">
+ jQuery(function ($) {
+ var options = {
+ dateFormat: 'mm/dd/yy',
+ timeFormat: 'hh:mm:ss',
+ showSecond: true
+ };
+ $("#startDateTime").datetimepicker(options);
+ $("#endDateTime").datetimepicker(options);
+ });
+ </script>
+ </head>
+<?php } ?>
+
+<?php
function get_dates($curperiod, $graph) {
global $graph_length;
@@ -480,13 +503,13 @@ function get_dates($curperiod, $graph) {
if($curcat == "custom") {
$tz = date_default_timezone_get();
$tz_msg = gettext("Enter date and/or time. Current timezone:") . " $tz";
- $start_fmt = strftime("%m/%d/%Y %H:%M:%S %Z", $start);
- $end_fmt = strftime("%m/%d/%Y %H:%M:%S %Z", $end);
+ $start_fmt = strftime("%m/%d/%Y %H:%M:%S", $start);
+ $end_fmt = strftime("%m/%d/%Y %H:%M:%S", $end);
?>
<?=gettext("Start:");?>
- <input title="<?= htmlentities($tz_msg); ?>." type="text" name="start" class="formfldunknown" size="32" length="32" value="<?= htmlentities($start_fmt); ?>">
+ <input id="startDateTime" title="<?= htmlentities($tz_msg); ?>." type="text" name="start" class="formfldunknown" size="24" length="32" value="<?= htmlentities($start_fmt); ?>">
<?=gettext("End:");?>
- <input title="<?= htmlentities($tz_msg); ?>." type="text" name="end" class="formfldunknown" size="32" length="32" value="<?= htmlentities($end_fmt); ?>">
+ <input id="endDateTime" title="<?= htmlentities($tz_msg); ?>." type="text" name="end" class="formfldunknown" size="24" length="32" value="<?= htmlentities($end_fmt); ?>">
<input type="submit" name="Submit" value="<?=gettext("Go"); ?>">
<?php
$curdatabase = $curoption;
OpenPOWER on IntegriCloud