airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [06/50] [abbrv] airavata-php-gateway git commit: Ongoing changes for storage resources and gateway preferences
Date Thu, 14 Jan 2016 15:43:02 GMT
Ongoing changes for storage resources and gateway preferences


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

Branch: refs/heads/develop
Commit: de1ae7c51cb68db03b1ef793515c8c7d46f8294e
Parents: dff6b47
Author: Nipurn Doshi <nipunhere@gmail.com>
Authored: Sun Dec 13 10:44:30 2015 -0500
Committer: Nipurn Doshi <nipunhere@gmail.com>
Committed: Sun Dec 13 10:44:30 2015 -0500

----------------------------------------------------------------------
 app/controllers/AdminController.php             |   3 +
 app/libraries/CRUtilities.php                   |   3 +
 app/views/admin/manage-gateway.blade.php        |  73 +++++++++---
 .../compute-resource-preferences.blade.php      | 111 +++++++++++++++++++
 .../partials/gateway-preferences.blade.php      | 111 -------------------
 .../storage-resource-preferences.blade.php      |  64 +++++++++++
 6 files changed, 238 insertions(+), 127 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/de1ae7c5/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index a674307..5b85235 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -56,12 +56,15 @@ class AdminController extends BaseController {
 		$crData = CRUtilities::getEditCRData();
 		$gateways = CRUtilities::getAllGatewayProfilesData();
 		$tokens = AdminUtilities::get_all_ssh_tokens();
+		$srData = SRUtilities::getEditSRData();
 
 		//$dsData = CRUtilities::getAllDataStoragePreferences( $gateways);
 		$gatewayData = array( 
 								"gateways" => $gateways, 
 								"computeResources" => CRUtilities::getAllCRObjects(),
 								"crData" => $crData,
+								"storageResources" => SRUtilities::getAllSRObjects(),
+								"srData" => $srData,
 								"tokens" => $tokens
 							);
 		$view = "admin/manage-gateway";

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/de1ae7c5/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index c8f40fa..2e21829 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -459,6 +459,9 @@ class CRUtilities
                     foreach ((array)$gp->computeResourcePreferences as $i => $crp)
{
                         $gatewayProfiles[$index]->computeResourcePreferences[$i]->crDetails
= Airavata::getComputeResource(Session::get('authz-token'), $crp->computeResourceId);
                     }
+                    foreach( (array)$gp->storagePreferences as $j => $srp){
+                        $gatewayProfiles[$index]->storagePreferences[$j]->srDetails
= Airavata::getStorageResource( Session::get('authz-token'), $srp->storageResourceId);
+                    }
                     $gateways[$key]->profile = $gatewayProfiles[$index];
                 }
             }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/de1ae7c5/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 2a105e6..3ccc9b5 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -186,7 +186,7 @@
                                                                            value="{{$crp->computeResourceId}}">
 
                                                                     <div class="form-horizontal">
-                                                                        @include('partials/gateway-preferences',
+                                                                        @include('partials/compute-resource-preferences',
                                                                         array('computeResource'
=> $crp->crDetails,
                                                                         'crData' => $crData,
'preferences'=>$crp,
                                                                         'show'=>true))
@@ -200,20 +200,61 @@
                                             </div>
                                         </div>
                                         @endif
-                                        <!--
-                                        Adding a user as admin will shift to roles. Removing
from here.
-                                        <h4><span class="glyphicon glyphicon-plus"></span>
Add a user as Admin to this Gateway</h4>
-                                        <form action="{{URL::to('/')}}/admin/addgatewayadmin"
method="POST" role="form" enctype="multipart/form-data">
-                                            <div class="form-group required">
-                                                <label for="experiment-name" class="control-label">Enter
Username</label>
-                                                <input type="text" class="form-control"
name="username" id="experiment-name" placeholder="username" autofocus required="required">
-                                                <input type="hidden" name="gateway_name"
value="{{ $gp->gatewayName }}"/>
-                                            </div>
-                                            <div class="btn-toolbar">
-                                                <input name="add" type="submit" class="btn
btn-primary" value="Add Admin"/>
+                                        @if( isset( $gp->profile->storagePreferences)
)
+                                        <div>
+                                            <h3>Storage Resource Preferences :</h3>
+                                        </div>
+                                        <div class="accordion-inner">
+                                            <div class="panel-group" id="accordion-{{$indexGP}}">
+                                                @foreach( (array)$gp->profile->storagePreferences
as $indexSRP
+                                                => $srp )
+                                                <div class="panel panel-default">
+                                                    <div class="panel-heading">
+                                                        <h4 class="panel-title">
+                                                            <a class="accordion-toggle
collapsed gateway-name"
+                                                               data-toggle="collapse" data-parent="#accordion"
+                                                               href="#collapse-srp-{{$indexGP}}-{{$indexSRP}}">
+                                                                {{ $srp->srDetails->hostName
}}
+                                                            </a>
+                                                            @if(Session::has("admin"))
+                                                            <div class="pull-right col-md-2
gateway-options fade">
+                                                                <span class="glyphicon
glyphicon-remove remove-storage-resource"
+                                                                      style="cursor:pointer;"
data-toggle="modal"
+                                                                      data-target="#remove-storage-resource-block"
+                                                                      data-sr-name="{{$srp->srDetails->hostName}}"
+                                                                      data-sr-id="{{$srp->storageResourceId}}"
+                                                                      data-sr-id="{{ $gp->gatewayId
}}"></span>
+                                                            </div>
+                                                            @endif
+                                                        </h4>
+                                                    </div>
+                                                    <div id="collapse-srp-{{$indexGP}}-{{$indexSRP}}"
+                                                         class="panel-collapse collapse">
+                                                        <div class="panel-body">
+                                                            <div class="app-compute-resource-preferences-block">
+                                                                <form action="{{URL::to('/')}}/gp/update-srp"
+                                                                      method="POST">
+                                                                    <input type="hidden"
name="gatewayId" id="gatewayId"
+                                                                           value="{{$gp->gatewayId}}">
+                                                                    <input type="hidden"
name="storageResourceId"
+                                                                           id="gatewayId"
+                                                                           value="{{$crp->storageResourceId}}">
+
+                                                                    <div class="form-horizontal">
+                                                                        @include('partials/storage-resource-preferences',
+                                                                        array('storageResource'
=> $srp->srDetails,
+                                                                        'srData' => $srData,
'preferences'=>$srp,
+                                                                        'show'=>true))
+                                                                    </div>
+                                                                </form>
+                                                            </div>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                                @endforeach
                                             </div>
-                                        </form>
-                                        -->
+                                        </div>
+                                        @endif
                                     </div>
 
                                     <div class="col-md-10">
@@ -264,7 +305,7 @@
                                                                            value="{{$crp->dataMovememtResourceId}}">
 
                                                                     <div class="form-horizontal">
-                                                                        @include('partials/gateway-preferences',
+                                                                        @include('partials/compute-resource-preferences',
                                                                         array('computeResource'
=> $crp->crDetails,
                                                                         'crData' => $crData,
'preferences'=>$crp,
                                                                         'show'=>true))
@@ -363,7 +404,7 @@
 
 <!-- contains all compute resource choices that might get selected on adding a new one
to a gateway -->
 @foreach( (array)$computeResources as $index => $cr)
-@include('partials/gateway-preferences', array('computeResource' => $cr, 'crData' =>
$crData))
+@include('partials/compute-resource-preferences', array('computeResource' => $cr, 'crData'
=> $crData))
 @endforeach
 
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/de1ae7c5/app/views/partials/compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/compute-resource-preferences.blade.php b/app/views/partials/compute-resource-preferences.blade.php
new file mode 100644
index 0000000..cc068f5
--- /dev/null
+++ b/app/views/partials/compute-resource-preferences.blade.php
@@ -0,0 +1,111 @@
+<!-- String replace is done as Jquery creates problems when using period(.) in id or class.
-->
+<div id="cr-{{ str_replace( '.', "_", $computeResource->computeResourceId) }}" class="@if(isset(
$show) ) @if( !$show) hide @endif @else hide @endif">
+<h3 class="text-center">Set Preferences</h3>
+<div class="form-group">
+    <label class="control-label col-md-3">Override by Airavata</label>
+
+    <div class="col-md-9">
+        <select class="form-control" name="overridebyAiravata">
+            <option value="1"
+            @if( isset( $preferences) ) @if( 1 == $preferences->overridebyAiravata) selected
@endif @endif>True</option>
+            <option value="0"
+            @if( isset( $preferences) ) @if( 0 == $preferences->overridebyAiravata) selected
@endif
+            @endif>False</option>
+        </select>
+    </div>
+</div><br/>
+<div class="form-group">
+    <label class="control-label col-md-3">Login Username</label>
+
+    <div class="col-md-9">
+        <input type="text" name="loginUserName" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->loginUserName}}@endif"/>
+    </div>
+</div>
+<div class="form-group">
+    <label class="control-label col-md-3">Preferred Job Submission Protocol</label>
+
+    <div class="col-md-9">
+        <select name="preferredJobSubmissionProtocol" class="form-control">
+            @foreach( (array)$computeResource->jobSubmissionInterfaces as $index =>
$jsi)
+            <option value="{{$jsi->jobSubmissionProtocol}}"
+            @if( isset( $preferences) ) @if( $preferences->preferredJobSubmissionProtocol
==
+            $jsi->jobSubmissionProtocol) selected @endif @endif>{{
+            $crData["jobSubmissionProtocols"][$jsi->jobSubmissionProtocol] }}</option>
+            @endforeach
+        </select>
+
+    </div>
+</div>
+<br/>
+<div class="form-group">
+    <label class="control-label col-md-3">Preferred Data Movement Protocol</label>
+
+    <div class="col-md-9">
+        <select name="preferredDataMovementProtocol" class="form-control">
+            @foreach( (array)$computeResource->dataMovementInterfaces as $index =>
$dmi)
+            <option value="{{ $dmi->dataMovementProtocol}}"
+            @if( isset( $preferences) ) @if( $preferences->preferredDataMovementProtocol
== $dmi->dataMovementProtocol)
+            selected @endif @endif>{{ $crData["dataMovementProtocols"][$dmi->dataMovementProtocol]
}}</option>
+            @endforeach
+        </select>
+    </div>
+</div>
+<div class="form-group">
+    <label class="control-label col-md-3">Preferred Batch Queue</label>
+
+    <div class="col-md-9">
+        <select name="preferredBatchQueue" class="form-control">
+            @foreach( (array)$computeResource->batchQueues as $index => $queue)
+            <option value="{{ $queue->queueName}}"
+            @if( isset( $preferences) ) @if( $preferences->preferredBatchQueue == $queue->queueName)
selected @endif
+            @endif>{{ $queue->queueName}}</option>
+            @endforeach
+        </select>
+    </div>
+</div>
+<div class="form-group">
+    <label class="control-label col-md-3">Scratch Location</label>
+
+    <div class="col-md-9">
+        <input type="text" name="scratchLocation" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->scratchLocation}}@endif"/>
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">Allocation Project Number</label>
+
+    <div class="col-md-9">
+        <input type="text" name="allocationProjectNumber" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->allocationProjectNumber}}@endif"/>
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">Resource Specific Credential Store Token</label>
+
+    <div class="col-md-9">
+        <select class="form-control gateway-credential-store-token" name="resourceSpecificCredentialStoreToken"
>
+            @if( isset( $preferences) )
+            <option value="{{$preferences->resourceSpecificCredentialStoreToken}}">{{$preferences->resourceSpecificCredentialStoreToken}}</option>
+            @else
+            <option value="">Select a Credential Token from Store</option>
+            @endif
+            <option value="">DO-NO-SET</option>
+            @foreach( $tokens as $token => $publicKey)
+            <option value="{{$token}}">{{$token}}</option>
+            @endforeach
+        </select>
+        <!--
+        <input type="text" name="resourceSpecificCredentialStoreToken" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->resourceSpecificCredentialStoreToken}}@endif"/>
+        -->
+    </div>
+</div>
+@if(Session::has("admin"))
+<div class="form-group">
+    <input type="submit" class="form-control btn btn-primary" value="Set preferences"/>
+</div>
+@endif
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/de1ae7c5/app/views/partials/gateway-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/gateway-preferences.blade.php b/app/views/partials/gateway-preferences.blade.php
deleted file mode 100644
index cc068f5..0000000
--- a/app/views/partials/gateway-preferences.blade.php
+++ /dev/null
@@ -1,111 +0,0 @@
-<!-- String replace is done as Jquery creates problems when using period(.) in id or class.
-->
-<div id="cr-{{ str_replace( '.', "_", $computeResource->computeResourceId) }}" class="@if(isset(
$show) ) @if( !$show) hide @endif @else hide @endif">
-<h3 class="text-center">Set Preferences</h3>
-<div class="form-group">
-    <label class="control-label col-md-3">Override by Airavata</label>
-
-    <div class="col-md-9">
-        <select class="form-control" name="overridebyAiravata">
-            <option value="1"
-            @if( isset( $preferences) ) @if( 1 == $preferences->overridebyAiravata) selected
@endif @endif>True</option>
-            <option value="0"
-            @if( isset( $preferences) ) @if( 0 == $preferences->overridebyAiravata) selected
@endif
-            @endif>False</option>
-        </select>
-    </div>
-</div><br/>
-<div class="form-group">
-    <label class="control-label col-md-3">Login Username</label>
-
-    <div class="col-md-9">
-        <input type="text" name="loginUserName" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->loginUserName}}@endif"/>
-    </div>
-</div>
-<div class="form-group">
-    <label class="control-label col-md-3">Preferred Job Submission Protocol</label>
-
-    <div class="col-md-9">
-        <select name="preferredJobSubmissionProtocol" class="form-control">
-            @foreach( (array)$computeResource->jobSubmissionInterfaces as $index =>
$jsi)
-            <option value="{{$jsi->jobSubmissionProtocol}}"
-            @if( isset( $preferences) ) @if( $preferences->preferredJobSubmissionProtocol
==
-            $jsi->jobSubmissionProtocol) selected @endif @endif>{{
-            $crData["jobSubmissionProtocols"][$jsi->jobSubmissionProtocol] }}</option>
-            @endforeach
-        </select>
-
-    </div>
-</div>
-<br/>
-<div class="form-group">
-    <label class="control-label col-md-3">Preferred Data Movement Protocol</label>
-
-    <div class="col-md-9">
-        <select name="preferredDataMovementProtocol" class="form-control">
-            @foreach( (array)$computeResource->dataMovementInterfaces as $index =>
$dmi)
-            <option value="{{ $dmi->dataMovementProtocol}}"
-            @if( isset( $preferences) ) @if( $preferences->preferredDataMovementProtocol
== $dmi->dataMovementProtocol)
-            selected @endif @endif>{{ $crData["dataMovementProtocols"][$dmi->dataMovementProtocol]
}}</option>
-            @endforeach
-        </select>
-    </div>
-</div>
-<div class="form-group">
-    <label class="control-label col-md-3">Preferred Batch Queue</label>
-
-    <div class="col-md-9">
-        <select name="preferredBatchQueue" class="form-control">
-            @foreach( (array)$computeResource->batchQueues as $index => $queue)
-            <option value="{{ $queue->queueName}}"
-            @if( isset( $preferences) ) @if( $preferences->preferredBatchQueue == $queue->queueName)
selected @endif
-            @endif>{{ $queue->queueName}}</option>
-            @endforeach
-        </select>
-    </div>
-</div>
-<div class="form-group">
-    <label class="control-label col-md-3">Scratch Location</label>
-
-    <div class="col-md-9">
-        <input type="text" name="scratchLocation" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->scratchLocation}}@endif"/>
-    </div>
-</div>
-
-<div class="form-group">
-    <label class="control-label col-md-3">Allocation Project Number</label>
-
-    <div class="col-md-9">
-        <input type="text" name="allocationProjectNumber" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->allocationProjectNumber}}@endif"/>
-    </div>
-</div>
-
-<div class="form-group">
-    <label class="control-label col-md-3">Resource Specific Credential Store Token</label>
-
-    <div class="col-md-9">
-        <select class="form-control gateway-credential-store-token" name="resourceSpecificCredentialStoreToken"
>
-            @if( isset( $preferences) )
-            <option value="{{$preferences->resourceSpecificCredentialStoreToken}}">{{$preferences->resourceSpecificCredentialStoreToken}}</option>
-            @else
-            <option value="">Select a Credential Token from Store</option>
-            @endif
-            <option value="">DO-NO-SET</option>
-            @foreach( $tokens as $token => $publicKey)
-            <option value="{{$token}}">{{$token}}</option>
-            @endforeach
-        </select>
-        <!--
-        <input type="text" name="resourceSpecificCredentialStoreToken" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->resourceSpecificCredentialStoreToken}}@endif"/>
-        -->
-    </div>
-</div>
-@if(Session::has("admin"))
-<div class="form-group">
-    <input type="submit" class="form-control btn btn-primary" value="Set preferences"/>
-</div>
-@endif
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/de1ae7c5/app/views/partials/storage-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/storage-resource-preferences.blade.php b/app/views/partials/storage-resource-preferences.blade.php
new file mode 100644
index 0000000..42b056b
--- /dev/null
+++ b/app/views/partials/storage-resource-preferences.blade.php
@@ -0,0 +1,64 @@
+<!-- String replace is done as Jquery creates problems when using period(.) in id or class.
-->
+<div id="sr-{{ str_replace( '.', "_", $storageResource->storageResourceId) }}" class="@if(isset(
$show) ) @if( !$show) hide @endif @else hide @endif">
+<h3 class="text-center">Set Preferences</h3>
+<div class="form-group">
+    <label class="control-label col-md-3">Login Username</label>
+
+    <div class="col-md-9">
+        <input type="text" name="loginUserName" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->loginUserName}}@endif"/>
+    </div>
+</div>
+<!--
+dmi preference might be needed in the future
+<div class="form-group">
+    <label class="control-label col-md-3">Preferred Data Movement Protocol</label>
+
+    <div class="col-md-9">
+        <select name="preferredDataMovementProtocol" class="form-control">
+            @foreach( (array)$computeResource->dataMovementInterfaces as $index =>
$dmi)
+            <option value="{{ $dmi->dataMovementProtocol}}"
+            @if( isset( $preferences) ) @if( $preferences->preferredDataMovementProtocol
== $dmi->dataMovementProtocol)
+            selected @endif @endif>{{ $crData["dataMovementProtocols"][$dmi->dataMovementProtocol]
}}</option>
+            @endforeach
+        </select>
+    </div>
+</div>
+-->
+<div class="form-group">
+    <label class="control-label col-md-3">File System Root Location</label>
+
+    <div class="col-md-9">
+        <input type="text" name="fileSystemRootLocation" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->fileSystemRootLocation}}@endif"/>
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">Resource Specific Credential Store Token</label>
+
+    <div class="col-md-9">
+        <select class="form-control gateway-credential-store-token" name="resourceSpecificCredentialStoreToken"
>
+            @if( isset( $preferences) )
+            <option value="{{$preferences->resourceSpecificCredentialStoreToken}}">{{$preferences->resourceSpecificCredentialStoreToken}}</option>
+            @else
+            <option value="">Select a Credential Token from Store</option>
+            @endif
+            <option value="">DO-NO-SET</option>
+            @foreach( $tokens as $token => $publicKey)
+            <option value="{{$token}}">{{$token}}</option>
+            @endforeach
+        </select>
+        <!--
+        <input type="text" name="resourceSpecificCredentialStoreToken" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->resourceSpecificCredentialStoreToken}}@endif"/>
+        -->
+    </div>
+</div>
+
+@if(Session::has("admin"))
+<div class="form-group">
+    <input type="submit" class="form-control btn btn-primary" value="Set preferences"/>
+</div>
+@endif
+</div>
\ No newline at end of file


Mime
View raw message