Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add duration variable to reduce result set

  • Loading branch information...
commit de9fab080fc94acb07b7b7e32bd262f557084e26 1 parent d1280eb
@colinjonesx authored
Showing with 6 additions and 3 deletions.
  1. +1 −0  web/css/main.css
  2. +5 −3 web/report.php
View
1  web/css/main.css
@@ -0,0 +1 @@
+ul.serverList li{cursor: pointer; list-style:none;}
View
8 web/report.php
@@ -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'},
Please sign in to comment.
Something went wrong with that request. Please try again.