airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndo...@apache.org
Subject [2/4] airavata-php-gateway git commit: 1) Job Info for each job available in Experiment Summary 2) Order for Admin Dashboard Sidebar options has changed 3) Added error msg if ouput paths are not correct in experiment summary 4) Improved UI for Experiment
Date Thu, 12 Nov 2015 15:21:54 GMT
1) Job Info for each job available in Experiment Summary
2) Order for Admin Dashboard Sidebar options has changed
3) Added error msg if ouput paths are not correct in experiment summary
4) Improved UI for Experiment Statistics page
5) Added username to experiment summary on dashboard
6) Changes in UI on Gateway Preferences 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/1483b88f
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/1483b88f
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/1483b88f

Branch: refs/heads/develop
Commit: 1483b88f10d0d94ea9d92e9fb373cc1676a978c4
Parents: 9521153
Author: Nipurn Doshi <Nipurn Doshi>
Authored: Tue Nov 10 14:44:29 2015 -0500
Committer: Nipurn Doshi <Nipurn Doshi>
Committed: Tue Nov 10 14:44:29 2015 -0500

----------------------------------------------------------------------
 app/controllers/AdminController.php             |  56 ++++--
 app/controllers/ExperimentController.php        |   2 +-
 app/libraries/CRUtilities.php                   |   1 +
 app/libraries/ExperimentUtilities.php           |  14 +-
 app/views/admin/manage-experiments.blade.php    |   3 -
 app/views/admin/manage-gateway.blade.php        |   6 +-
 app/views/partials/dashboard-block.blade.php    |  18 +-
 .../partials/experiment-container.blade.php     | 173 +++++++++----------
 8 files changed, 152 insertions(+), 121 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1483b88f/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index a521763..bead073 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -16,20 +16,28 @@ class AdminController extends BaseController {
 		//only for super admin
 		//Session::put("scigap_admin", true);
 
-		$crData = CRUtilities::getEditCRData();
-		$gateways = CRUtilities::getAllGatewayProfilesData();
-
-		$gatewayData = array( 
-														"gateways" => $gateways, 
-														"computeResources" => CRUtilities::getAllCRObjects(),
-														"crData" => $crData);
 		if( Session::has("scigap_admin"))
+		{
+			$crData = CRUtilities::getEditCRData();
+			$gateways = CRUtilities::getAllGatewayProfilesData();
+
+			$gatewayData = array( 
+									"gateways" => $gateways, 
+									"computeResources" => CRUtilities::getAllCRObjects(),
+									"crData" => $crData
+								);
+			
 			$view = "scigap-admin/manage-gateway";
-		else{
-			$view = "admin/manage-gateway";
+
             Session::put("admin-nav", "gateway-prefs");
-        }
 			return View::make( $view, $gatewayData);
+		}
+		else{
+        	Session::put("admin-nav", "exp-statistics");
+			$view = "admin/manage-experiments";
+			return View::make( $view);
+
+        }
 	}
 
 	public function addAdminSubmit(){
@@ -70,6 +78,27 @@ class AdminController extends BaseController {
 
     }
 
+    public function gatewayView(){
+    	//only for super admin
+		//Session::put("scigap_admin", true);
+		$crData = CRUtilities::getEditCRData();
+		$gateways = CRUtilities::getAllGatewayProfilesData();
+		$gatewayData = array( 
+								"gateways" => $gateways, 
+								"computeResources" => CRUtilities::getAllCRObjects(),
+								"crData" => $crData
+							);
+		//var_dump( $gateways); exit;
+		if( Session::has("scigap_admin"))
+			$view = "scigap-admin/manage-gateway";
+		else{
+			$view = "admin/manage-gateway";
+        }
+
+        Session::put("admin-nav", "gateway-prefs");
+		return View::make( $view, $gatewayData);
+    }
+
 	public function addGatewayAdminSubmit(){
 		//check if username exists
 		if(WSIS::usernameExists( Input::get("username")) )
@@ -188,8 +217,11 @@ class AdminController extends BaseController {
             $inputs = Input::all();
             $expContainer = AdminUtilities::get_experiments_of_time_range($inputs);
             $expStates = ExperimentUtilities::getExpStates();
-            return View::make("partials/experiment-container", array("expContainer" =>
$expContainer,
-                "expStates" => $expStates));
+            return View::make("partials/experiment-container", 
+            	array(	"expContainer" => $expContainer,
+                		"expStates" => $expStates,
+                		"dashboard" => true
+                	));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1483b88f/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index 9a2eb27..f62de7d 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -87,7 +87,7 @@ class ExperimentController extends BaseController
             //var_dump( $jobDetails); exit;
             foreach( $jobDetails as $index => $jobDetail){
                 if(isset($jobDetail->jobStatus)){
-                    $jobDetails[ $index]->jobStatus->jobStateName = JobState::$__names[$jobDetail->jobStatus->jobState];
+                      $jobDetails[ $index]->jobStatus->jobStateName = JobState::$__names[$jobDetail->jobStatus->jobState];
                 }
                 else{
                     $jobDetails[ $index]->jobStatus = new stdClass();

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1483b88f/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index f4e44ba..ba89291 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -448,6 +448,7 @@ class CRUtilities
         }
 
         $gatewayProfiles = Airavata::getAllGatewayResourceProfiles(Session::get('authz-token'));
+        //var_dump( $gatewayProfiles); exit;
         //$gatewayProfileIds = array("GatewayTest3_57726e98-313f-4e7c-87a5-18e69928afb5",
"GatewayTest4_4fd9fb28-4ced-4149-bdbd-1f276077dad8");
         foreach ($gateways as $key => $gw) {
             $gateways[$key]->profile = array();

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1483b88f/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index b9f8bfd..adc23f8 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -621,9 +621,8 @@ class ExperimentUtilities
                 if ($output->type == DataType::URI || $output->type == DataType::STDOUT
|| $output->type == DataType::STDERR) {
                     $explode = explode('/', $output->value);
                     //echo '<p>' . $output->key .  ': <a href="' . $output->value
. '">' . $output->value . '</a></p>';
-                    $outputPath = str_replace(Config::get('pga_config.airavata')['experiment-data-absolute-path'],
-                        Config::get('pga_config.airavata')['experiment-data-dir'], $output->value);
-
+                    $outputPath = str_replace(Config::get('pga_config.airavata')['experiment-data-absolute-path'],
Config::get('pga_config.airavata')['experiment-data-dir'], $output->value);
+                    //print_r( $output->value); 
                     if(file_exists(str_replace('//','/',$output->value))){
                         $outputPathArray = explode("/", $outputPath);
 
@@ -632,9 +631,16 @@ class ExperimentUtilities
                 $outputPathArray[ count($outputPathArray)-1] . '">' .
                             $outputPathArray[sizeof($outputPathArray) - 1] . ' <span class="glyphicon
glyphicon-new-window"></span></a></p>';
                     }
-                } elseif ($output->type == DataType::STRING) {
+                    else
+                        echo 'Output paths are not correctly defined for : <br/>' .
$output->name . '<br/><br/> Please report this issue to the admin<br/><br/>';
+                
+                } 
+                elseif ($output->type == DataType::STRING) {
                     echo '<p>' . $output->value . '</p>';
                 }
+                else
+                    echo 'output : '. $output;
+                //echo 'output-type : ' . $output->type;
             }
         } else
             echo "Experiment hasn't completed. Experiment Status is : " . $expStatus;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1483b88f/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 f935a68..ad5c0d6 100644
--- a/app/views/admin/manage-experiments.blade.php
+++ b/app/views/admin/manage-experiments.blade.php
@@ -38,9 +38,6 @@
     </div>
 </div>
 
-<hr/>
-<br/>
-
 <div class="dates row">
     <div class="well col-md-12">
         <div class="col-md-10">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1483b88f/app/views/admin/manage-gateway.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-gateway.blade.php b/app/views/admin/manage-gateway.blade.php
index d4ded59..6910543 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -62,7 +62,7 @@
                                     <div class="col-md-10 credential-store-token-change">
                                         <form>
                                             <div class="form-group">
-                                                <label class="control-label col-md-12">Credential
Store Token</label>
+                                                <label class="control-label col-md-12">{{
Session::get('theme') }} Credential Store Token</label>
                                                 <div class="col-md-9">
                                                     <input type="text" name="resourceSpecificCredentialStoreToken"
 data-gpid="{{$gp->gatewayId}}" class="form-control credential-store-token"
                                                            value="@if( isset( $gp->profile->credentialStoreToken)
){{$gp->profile->credentialStoreToken}}@endif"/>
@@ -75,7 +75,7 @@
                                     </div>
                                     <div class="col-md-10">
                                         <button class="btn btn-default add-cr" data-gpid="{{$gp->gatewayId}}"><span
-                                                class="glyphicon glyphicon-plus"></span>
Add a Compute Resource
+                                                class="glyphicon glyphicon-plus"></span>
Add a Compute Resource Preference
                                         </button>
                                     </div>
                                     @endif
@@ -83,7 +83,7 @@
                                     <div class="col-md-10">
                                         @if( isset( $gp->profile->computeResourcePreferences)
)
                                         <div>
-                                            <h3>Existing Compute Resources :</h3>
+                                            <h3>Compute Resources Preferences :</h3>
                                         </div>
                                         <div class="accordion-inner">
                                             <div class="panel-group" id="accordion-{{$indexGP}}">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1483b88f/app/views/partials/dashboard-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/dashboard-block.blade.php b/app/views/partials/dashboard-block.blade.php
index 3589598..5ca1088 100644
--- a/app/views/partials/dashboard-block.blade.php
+++ b/app/views/partials/dashboard-block.blade.php
@@ -1,10 +1,14 @@
 <div class="collapse navbar-collapse navbar-ex1-collapse">
     <ul class="nav navbar-nav side-nav">
+
+
         <li
-        @if( Session::has("admin-nav") && Session::get("admin-nav") == "gateway-prefs")
class="active" @endif>
-        <a class="dashboard-link" href="{{ URL::to('/')}}/admin/dashboard/gateway"><i
class="fa fa-fw fa-dashboard"></i>@if(
-            Session::has("scigap_admin"))Gateways @else Gateway Preferences @endif</a>
+            @if( Session::has("admin-nav") && Session::get("admin-nav") == "exp-statistics")
class="active" @endif>
+            <a class="dashboard-link"  href="{{ URL::to('/')}}/admin/dashboard/experiments">
+                <i class="fa fa-fw fa-experiments"></i>Experiment Statistics
+            </a>
         </li>
+
         <li
         @if( Session::has("admin-nav") && Session::get("admin-nav") == "manage-users")
class="active" @endif>
             <a class="dashboard-link" href="{{ URL::to('/')}}/admin/dashboard/users"><i
class="fa fa-fw fa-bar-chart-o"></i> Users</a>
@@ -13,6 +17,7 @@
          @if( Session::has("admin-nav") && Session::get("admin-nav") == "manage-roles")
class="active" @endif>
             <a class="dashboard-link" href="{{ URL::to('/')}}/admin/dashboard/roles"><i
class="fa fa-fw fa-table"></i>Roles</a>
         </li>
+
 <!--        <li-->
 <!--        @if( Session::has("admin-nav") && Session::get("admin-nav") == "credential-store")
class="active" @endif>-->
 <!--            <a class="dashboard-link" href="{{ URL::to('/')}}/admin/dashboard/credential-store"><i
class="fa fa-fw fa-table"></i>Credential-->
@@ -56,10 +61,11 @@
             </ul>
 
         </li>
+
         <li
-            @if( Session::has("admin-nav") && Session::get("admin-nav") == "exp-statistics")
class="active" @endif>
-            <a class="dashboard-link"  href="{{ URL::to('/')}}/admin/dashboard/experiments"><i
-                    class="fa fa-fw fa-experiments"></i>Experiment Statistics</a>
+            @if( Session::has("admin-nav") && Session::get("admin-nav") == "gateway-prefs")
class="active" @endif>
+            <a class="dashboard-link" href="{{ URL::to('/')}}/admin/dashboard/gateway"><i
class="fa fa-fw fa-dashboard"></i>@if(
+                Session::has("scigap_admin"))Gateways @else Gateway Preferences @endif</a>
         </li>
 <!--        <li>-->
 <!--            <a href="forms.html"><i class="fa fa-fw fa-edit"></i>
Settings</a>-->

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1483b88f/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 6e00cd4..493bc73 100644
--- a/app/views/partials/experiment-container.blade.php
+++ b/app/views/partials/experiment-container.blade.php
@@ -1,99 +1,88 @@
-<?php
+@if ( isset($expContainer))
+    @if (sizeof($expContainer) == 0)
+        @if (isset($pageNo) && $pageNo == 1) {
+            CommonUtilities::print_warning_message('No results found. Please try again.')
+        @else
+            CommonUtilities::print_warning_message('No more results found.')
+        @endif
+    @else
+    <div id="re" class="table-responsive">
 
-if (isset($expContainer))
-{
-if (sizeof($expContainer) == 0)
-{
-    if (isset($pageNo) && $pageNo == 1) {
-        CommonUtilities::print_warning_message('No results found. Please try again.');
-    } else {
-        CommonUtilities::print_warning_message('No more results found.');
-    }
-}
-else
-{
-?>
-
-<div id="re" class="table-responsive">
-    <table class="table">
-        <tr>
-            <th>Name</th>
-            <th>Application</th>
-            {{--<th>Description</th>--}}
-            <th>Resource</th>
-            <th>Creation Time</th>
-            <th>Status</th>
-            <!--                    <select class="form-control select-status">-->
-            <!--                        <option value="ALL">Status</option>-->
-            <!--                    @foreach( $expStates as $index => $state)-->
-            <!--                        <option value="{{ $state }}">{{ $state }}</option>-->
-            <!--                    @endforeach-->
-            <!--                    </select>-->
-            <!--                </th>-->
-        </tr>
-
-
-        <?php
-        foreach ($expContainer as $experiment) {
-            $description = $experiment['experiment']->description;
-            if (strlen($description) > 17) // 17 is arbitrary
-            {
-                $description = substr($experiment['experiment']->description, 0, 17) .
'<span class="text-muted">...</span>';
-            }
-
-            $resource  = $experiment['experiment']->resourceHostId;
-            if(!empty($resource)){
-                $resource = explode("_", $resource)[0];
-            }else{
-                $resource = "";
-            }
-
-            echo '<tr>';
-            $addEditOption = "";
-            if ($experiment['expValue']['editable'])
-                $addEditOption = '<a href="' . URL::to('/') . '/experiment/edit?expId='
. $experiment['experiment']->experimentId . '" title="Edit"><span class="glyphicon
glyphicon-pencil"></span></a>';
-
-            echo '<td>' . $experiment['experiment']->name . $addEditOption . '</td>';
-
-            echo '<td>' . $experiment['expValue']['applicationInterface']->applicationName
. '</td>';
-
-            echo '<td>' . $resource . '</td>';
+        <table class="table">
+            <tr>
+                <th>Name</th>
+                <th>Application</th>
+                @if( isset($dashboard))
+                    <th>User</th>
+                @endif
+                <!--<th>Description</th>-->
+                <th>Resource</th>
+                <th>Creation Time</th>
+                <th>Status</th>
+                <!--                    <select class="form-control select-status">-->
+                <!--                        <option value="ALL">Status</option>-->
+                <!--                    @foreach( $expStates as $index => $state)-->
+                <!--                        <option value="{{ $state }}">{{ $state
}}</option>-->
+                <!--                    @endforeach-->
+                <!--                    </select>-->
+                <!--                </th>-->
+            </tr>
 
-            //echo "<td>$computeResource->hostName</td>";
-            echo '<td class="time" unix-time="' . $experiment['experiment']->creationTime
/ 1000 . '"></td>';
+            @foreach($expContainer as $experiment)
+                <tr>
+                    <!-- Experiment Name -->
+                    <td> 
+                        {{ $experiment['experiment']->name }} 
+                        @if( $experiment['expValue']['editable'])
+                            <a href="{{URL::to('/')}}/experiment/edit?expId={{$experiment['experiment']->experimentId}}"
title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>
+                        @endif
+                    </td>
+                    <!-- Application Name -->
+                    <td>{{ $experiment['expValue']['applicationInterface']->applicationName
}}</td>
+                    <!-- User Names visible to admin -->
+                @if( isset($dashboard))
+                    <td>{{$experiment['experiment']->userName}}</td>
+                @endif
+                    <!-- Resource Name -->
+                    <td>
+                        @if( !empty( explode("_", $experiment['experiment']->resourceHostId)[0]
) ) 
+                            {{ explode("_", $experiment['experiment']->resourceHostId)[0]
}}
+                        @endif
+                    </td>
 
+                    <td class="time" unix-time="{{ $experiment['experiment']->creationTime
/ 1000 }}"></td>
 
-            switch ($experiment['expValue']['experimentStatusString']) {
-                case 'CANCELING':
-                case 'CANCELED':
-                case 'UNKNOWN':
-                    $textClass = 'text-warning';
-                    break;
-                case 'FAILED':
-                    $textClass = 'text-danger';
-                    break;
-                case 'COMPLETED':
-                    $textClass = 'text-success';
-                    break;
-                default:
-                    $textClass = 'text-info';
-                    break;
-            }
+                <?php
 
-            ?>
-            <td>
-                <a class="<?php echo $textClass; ?>"
-                   href="{{ URL::to('/') }}/experiment/summary?expId=<?php echo $experiment['experiment']->experimentId;
?>">
-                    <?php echo $experiment['expValue']['experimentStatusString']; ?>
-                </a>
-            </td>
+                switch ($experiment['expValue']['experimentStatusString']) {
+                    case 'CANCELING':
+                    case 'CANCELED':
+                    case 'UNKNOWN':
+                        $textClass = 'text-warning';
+                        break;
+                    case 'FAILED':
+                        $textClass = 'text-danger';
+                        break;
+                    case 'COMPLETED':
+                        $textClass = 'text-success';
+                        break;
+                    default:
+                        $textClass = 'text-info';
+                        break;
+                }
 
-            </tr>
+                ?>
+                <td>
+                    <a class="{{$textClass}}"
+                       href="{{ URL::to('/') }}/experiment/summary?expId={{$experiment['experiment']->experimentId
}}">
+                        {{$experiment['expValue']['experimentStatusString'] }}
+                    </a>
+                </td>
 
-        <?php
-        }
-        }
-        }
-        ?>
-    </table>
-</div>
\ No newline at end of file
+                </tr>
+            @endforeach
+           
+        </table>
+    </div>
+    @endif
+@endif
\ No newline at end of file


Mime
View raw message