diff options
author | Darren Embry <dse@webonastick.com> | 2012-04-19 14:27:36 -0400 |
---|---|---|
committer | Darren Embry <dse@webonastick.com> | 2012-04-19 14:27:36 -0400 |
commit | 3a83296fe42cadda6c982ceff18c04d20c826b08 (patch) | |
tree | 0ed769e42a12d3317c31f76634ec524eff6e521a | |
parent | 76e91d3ffee70fc047c64b6c9360df1e8eeffb9a (diff) | |
download | pfsense-3a83296fe42cadda6c982ceff18c04d20c826b08.zip pfsense-3a83296fe42cadda6c982ceff18c04d20c826b08.tar.gz |
fix for Bug #2334 quality rrd graphs do not automatically refresh
id attributes can't have a period, someone didn't read w3c specs on id attributes ;-)
-rwxr-xr-x | usr/local/www/status_rrd_graph.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 0e6e0cf..ab3fe9c 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -519,9 +519,12 @@ function get_dates($curperiod, $graph) { $curdatabase = $curoption; $graph = "custom-$curdatabase"; if(in_array($curdatabase, $custom_databases)) { + $id = "{$graph}-{$curoption}-{$curdatabase}"; + $id = preg_replace('/\./', '_', $id); + echo "<tr><td colspan=2 class=\"list\">\n"; - echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' "; - echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" "; + echo "<IMG BORDER='0' name='{$id}' "; + echo "id='{$id}' ALT=\"$prettydb Graph\" "; echo "SRC=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n"; echo "<br /><hr><br />\n"; echo "</td></tr>\n"; @@ -579,12 +582,15 @@ function get_dates($curperiod, $graph) { } } if(in_array($curdatabase, $ui_databases)) { + $id = "{$graph}-{$curoption}-{$curdatabase}"; + $id = preg_replace('/\./', '_', $id); + $dates = get_dates($curperiod, $graph); $start = $dates['start']; $end = $dates['end']; echo "<tr><td colspan=2 class=\"list\">\n"; - echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' "; - echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" "; + echo "<IMG BORDER='0' name='{$id}' "; + echo "id='{$id}' ALT=\"$prettydb Graph\" "; echo "SRC=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n"; echo "<br /><hr><br />\n"; echo "</td></tr>\n"; @@ -658,8 +664,11 @@ function get_dates($curperiod, $graph) { $end = $dates['end']; } /* generate update events utilizing jQuery('') feature */ + $id = "{$graph}-{$curoption}-{$curdatabase}"; + $id = preg_replace('/\./', '_', $id); + echo "\n"; - echo "\t\tjQuery('#{$graph}-{$curoption}-{$curdatabase}').attr('src','status_rrd_graph_img.php?start={$start}&graph={$graph}&database={$curdatabase}&style={$curstyle}&tmp=' + randomid);\n"; + echo "\t\tjQuery('#{$id}').attr('src','status_rrd_graph_img.php?start={$start}&graph={$graph}&database={$curdatabase}&style={$curstyle}&tmp=' + randomid);\n"; } } ?> |