Permalink
Browse files

Add duration variable to reduce result set

  • Loading branch information...
1 parent d1280eb commit de9fab080fc94acb07b7b7e32bd262f557084e26 @colinjonesx committed May 23, 2011
Showing with 6 additions and 3 deletions.
  1. +1 −0 web/css/main.css
  2. +5 −3 web/report.php
View
@@ -0,0 +1 @@
+ul.serverList li{cursor: pointer; list-style:none;}
View
@@ -9,8 +9,9 @@
$fileWrite = array();
$fileDelete = array();
+ $from = (isset($_GET['duration']) ? (microtime(true) * 1000) - $_GET['duration'] : 0;
- foreach($collection->find(array('server'=>$_GET['svr'])) as $obj){
+ foreach($collection->find(array('server'=>$_GET['svr'],'serverTime'=>array('$gt'=>$from)) as $obj){
$ts = $obj['serverTime'];
$mathCalcs[] = array($ts, $obj['mathCalcs']);
$fileCreate[] = array($ts, $obj['fileCreate']);
@@ -57,8 +58,9 @@
$(document).ready(function(){
$('ul.serverList li').click(function(e){
$(this).append('<img class="ajaxLoading" src="img/ajaxLoading.gif">');
- console.log('tot',$(e.currentTarget).text());
- $.get('report.php',{svr:$(e.currentTarget).text()},function(data, status, req){
+ //console.log('tot',$(e.currentTarget).text());
+ var duration = 7 * 24 * 3600 * 1000;
+ $.get('report.php',{duration:duration,svr:$(e.currentTarget).text()},function(data, status, req){
$('ul.serverList img.ajaxLoading').remove();
plotopts = {
legend:{position:'nw'},

0 comments on commit de9fab0

Please sign in to comment.