You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/07/29 19:48:42 UTC

[10/50] [abbrv] airavata-php-gateway git commit: fixing AIRAVATA-1775

fixing AIRAVATA-1775


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

Branch: refs/heads/master
Commit: 51269ed3d8523ba5542729e037893ef23761f8cb
Parents: cd8012f
Author: Supun Nakandala <sc...@apache.org>
Authored: Sat Jul 18 15:22:20 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Sat Jul 18 15:22:20 2015 +0530

----------------------------------------------------------------------
 app/libraries/AdminUtilities.php                |   6 +-
 .../Model/Workspace/Experiment/Types.php        | 172 +++++++++++++++++--
 app/libraries/CRUtilities.php                   |   3 +
 app/views/admin/experiment-statistics.blade.php |  66 ++++++-
 4 files changed, 224 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/51269ed3/app/libraries/AdminUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index 95a8c42..8cc1a0f 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -45,8 +45,12 @@ class AdminUtilities
         $experiments = array();
         if ($inputs["status-type"] == "ALL") {
             $experiments = $experimentStatistics->allExperiments;
-        } else if ($inputs["status-type"] == "COMPLETED") {
+        }else if ($inputs["status-type"] == "COMPLETED") {
             $experiments = $experimentStatistics->completedExperiments;
+        }else if ($inputs["status-type"] == "CREATED") {
+            $experiments = $experimentStatistics->createdExperiments;
+        }else if ($inputs["status-type"] == "RUNNING") {
+            $experiments = $experimentStatistics->runningExperiments;
         } elseif ($inputs["status-type"] == "FAILED") {
             $experiments = $experimentStatistics->failedExperiments;
         } else if ($inputs["status-type"] == "CANCELED") {

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/51269ed3/app/libraries/Airavata/Model/Workspace/Experiment/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/Workspace/Experiment/Types.php b/app/libraries/Airavata/Model/Workspace/Experiment/Types.php
index db58bf9..9b352cf 100644
--- a/app/libraries/Airavata/Model/Workspace/Experiment/Types.php
+++ b/app/libraries/Airavata/Model/Workspace/Experiment/Types.php
@@ -4341,10 +4341,14 @@ class ExperimentStatistics {
   public $completedExperimentCount = null;
   public $cancelledExperimentCount = null;
   public $failedExperimentCount = null;
+  public $createdExperimentCount = null;
+  public $runningExperimentCount = null;
   public $allExperiments = null;
   public $completedExperiments = null;
   public $failedExperiments = null;
   public $cancelledExperiments = null;
+  public $createdExperiments = null;
+  public $runningExperiments = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -4366,6 +4370,14 @@ class ExperimentStatistics {
           'type' => TType::I32,
           ),
         5 => array(
+          'var' => 'createdExperimentCount',
+          'type' => TType::I32,
+          ),
+        6 => array(
+          'var' => 'runningExperimentCount',
+          'type' => TType::I32,
+          ),
+        7 => array(
           'var' => 'allExperiments',
           'type' => TType::LST,
           'etype' => TType::STRUCT,
@@ -4374,7 +4386,7 @@ class ExperimentStatistics {
             'class' => '\Airavata\Model\Workspace\Experiment\ExperimentSummary',
             ),
           ),
-        6 => array(
+        8 => array(
           'var' => 'completedExperiments',
           'type' => TType::LST,
           'etype' => TType::STRUCT,
@@ -4383,7 +4395,7 @@ class ExperimentStatistics {
             'class' => '\Airavata\Model\Workspace\Experiment\ExperimentSummary',
             ),
           ),
-        7 => array(
+        9 => array(
           'var' => 'failedExperiments',
           'type' => TType::LST,
           'etype' => TType::STRUCT,
@@ -4392,7 +4404,7 @@ class ExperimentStatistics {
             'class' => '\Airavata\Model\Workspace\Experiment\ExperimentSummary',
             ),
           ),
-        8 => array(
+        10 => array(
           'var' => 'cancelledExperiments',
           'type' => TType::LST,
           'etype' => TType::STRUCT,
@@ -4401,6 +4413,24 @@ class ExperimentStatistics {
             'class' => '\Airavata\Model\Workspace\Experiment\ExperimentSummary',
             ),
           ),
+        11 => array(
+          'var' => 'createdExperiments',
+          'type' => TType::LST,
+          'etype' => TType::STRUCT,
+          'elem' => array(
+            'type' => TType::STRUCT,
+            'class' => '\Airavata\Model\Workspace\Experiment\ExperimentSummary',
+            ),
+          ),
+        12 => array(
+          'var' => 'runningExperiments',
+          'type' => TType::LST,
+          'etype' => TType::STRUCT,
+          'elem' => array(
+            'type' => TType::STRUCT,
+            'class' => '\Airavata\Model\Workspace\Experiment\ExperimentSummary',
+            ),
+          ),
         );
     }
     if (is_array($vals)) {
@@ -4416,6 +4446,12 @@ class ExperimentStatistics {
       if (isset($vals['failedExperimentCount'])) {
         $this->failedExperimentCount = $vals['failedExperimentCount'];
       }
+      if (isset($vals['createdExperimentCount'])) {
+        $this->createdExperimentCount = $vals['createdExperimentCount'];
+      }
+      if (isset($vals['runningExperimentCount'])) {
+        $this->runningExperimentCount = $vals['runningExperimentCount'];
+      }
       if (isset($vals['allExperiments'])) {
         $this->allExperiments = $vals['allExperiments'];
       }
@@ -4428,6 +4464,12 @@ class ExperimentStatistics {
       if (isset($vals['cancelledExperiments'])) {
         $this->cancelledExperiments = $vals['cancelledExperiments'];
       }
+      if (isset($vals['createdExperiments'])) {
+        $this->createdExperiments = $vals['createdExperiments'];
+      }
+      if (isset($vals['runningExperiments'])) {
+        $this->runningExperiments = $vals['runningExperiments'];
+      }
     }
   }
 
@@ -4479,6 +4521,20 @@ class ExperimentStatistics {
           }
           break;
         case 5:
+          if ($ftype == TType::I32) {
+            $xfer += $input->readI32($this->createdExperimentCount);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 6:
+          if ($ftype == TType::I32) {
+            $xfer += $input->readI32($this->runningExperimentCount);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 7:
           if ($ftype == TType::LST) {
             $this->allExperiments = array();
             $_size133 = 0;
@@ -4496,7 +4552,7 @@ class ExperimentStatistics {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 6:
+        case 8:
           if ($ftype == TType::LST) {
             $this->completedExperiments = array();
             $_size139 = 0;
@@ -4514,7 +4570,7 @@ class ExperimentStatistics {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 7:
+        case 9:
           if ($ftype == TType::LST) {
             $this->failedExperiments = array();
             $_size145 = 0;
@@ -4532,7 +4588,7 @@ class ExperimentStatistics {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 8:
+        case 10:
           if ($ftype == TType::LST) {
             $this->cancelledExperiments = array();
             $_size151 = 0;
@@ -4550,6 +4606,42 @@ class ExperimentStatistics {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 11:
+          if ($ftype == TType::LST) {
+            $this->createdExperiments = array();
+            $_size157 = 0;
+            $_etype160 = 0;
+            $xfer += $input->readListBegin($_etype160, $_size157);
+            for ($_i161 = 0; $_i161 < $_size157; ++$_i161)
+            {
+              $elem162 = null;
+              $elem162 = new \Airavata\Model\Workspace\Experiment\ExperimentSummary();
+              $xfer += $elem162->read($input);
+              $this->createdExperiments []= $elem162;
+            }
+            $xfer += $input->readListEnd();
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 12:
+          if ($ftype == TType::LST) {
+            $this->runningExperiments = array();
+            $_size163 = 0;
+            $_etype166 = 0;
+            $xfer += $input->readListBegin($_etype166, $_size163);
+            for ($_i167 = 0; $_i167 < $_size163; ++$_i167)
+            {
+              $elem168 = null;
+              $elem168 = new \Airavata\Model\Workspace\Experiment\ExperimentSummary();
+              $xfer += $elem168->read($input);
+              $this->runningExperiments []= $elem168;
+            }
+            $xfer += $input->readListEnd();
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -4583,17 +4675,27 @@ class ExperimentStatistics {
       $xfer += $output->writeI32($this->failedExperimentCount);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->createdExperimentCount !== null) {
+      $xfer += $output->writeFieldBegin('createdExperimentCount', TType::I32, 5);
+      $xfer += $output->writeI32($this->createdExperimentCount);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->runningExperimentCount !== null) {
+      $xfer += $output->writeFieldBegin('runningExperimentCount', TType::I32, 6);
+      $xfer += $output->writeI32($this->runningExperimentCount);
+      $xfer += $output->writeFieldEnd();
+    }
     if ($this->allExperiments !== null) {
       if (!is_array($this->allExperiments)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('allExperiments', TType::LST, 5);
+      $xfer += $output->writeFieldBegin('allExperiments', TType::LST, 7);
       {
         $output->writeListBegin(TType::STRUCT, count($this->allExperiments));
         {
-          foreach ($this->allExperiments as $iter157)
+          foreach ($this->allExperiments as $iter169)
           {
-            $xfer += $iter157->write($output);
+            $xfer += $iter169->write($output);
           }
         }
         $output->writeListEnd();
@@ -4604,13 +4706,13 @@ class ExperimentStatistics {
       if (!is_array($this->completedExperiments)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('completedExperiments', TType::LST, 6);
+      $xfer += $output->writeFieldBegin('completedExperiments', TType::LST, 8);
       {
         $output->writeListBegin(TType::STRUCT, count($this->completedExperiments));
         {
-          foreach ($this->completedExperiments as $iter158)
+          foreach ($this->completedExperiments as $iter170)
           {
-            $xfer += $iter158->write($output);
+            $xfer += $iter170->write($output);
           }
         }
         $output->writeListEnd();
@@ -4621,13 +4723,13 @@ class ExperimentStatistics {
       if (!is_array($this->failedExperiments)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('failedExperiments', TType::LST, 7);
+      $xfer += $output->writeFieldBegin('failedExperiments', TType::LST, 9);
       {
         $output->writeListBegin(TType::STRUCT, count($this->failedExperiments));
         {
-          foreach ($this->failedExperiments as $iter159)
+          foreach ($this->failedExperiments as $iter171)
           {
-            $xfer += $iter159->write($output);
+            $xfer += $iter171->write($output);
           }
         }
         $output->writeListEnd();
@@ -4638,13 +4740,47 @@ class ExperimentStatistics {
       if (!is_array($this->cancelledExperiments)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('cancelledExperiments', TType::LST, 8);
+      $xfer += $output->writeFieldBegin('cancelledExperiments', TType::LST, 10);
       {
         $output->writeListBegin(TType::STRUCT, count($this->cancelledExperiments));
         {
-          foreach ($this->cancelledExperiments as $iter160)
+          foreach ($this->cancelledExperiments as $iter172)
+          {
+            $xfer += $iter172->write($output);
+          }
+        }
+        $output->writeListEnd();
+      }
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->createdExperiments !== null) {
+      if (!is_array($this->createdExperiments)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('createdExperiments', TType::LST, 11);
+      {
+        $output->writeListBegin(TType::STRUCT, count($this->createdExperiments));
+        {
+          foreach ($this->createdExperiments as $iter173)
+          {
+            $xfer += $iter173->write($output);
+          }
+        }
+        $output->writeListEnd();
+      }
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->runningExperiments !== null) {
+      if (!is_array($this->runningExperiments)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('runningExperiments', TType::LST, 12);
+      {
+        $output->writeListBegin(TType::STRUCT, count($this->runningExperiments));
+        {
+          foreach ($this->runningExperiments as $iter174)
           {
-            $xfer += $iter160->write($output);
+            $xfer += $iter174->write($output);
           }
         }
         $output->writeListEnd();

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/51269ed3/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index 8d097b5..37a6149 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -505,6 +505,9 @@ class CRUtilities
      */
     public static function create_compute_resources_select($applicationId, $resourceHostId)
     {
+        echo $applicationId;
+        var_dump(CRUtilities::get_available_app_interface_compute_resources($applicationId));
+        exit;
         return CRUtilities::get_available_app_interface_compute_resources($applicationId);
     }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/51269ed3/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 ee94c4c..2cdb197 100644
--- a/app/views/admin/experiment-statistics.blade.php
+++ b/app/views/admin/experiment-statistics.blade.php
@@ -31,12 +31,12 @@
                         <i class="fa fa-comments fa-5x"></i>
                     </div>
                     <div class="col-xs-9 text-right">
-                        <div class="huge">12</div>
+                        <div class="huge">{{$expStatistics->createdExperimentCount}}</div>
                         <div>Created Experiments</div>
                     </div>
                 </div>
             </div>
-            <a id="getAllExperiments" href="#experiment-container">
+            <a id="getCreatedExperiments" href="#experiment-container">
                 <div class="panel-footer">
                     <span class="pull-left">CREATED VALIDATED</span>
                     <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></span>
@@ -54,12 +54,12 @@
                         <i class="fa fa-comments fa-5x"></i>
                     </div>
                     <div class="col-xs-9 text-right">
-                        <div class="huge">18</div>
+                        <div class="huge">{{$expStatistics->runningExperimentCount}}</div>
                         <div>Running Experiments</div>
                     </div>
                 </div>
             </div>
-            <a id="getAllExperiments" href="#experiment-container">
+            <a id="getRunningExperiments" href="#experiment-container">
                 <div class="panel-footer">
                     <span class="pull-left">SCHEDULED LAUNCHED EXECUTING</span>
                     <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></span>
@@ -174,6 +174,64 @@
         }
     });
 
+    $("#getCreatedExperiments").click(function () {
+        //These are coming from manage-experiments.blade.php
+        $fromTime = $("#datetimepicker9").find("input").val();
+        $toTime = $("#datetimepicker10").find("input").val();
+        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");
+            });
+        }
+    });
+
+    $("#getRunningExperiments").click(function () {
+        //These are coming from manage-experiments.blade.php
+        $fromTime = $("#datetimepicker9").find("input").val();
+        $toTime = $("#datetimepicker10").find("input").val();
+        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");
+            });
+        }
+    });
+
     $("#getCompletedExperiments").click(function () {
         //These are coming from manage-experiments.blade.php
         $fromTime = $("#datetimepicker9").find("input").val();