You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by nd...@apache.org on 2016/02/10 20:31:29 UTC

[1/3] airavata-php-gateway git commit: Code refactoring

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 667d07161 -> b57204671


Code refactoring


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/73f23e8c
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/73f23e8c
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/73f23e8c

Branch: refs/heads/develop
Commit: 73f23e8c4eaf75785a1ef0559bcaba70e435d1b1
Parents: 67f8c16
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Wed Feb 10 14:22:22 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Wed Feb 10 14:22:22 2016 -0500

----------------------------------------------------------------------
 app/libraries/AdminUtilities.php                |   3 +-
 app/libraries/ExperimentUtilities.php           |  35 ++--
 app/views/admin/experiment-statistics.blade.php | 162 +++----------------
 .../partials/interface-output-block.blade.php   |   5 +-
 4 files changed, 44 insertions(+), 161 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/73f23e8c/app/libraries/AdminUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index b8576c4..0c8e195 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -61,7 +61,8 @@ class AdminUtilities
         $expContainer = array();
         $expNum = 0;
         foreach ($experiments as $experiment) {
-            $expValue = ExperimentUtilities::get_experiment_summary_values($experiment, true);
+            //var_dump( $experiment); exit;
+            $expValue = ExperimentUtilities::get_experiment_values($experiment, true);
             $expContainer[$expNum]['experiment'] = $experiment;
             $expValue["editable"] = false;
             $expContainer[$expNum]['expValue'] = $expValue;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/73f23e8c/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 9d9eebc..acd6822 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -668,6 +668,7 @@ class ExperimentUtilities
         }
     }
 
+    /*
     public static function get_experiment_summary_values($experimentSummary, $forSearch = false)
     {
 //        var_dump( $experimentSummary); exit;
@@ -729,7 +730,7 @@ class ExperimentUtilities
         return $expVal;
 
     }
-
+    */
 
     public static function get_experiment_values($experiment, $project, $forSearch = false)
     {
@@ -744,7 +745,12 @@ class ExperimentUtilities
         $expVal["taskStates"] = TaskState::$__names;
         $expVal["taskTypes"] = TaskTypes::$__names;
 
-        $experimentStatusString = $expVal["experimentStates"][$experiment->experimentStatus->state];
+
+        if( is_object( $experiment->experimentStatus ) )
+            $experimentStatusString = $expVal["experimentStates"][$experiment->experimentStatus->state];
+        else
+            $experimentStatusString = $experiment->experimentStatus; 
+
         $expVal["experimentStatusString"] = $experimentStatusString;
         if ( $experimentStatusString == ExperimentState::FAILED)
             $expVal["editable"] = false;
@@ -757,18 +763,16 @@ class ExperimentUtilities
 
         if ($experiment->experimentStatus != null) {
             $experimentStatus = $experiment->experimentStatus;
-            /*
-            $experimentState = $experimentStatus->state;
-            $experimentStatusString = ExperimentState::$__names[$experimentState];
-            $expVal["experimentStatusString"] = $experimentStatusString;
-            */
-            $expVal["experimentTimeOfStateChange"] = $experimentStatus->timeOfStateChange / 1000; // divide by 1000 since timeOfStateChange is in ms
+
+            if( is_object( $experiment->experimentStatus ) )
+                $expVal["experimentTimeOfStateChange"] = $experimentStatus->timeOfStateChange / 1000; // divide by 1000 since timeOfStateChange is in ms
             $expVal["experimentCreationTime"] = $experiment->creationTime / 1000; // divide by 1000 since creationTime is in ms
         }
 
-        if (!$forSearch) {
+        if (!$forSearch && is_object( $experiment->experimentStatus) ){
             $userConfigData = $experiment->userConfigurationData;
             $scheduling = $userConfigData->computationalResourceScheduling;
+
             $expVal['scheduling'] = $scheduling;
             try {
                 $expVal["computeResource"] = CRUtilities::get_compute_resource($scheduling->resourceHostId);
@@ -786,8 +790,8 @@ class ExperimentUtilities
             $expVal["applicationInterface"]->applicationName = substr($experiment->executionId, -8);
         }
 
-
-        switch (ExperimentState::$__names[$experiment->experimentStatus->state]) {
+        //editable statuses
+        switch ( $experimentStatusString) {
             case 'CREATED':
             case 'VALIDATED':
             case 'SCHEDULED':
@@ -798,7 +802,8 @@ class ExperimentUtilities
                 break;
         }
 
-        switch (ExperimentState::$__names[$experiment->experimentStatus->state]) {
+        //cancelable statuses
+        switch ( $experimentStatusString) {
             case 'VALIDATED':
             case 'SCHEDULED':
             case 'LAUNCHED':
@@ -920,7 +925,7 @@ class ExperimentUtilities
         $expContainer = array();
         $expNum = 0;
         foreach ($experiments as $experiment) {
-            $expValue = ExperimentUtilities::get_experiment_summary_values($experiment, true);
+            $expValue = ExperimentUtilities::get_experiment_values($experiment, true);
             $expContainer[$expNum]['experiment'] = $experiment;
             if ($expValue["experimentStatusString"] == "FAILED")
                 $expValue["editable"] = false;
@@ -977,7 +982,7 @@ class ExperimentUtilities
         $expContainer = array();
         $expNum = 0;
         foreach ($experiments as $experiment) {
-            $expValue = ExperimentUtilities::get_experiment_search_values($experiment, ProjectUtilities::get_project($experiment->projectId), true);
+            $expValue = ExperimentUtilities::get_experiment_values($experiment, ProjectUtilities::get_project($experiment->projectId), true);
             $expContainer[$expNum]['experiment'] = $experiment;
             if ($expValue["experimentStatusString"] == "FAILED")
                 $expValue["editable"] = false;
@@ -1023,7 +1028,7 @@ class ExperimentUtilities
         $expContainer = array();
         $expNum = 0;
         foreach ($experiments as $experiment) {
-            $expValue = ExperimentUtilities::get_experiment_summary_values($experiment, true);
+            $expValue = ExperimentUtilities::get_experiment_values($experiment, true);
             $expContainer[$expNum]['experiment'] = $experiment;
             if ($expValue["experimentStatusString"] == "FAILED")
                 $expValue["editable"] = false;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/73f23e8c/app/views/admin/experiment-statistics.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/experiment-statistics.blade.php b/app/views/admin/experiment-statistics.blade.php
index 59a6cdb..86973de 100644
--- a/app/views/admin/experiment-statistics.blade.php
+++ b/app/views/admin/experiment-statistics.blade.php
@@ -147,163 +147,32 @@
 <script>
 
     $("#getAllExperiments").click(function () {
-        //These are coming from manage-experiments.blade.php
-        $fromTime = $("#datetimepicker9").find("input").val();
-        $fromTime = moment($fromTime).utc().format('MM/DD/YYYY hh:mm a');
-        $toTime = $("#datetimepicker10").find("input").val();
-        $toTime = moment($toTime).utc().format('MM/DD/YYYY hh:mm a');
-        if ($fromTime == '' || $toTime == '') {
-            alert("Please Select Valid Date Inputs!");
-        } else {
-            $(".loading-img-statistics").removeClass("hide");
-            $.ajax({
-                type: 'GET',
-                url: "{{URL::to('/')}}/admin/dashboard/experimentsOfTimeRange",
-                data: {
-                    'status-type': 'ALL',
-                    'search-key': 'creation-time',
-                    'from-date': $fromTime,
-                    'to-date': $toTime
-                },
-                async: false,
-                success: function (data) {
-                    $(".experiment-container").html(data);
-                    //from time-conversion.js
-                    updateTime();
-                }
-            }).complete(function () {
-                $(".loading-img-statistics").addClass("hide");
-            });
-        }
+        getExperimentsOfStatus( 'ALL');
     });
 
     $("#getCreatedExperiments").click(function () {
-        //These are coming from manage-experiments.blade.php
-        $fromTime = $("#datetimepicker9").find("input").val();
-        $fromTime = moment($fromTime).utc().format('MM/DD/YYYY hh:mm a');
-        $toTime = $("#datetimepicker10").find("input").val();
-        $toTime = moment($toTime).utc().format('MM/DD/YYYY hh:mm a');
-
-        if ($fromTime == '' || $toTime == '') {
-            alert("Please Select Valid Date Inputs!");
-        } else {
-            $(".loading-img-statistics").removeClass("hide");
-            $.ajax({
-                type: 'GET',
-                url: "{{URL::to('/')}}/admin/dashboard/experimentsOfTimeRange",
-                data: {
-                    'status-type': 'CREATED',
-                    'search-key': 'creation-time',
-                    'from-date': $fromTime,
-                    'to-date': $toTime
-                },
-                async: false,
-                success: function (data) {
-                    $(".experiment-container").html(data);
-                    //from time-conversion.js
-                    updateTime();
-                }
-            }).complete(function () {
-                $(".loading-img-statistics").addClass("hide");
-            });
-        }
+        getExperimentsOfStatus( 'CREATED');
     });
 
     $("#getRunningExperiments").click(function () {
-        //These are coming from manage-experiments.blade.php
-        $fromTime = $("#datetimepicker9").find("input").val();
-        $fromTime = moment($fromTime).utc().format('MM/DD/YYYY hh:mm a');
-        $toTime = $("#datetimepicker10").find("input").val();
-        $toTime = moment($toTime).utc().format('MM/DD/YYYY hh:mm a');
-        if ($fromTime == '' || $toTime == '') {
-            alert("Please Select Valid Date Inputs!");
-        } else {
-            $(".loading-img-statistics").removeClass("hide");
-            $.ajax({
-                type: 'GET',
-                url: "{{URL::to('/')}}/admin/dashboard/experimentsOfTimeRange",
-                data: {
-                    'status-type': 'RUNNING',
-                    'search-key': 'creation-time',
-                    'from-date': $fromTime,
-                    'to-date': $toTime
-                },
-                async: false,
-                success: function (data) {
-                    $(".experiment-container").html(data);
-                    //from time-conversion.js
-                    updateTime();
-                }
-            }).complete(function () {
-                $(".loading-img-statistics").addClass("hide");
-            });
-        }
+        getExperimentsOfStatus( 'RUNNING');
     });
 
     $("#getCompletedExperiments").click(function () {
-        //These are coming from manage-experiments.blade.php
-        $fromTime = $("#datetimepicker9").find("input").val();
-        $fromTime = moment($fromTime).utc().format('MM/DD/YYYY hh:mm a');
-        $toTime = $("#datetimepicker10").find("input").val();
-        $toTime = moment($toTime).utc().format('MM/DD/YYYY hh:mm a');
-        if ($fromTime == '' || $toTime == '') {
-            alert("Please Select Valid Date Inputs!");
-        } else {
-            $(".loading-img-statistics").removeClass("hide");
-            $.ajax({
-                type: 'GET',
-                url: "{{URL::to('/')}}/admin/dashboard/experimentsOfTimeRange",
-                data: {
-                    'status-type': 'COMPLETED',
-                    'search-key': 'creation-time',
-                    'from-date': $fromTime,
-                    'to-date': $toTime
-                },
-                async: false,
-                success: function (data) {
-                    $(".experiment-container").html(data);
-                    //from time-conversion.js
-                    updateTime();
-                }
-            }).complete(function () {
-                $(".loading-img-statistics").addClass("hide");
-            });
-        }
+        getExperimentsOfStatus( 'COMPLETED');
     });
 
     $("#getCancelledExperiments").click(function () {
-        //These are coming from manage-experiments.blade.php
-        $fromTime = $("#datetimepicker9").find("input").val();
-        $fromTime = moment($fromTime).utc().format('MM/DD/YYYY hh:mm a');
-        $toTime = $("#datetimepicker10").find("input").val();
-        $toTime = moment($toTime).utc().format('MM/DD/YYYY hh:mm a');
-        if ($fromTime == '' || $toTime == '') {
-            alert("Please Select Valid Date Inputs!");
-        } else {
-            $(".loading-img-statistics").removeClass("hide");
-            $.ajax({
-                type: 'GET',
-                url: "{{URL::to('/')}}/admin/dashboard/experimentsOfTimeRange",
-                data: {
-                    'status-type': 'CANCELED',
-                    'search-key': 'creation-time',
-                    'from-date': $fromTime,
-                    'to-date': $toTime
-                },
-                async: false,
-                success: function (data) {
-                    $(".experiment-container").html(data);
-                    //from time-conversion.js
-                    updateTime();
-                }
-            }).complete(function () {
-                $(".loading-img-statistics").addClass("hide");
-            });
-        }
+        getExperimentsOfStatus( 'CANCELED');
     });
 
     $("#getFailedExperiments").click(function () {
+        getExperimentsOfStatus( 'FAILED');
+    });
+
+    function getExperimentsOfStatus( status){
         //These are coming from manage-experiments.blade.php
+        $(".experiment-container").html( $(".loading-img").html() );
         $fromTime = $("#datetimepicker9").find("input").val();
         $fromTime = moment($fromTime).utc().format('MM/DD/YYYY hh:mm a');
         $toTime = $("#datetimepicker10").find("input").val();
@@ -316,7 +185,7 @@
                 type: 'GET',
                 url: "{{URL::to('/')}}/admin/dashboard/experimentsOfTimeRange",
                 data: {
-                    'status-type': 'FAILED',
+                    'status-type': status,
                     'search-key': 'creation-time',
                     'from-date': $fromTime,
                     'to-date': $toTime
@@ -331,5 +200,14 @@
                 $(".loading-img-statistics").addClass("hide");
             });
         }
+    }
+
+    $(".experiment-statistics").on("click", ".get-exp-stats", function(){
+        expId = $(this).data("expid");
+        $(".experimentId").val( expId);
+        $(".get-experiment").click();
+        $('html, body').animate({
+            scrollTop: $(".get-experiment").offset().top - 100
+        }, 1000);
     });
 </script>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/73f23e8c/app/views/partials/interface-output-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/interface-output-block.blade.php b/app/views/partials/interface-output-block.blade.php
index b2bc5d5..329153b 100644
--- a/app/views/partials/interface-output-block.blade.php
+++ b/app/views/partials/interface-output-block.blade.php
@@ -46,11 +46,10 @@
 
         <div class="col-md-9">
             <select name="dataMovement[]" readonly class="form-control">
-                <option>select</option>
-                <option value="1"
-                @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 1) selected @endif @endif>True</option>
                 <option value="0"
                 @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 0) selected @endif @endif>False</option>
+                <option value="1"
+                @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 1) selected @endif @endif>True</option>
             </select>
         </div>
         <!--


[3/3] airavata-php-gateway git commit: Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/airavata-php-gateway into develop

Posted by nd...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/airavata-php-gateway into develop


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/b5720467
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/b5720467
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/b5720467

Branch: refs/heads/develop
Commit: b57204671b6deec8532c361d20e33eb80cc8081f
Parents: e0195ad 667d071
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Wed Feb 10 14:30:12 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Wed Feb 10 14:30:12 2016 -0500

----------------------------------------------------------------------
 app/config/pga_config.php.template        | 15 ++++-------
 app/controllers/AccountController.php     | 28 +++++++++++++++-----
 app/libraries/Wsis/Stubs/OAuthManager.php |  4 ++-
 app/routes.php                            |  2 ++
 app/views/account/verify-human.blade.php  | 36 ++++++++++++++++++++++++++
 5 files changed, 67 insertions(+), 18 deletions(-)
----------------------------------------------------------------------



[2/3] airavata-php-gateway git commit: Clicking on Experiment in Statistics now shows detailed information without taking to summary page

Posted by nd...@apache.org.
Clicking on Experiment in Statistics now shows detailed information without taking to summary page


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/e0195ad5
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/e0195ad5
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/e0195ad5

Branch: refs/heads/develop
Commit: e0195ad5ff7c9bd7515da0b805e1f54e978df2eb
Parents: 73f23e8
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Wed Feb 10 14:23:15 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Wed Feb 10 14:23:15 2016 -0500

----------------------------------------------------------------------
 app/views/admin/manage-experiments.blade.php      | 12 ++++++++----
 app/views/partials/experiment-container.blade.php |  5 ++---
 2 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e0195ad5/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 26a2e4d..293cb26 100644
--- a/app/views/admin/manage-experiments.blade.php
+++ b/app/views/admin/manage-experiments.blade.php
@@ -358,14 +358,16 @@ to be uncommented when actually in use.
 
     $(".get-experiment").click(function () {
         $(".loading-img").removeClass("hide");
+
+        var expId = $(".experimentId").val();
         $.ajax({
-            url: 'experiment/summary?expId=' + $(".experimentId").val(),
+            url: 'experiment/summary?expId=' + expId,
             type: 'get',
             success: function (data) {
                 //$(".experiment-info").html(data);
-                $("#myTabs").append('<li role="presentation"><a href="#' + $(".experimentId").val() + '" aria-controls="' + $(".experimentId").val() + '" role="tab" data-toggle="tab">' + $(".experimentId").val() + '</a></li>');
-                $(".tab-content").append('<div role="tabpanel" class="tab-pane" id="' + $(".experimentId").val() + '">' + data + '</div>');
-                $('#myTabs a[href="#' + $(".experimentId").val() + '"]').tab('show') // Select tab by name
+                $("#myTabs").append('<li role="presentation"><a href="#' + expId + '" aria-controls="' + expId + '" role="tab" data-toggle="tab">' + expId + '</a></li>');
+                $(".tab-content").append('<div role="tabpanel" class="tab-pane" id="' + expId + '">' + data + '</div>');
+                $('#myTabs a[href="#' + expId + '"]').tab('show') // Select tab by name
                 
                 //$('#myTabs a[href="#expsummary"]').tab('show') // Select tab by name
                 
@@ -467,5 +469,7 @@ to be uncommented when actually in use.
         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/e0195ad5/app/views/partials/experiment-container.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-container.blade.php b/app/views/partials/experiment-container.blade.php
index 063a56d..e9dc65f 100644
--- a/app/views/partials/experiment-container.blade.php
+++ b/app/views/partials/experiment-container.blade.php
@@ -32,7 +32,7 @@
                 <tr>
                     <!-- Experiment Name -->
                     <td> 
-                        <a href="{{URL::to('/')}}/experiment/summary?expId={{$experiment['experiment']->experimentId}}">
+                        <a @if( isset( $dashboard)) class="get-exp-stats" data-expid="{{$experiment['experiment']->experimentId}}" @else href="{{URL::to('/')}}/experiment/summary?expId={{$experiment['experiment']->experimentId}}" @endif style="cursor: pointer;">
                         {{ $experiment['experiment']->name }} 
                         </a>
                         @if( $experiment['expValue']['editable'])
@@ -59,8 +59,7 @@
                     <td class="time" unix-time="{{ $experiment['experiment']->creationTime / 1000 }}"></td>
 
                     <td>
-                        <a class="{{ ExperimentUtilities::get_status_color_class( $experiment['expValue']['experimentStatusString'] ) }}"
-                           href="{{ URL::to('/') }}/experiment/summary?expId={{$experiment['experiment']->experimentId }}">
+                        <a @if( isset( $dashboard)) class="get-exp-stats {{ ExperimentUtilities::get_status_color_class( $experiment['expValue']['experimentStatusString'] ) }}" data-expid="{{$experiment['experiment']->experimentId}}" @else class="{{ ExperimentUtilities::get_status_color_class( $experiment['expValue']['experimentStatusString'] ) }}" href="{{URL::to('/')}}/experiment/summary?expId={{$experiment['experiment']->experimentId}}" @endif style="cursor: pointer;">
                             {{$experiment['expValue']['experimentStatusString'] }}
                         </a>
                     </td>