Skip to content

Commit

Permalink
Merge pull request ganglia#38 from pcpiela/master
Browse files Browse the repository at this point in the history
Minor updates
  • Loading branch information
vvuksan committed Jul 7, 2011
2 parents 24bc99c + db0a458 commit 85039f9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
24 changes: 21 additions & 3 deletions ganglia-web/aggregate_graphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
$("#hreg").val());
});
$("#vl").change(function() {
$.cookie("ganglia-aggregate-graph-vl" + window.name,
$("#vl").val());
});
$("#title").change(function() {
$.cookie("ganglia-aggregate-graph-title" + window.name,
$("#title").val());
});
$("#aggregate_graph_table_form input[name=gtype]").change(function() {
$.cookie("ganglia-aggregate-graph-gtype" + window.name,
$("#aggregate_graph_table_form input[name=gtype]:checked").val());
Expand All @@ -30,6 +40,14 @@ function restoreAggregateGraph() {
var metric = $.cookie("ganglia-aggregate-graph-metric" + window.name);
if (metric != null)
$("#metric_chooser").val(metric);
var title = $.cookie("ganglia-aggregate-graph-title" + window.name);
if (title != null)
$("#title").val(title);
var vl = $.cookie("ganglia-aggregate-graph-vl" + window.name);
if (vl != null)
$("#vl").val(vl);
if (hreg != null && gtype != null && metric != null)
return true;
Expand Down Expand Up @@ -67,18 +85,18 @@ function createAggregateGraph() {
<table id="aggregate_graph_table_form">
<tr>
<td>Title:</td>
<td colspan=2><input name="title" id="title" value="" size=50></td>
<td colspan=2><input name="title" id="title" value="" size=60></td>
</tr>
<tr>
<td>Vertical (Y-Axis) label:</td>
<td colspan=2><input name="vl" id="vl" value="" size=50></td>
<td colspan=2><input name="vl" id="vl" value="" size=60></td>
</tr>
<tr>
<td>Host Regular expression e.g. web-[0,4], web or (web|db):</td>
<td colspan=2><input name="hreg[]" id="hreg" size=60></td>
</tr>
<tr><td>Metric Regular expression (not a report e.g. load_one, bytes_(in|out)):</td>
<td colspan=2><input name="mreg[]" id="metric_chooser"></td>
<td colspan=2><input name="mreg[]" id="metric_chooser" size=60></td>
</tr>
<tr>
<td>Graph Type:</td><td>
Expand Down
4 changes: 2 additions & 2 deletions ganglia-web/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,14 @@
{
$examples = "Feb 27 2007 00:00, 2/27/2007, 27.2.2007, now -1 week,"
. " -2 days, start + 1 hour, etc.";
$custom_time = "&nbsp;&nbsp;or from <INPUT TYPE=\"TEXT\" TITLE=\"$examples\" NAME=\"cs\" ID=\"datepicker-cs\" SIZE=\"17\"";
$custom_time = "&nbsp;&nbsp;or <span class=\"nobr\">from <INPUT TYPE=\"TEXT\" TITLE=\"$examples\" NAME=\"cs\" ID=\"datepicker-cs\" SIZE=\"17\"";
if ($cs)
$custom_time .= " value=\"$cs\"";
$custom_time .= "> to <INPUT TYPE=\"TEXT\" TITLE=\"$examples\" NAME=\"ce\" ID=\"datepicker-ce\" SIZE=\"17\"";
if ($ce)
$custom_time .= " value=\"$ce\"";
$custom_time .= "> <input type=\"submit\" value=\"Go\">\n";
$custom_time .= "<input type=\"button\" value=\"Clear\" onclick=\"ganglia_submit(1)\">\n";
$custom_time .= "<input type=\"button\" value=\"Clear\" onclick=\"ganglia_submit(1)\"></span>\n";
# $custom_time .= $calendar;
$data->assign("custom_time", $custom_time);

Expand Down
10 changes: 8 additions & 2 deletions ganglia-web/templates/default/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@
paddingBottom: 50,
}, defaults));
function rrdDateTimeString(date) {
return (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear() + " " + date.getHours() + ":" + date.getMinutes();
}
function setStartAndEnd(startTime, endTime) {
$("#datepicker-cs").val(Math.floor(startTime));
$("#datepicker-ce").val(Math.floor(endTime));
var date = new Date(Math.floor(startTime) * 1000);
$("#datepicker-cs").val(rrdDateTimeString(date));
date = new Date(Math.floor(endTime) * 1000);
$("#datepicker-ce").val(rrdDateTimeString(date));
}
});
Expand Down

0 comments on commit 85039f9

Please sign in to comment.