Repository: airavata-php-gateway Updated Branches: refs/heads/master 7c163da30 -> e13b10591
1) Bug Fixes to theme pages links. 2) Added functionality to check experiment statistics in a) Last 24 hours b) Last week 3) Removed Title Tag from fixed PGA header 4) Code Improvements Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/1f6c86d8 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/1f6c86d8 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/1f6c86d8 Branch: refs/heads/master Commit: 1f6c86d8644921a61ef2ab6531d45c4f9501fff6 Parents: 09d1456 Author: Nipurn Doshi <[email protected]> Authored: Tue Oct 27 14:13:38 2015 -0400 Committer: Nipurn Doshi <[email protected]> Committed: Tue Oct 27 14:13:38 2015 -0400 ---------------------------------------------------------------------- app/routes.php | 2 +- app/views/admin/manage-experiments.blade.php | 61 ++++++++++++++++++++--- app/views/layout/fixed-header.blade.php | 2 + app/views/partials/experiment-info.blade.php | 15 +++--- 4 files changed, 64 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1f6c86d8/app/routes.php ---------------------------------------------------------------------- diff --git a/app/routes.php b/app/routes.php index 21d757c..4a4f418 100755 --- a/app/routes.php +++ b/app/routes.php @@ -219,7 +219,7 @@ Route::get( "pages/{theme_view}", function( $theme_view){ //In some cases, theme doesn't get loaded in session, so doing that here //as well incase it does not. if(! Session::has("theme")){ - Session::put("theme", Config::get('pga_config.theme')['name']); + Session::put("theme", Config::get('pga_config.portal')['theme']); } return View::make("pages", array("page" => $theme_view) ); }); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1f6c86d8/app/views/admin/manage-experiments.blade.php ---------------------------------------------------------------------- diff --git a/app/views/admin/manage-experiments.blade.php b/app/views/admin/manage-experiments.blade.php index dc82a92..482d4c9 100644 --- a/app/views/admin/manage-experiments.blade.php +++ b/app/views/admin/manage-experiments.blade.php @@ -43,12 +43,23 @@ <div class="dates row"> <div class="well col-md-12"> - <div class="col-md-12"> - <h4>Select dates between which you want to review experiment statistics.</h4> - </div> <div class="col-md-10"> <div class='col-md-5'> <div class="form-group"> + <input type='button' class="oneDayExp form-control btn-primary" value="Get Experiments from Last 24 hours"/> + </div> + </div> + <div class='col-md-5'> + <div class="form-group"> + <input type='button' class="oneWeekExp form-control btn-primary" value="Get Experiments from Last Week"/> + </div> + </div> + + <div class="col-md-12"> + <h4>Or Select dates between which you want to review experiment statistics.</h4> + </div> + <div class='col-md-5'> + <div class="form-group"> <div class='input-group date' id='datetimepicker9'> <input type='text' class="form-control" placeholder="From Date" name="from-date"/> <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span> @@ -66,7 +77,7 @@ </div> </div> <div class="col-md-2"> - <button name="getStatistics" id="getStatistics" type="submit" class="btn btn-primary pull-right" + <button name="getStatistics" id="getStatistics" type="submit" class="btn btn-primary" value="GetStatistics"><span class="glyphicon glyphicon-search"></span> Get Statistics </button> @@ -372,6 +383,18 @@ to be uncommented when actually in use. $('#datetimepicker9').data("DateTimePicker").setMaxDate(e.date); }); + $(".oneDayExp").click( function(){ + var todayDate = getCurrentDate(); + var ydayDate = getCurrentDate(1); + getExperiments( ydayDate, todayDate); + }); + + $(".oneWeekExp").click( function(){ + var todayDate = getCurrentDate(); + var ydayDate = getCurrentDate(7); + getExperiments( ydayDate, todayDate); + }) + $("#getStatistics").click(function () { $fromTime = $("#datetimepicker9").find("input").val(); $fromTime = moment($fromTime).utc().format('MM/DD/YYYY hh:mm a'); @@ -380,9 +403,15 @@ to be uncommented when actually in use. if ($fromTime == '' || $toTime == '') { alert("Please Select Valid Date Inputs!"); } else { - $(".loading-img-statistics").removeClass("hide"); + getExperiments( $fromTime, $toTime); + } + }); + + function getExperiments( startTime, endTime){ + $(".experiment-statistics").html(""); + $(".loading-img-statistics").removeClass("hide"); $.ajax({ - url: 'experimentStatistics?fromTime=' + $fromTime + '&' + 'toTime=' + $toTime, + url: 'experimentStatistics?fromTime=' + startTime + '&' + 'toTime=' + endTime, type: 'get', success: function (data) { $(".experiment-statistics").html(data); @@ -390,7 +419,25 @@ to be uncommented when actually in use. }).complete(function () { $(".loading-img-statistics").addClass("hide"); }); + } + + function getCurrentDate( subtractDaysFromToday){ + var cd = new Date(); + var hours = cd.getUTCHours(); + month = cd.getMonth() + 1; //getmonth()starts from 0 for some reason + var timeOfDay = "am"; + if(hours >= 12) + { + timeOfDay = "pm" + if(hours != 12) + hours = hours - 12; } - }); + var date = cd.getDate(); + if( subtractDaysFromToday!= null) + date = date - subtractDaysFromToday; + + var todayDate = month + "/" + date + "/" + cd.getFullYear() + " " + hours + ":" + cd.getUTCMinutes() + " " + timeOfDay; + return todayDate; + } </script> @stop \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1f6c86d8/app/views/layout/fixed-header.blade.php ---------------------------------------------------------------------- diff --git a/app/views/layout/fixed-header.blade.php b/app/views/layout/fixed-header.blade.php index 7f3054d..c03e167 100644 --- a/app/views/layout/fixed-header.blade.php +++ b/app/views/layout/fixed-header.blade.php @@ -2,7 +2,9 @@ <!DOCTYPE html> <html lang="en"> <head> + <!-- <title>{{ $title }}</title> + --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" href="resources/assets/favicon.ico" type="image/x-icon"> http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1f6c86d8/app/views/partials/experiment-info.blade.php ---------------------------------------------------------------------- diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php index 14e0643..508a0d7 100644 --- a/app/views/partials/experiment-info.blade.php +++ b/app/views/partials/experiment-info.blade.php @@ -67,14 +67,13 @@ ?> </tr> @endif - <?php - if ($expVal["jobState"]) echo ' - <tr> - <td><strong>Job Status</strong></td> - <td>' . $expVal["jobState"] . '</td> - </tr> - '; - ?> + + @if($expVal["jobState"]) + <tr> + <td><strong>Job Status</strong></td> + <td>{{ $expVal["jobState"] }}</td> + </tr> + @endif @if( isset($dashboard)) <tr>
