airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [35/50] [abbrv] airavata-php-gateway git commit: Fixing wrong Store token appearing in preferences list.
Date Tue, 09 Feb 2016 15:56:03 GMT
Fixing wrong Store token appearing in preferences list.


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

Branch: refs/heads/master
Commit: b4c54fc81ee6608514c6be46157cd6f04affc262
Parents: 671314c
Author: Nipurn Doshi <nipunhere@gmail.com>
Authored: Tue Feb 2 15:39:38 2016 -0500
Committer: Nipurn Doshi <nipunhere@gmail.com>
Committed: Tue Feb 2 15:39:38 2016 -0500

----------------------------------------------------------------------
 app/views/gateway/browse.blade.php              |  2 +-
 .../compute-resource-preferences.blade.php      | 16 ++++----
 .../gateway-preferences-block.blade.php         | 41 ++++++++++++--------
 .../storage-resource-preferences.blade.php      | 16 ++++----
 public/js/gateway.js                            |  3 +-
 5 files changed, 46 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b4c54fc8/app/views/gateway/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/gateway/browse.blade.php b/app/views/gateway/browse.blade.php
index d7ebf06..31934f3 100644
--- a/app/views/gateway/browse.blade.php
+++ b/app/views/gateway/browse.blade.php
@@ -132,7 +132,7 @@
             <input type="hidden" name="gatewayId" id="gatewayId" value="">
 
             <div class="input-group">
-                <select name="computeResourceId" class="cr-select form-control">
+                <select name="computeResourceId" class="cr-select form-control" required>
                     <option value="">Select a compute Resource and set its preferences</option>
                     @foreach( (array)$computeResources as $index => $cr)
                     <option value="{{ $cr->computeResourceId}}">{{ $cr->hostName
}}</option>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b4c54fc8/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
index cc068f5..b31cb25 100644
--- a/app/views/partials/compute-resource-preferences.blade.php
+++ b/app/views/partials/compute-resource-preferences.blade.php
@@ -88,14 +88,16 @@
     <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>
+            @foreach( $tokens as $token => $publicKey)
+                <option value="{{$token}}" @if( $token == $preferences->resourceSpecificCredentialStoreToken)
selected @endif >{{$token}}</option>
+            @endforeach
             @else
-            <option value="">Select a Credential Token from Store</option>
+                <option value="">Select a Credential Token from Store</option>
+                @foreach( $tokens as $token => $publicKey)
+                <option value="{{$token}}">{{$token}}</option>
+                @endforeach
             @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"
@@ -104,8 +106,8 @@
     </div>
 </div>
 @if(Session::has("admin"))
-<div class="form-group">
-    <input type="submit" class="form-control btn btn-primary" value="Set preferences"/>
+<div class="form-group text-center">
+    <input type="submit" class="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/b4c54fc8/app/views/partials/gateway-preferences-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/gateway-preferences-block.blade.php b/app/views/partials/gateway-preferences-block.blade.php
index 9f6a6a3..d4e2aed 100644
--- a/app/views/partials/gateway-preferences-block.blade.php
+++ b/app/views/partials/gateway-preferences-block.blade.php
@@ -21,7 +21,6 @@
         <div class="panel-body">
             <div class="app-interface-block">
                 <div class="row">
-                     @if(Session::has("admin"))
                     <div class="col-md-10 credential-store-token-change">
                         <form>
                             <div class="form-group">
@@ -29,14 +28,16 @@
                                 <div class="col-md-9">
                                     <select class="form-control gateway-credential-store-token"
name="resourceSpecificCredentialStoreToken"  data-gpid="{{$gp->gatewayId}}" >
                                         @if( isset( $gp->profile->credentialStoreToken)
)
-                                        <option value="{{$gp->profile->credentialStoreToken}}">{{$gp->profile->credentialStoreToken}}</option>
+                                        @foreach( $tokens as $token => $publicKey)
+                                            <option value="{{$token}}" @if( $token ==
$gp->profile->credentialStoreToken) selected @endif>{{$token}}</option>
+                                        @endforeach
                                         @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>
+                                            <option value="{{$token}}">{{$token}}</option>
                                         @endforeach
+                                        @endif
+                                        <option value="">DO-NO-SET</option>
                                     </select>
                                     <!--
                                     <input type="text" name="resourceSpecificCredentialStoreToken"
 data-gpid="{{$gp->gatewayId}}" class="form-control credential-store-token"
@@ -49,19 +50,23 @@
                             </div>
                         </form>
                     </div>
-                    <div class="col-md-10">
+                </div>
+                    
+                <div class="col-md-10">
+
+
+                    <div class="row">
                         <button class="btn btn-default add-cr" data-gpid="{{$gp->gatewayId}}"><span
                                 class="glyphicon glyphicon-plus"></span> Add a Compute
Resource Preference
                         </button>
                     </div>
-                    @endif
-                </div>
-                    
-                <div class="col-md-10">
+
                     @if( isset( $gp->profile->computeResourcePreferences) )
+                    @if( count( (array)$gp->profile->computeResourcePreferences) >
0)
                     <div>
                         <h3>Compute Resource Preferences :</h3>
                     </div>
+                    @endif
                     <div class="accordion-inner">
                         <div class="panel-group" id="cr-{{$accName}}-{{$indexGP}}">
                             @foreach( (array)$gp->profile->computeResourcePreferences
as $indexCRP
@@ -113,10 +118,20 @@
                         </div>
                     </div>
                     @endif
+
+
+                    <div class="row">
+                        <button class="btn btn-default add-dsp" data-gpid="{{$gp->gatewayId}}"><span
+                                class="glyphicon glyphicon-plus"></span> Add a Storage
Resource Preference
+                        </button>
+                    </div>
+
                     @if( isset( $gp->profile->storagePreferences) )
+                    @if( count( (array)$gp->profile->storagePreferences) > 0)
                     <div>
                         <h3>Storage Resource Preferences :</h3>
                     </div>
+                    @endif
                     <div class="accordion-inner">
                         <div class="panel-group" id="cr-accordion-{{$indexGP}}">
                             @foreach( (array)$gp->profile->storagePreferences as $indexSRP
@@ -171,12 +186,6 @@
                 </div>
 
                 <div class="col-md-10">
-                    <button class="btn btn-default add-dsp" data-gpid="{{$gp->gatewayId}}"><span
-                            class="glyphicon glyphicon-plus"></span> Add a Data
Storage Preference
-                    </button>
-                </div>
-
-                <div class="col-md-10">
                     @if( isset( $gp->profile->dataStoragePreferences) )
                     <div>
                         <h3>Data Storage Preferences :</h3>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b4c54fc8/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
index 9a18533..632d6a4 100644
--- a/app/views/partials/storage-resource-preferences.blade.php
+++ b/app/views/partials/storage-resource-preferences.blade.php
@@ -40,14 +40,16 @@ dmi preference might be needed in the future
     <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>
+            @foreach( $tokens as $token => $publicKey)
+                <option value="{{$token}}" @if( $token == $preferences->resourceSpecificCredentialStoreToken)
selected @endif >{{$token}}</option>
+            @endforeach
             @else
-            <option value="">Select a Credential Token from Store</option>
+                <option value="">Select a Credential Token from Store</option>
+                @foreach( $tokens as $token => $publicKey)
+                <option value="{{$token}}">{{$token}}</option>
+                @endforeach
             @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"
@@ -57,8 +59,8 @@ dmi preference might be needed in the future
 </div>
 
 @if(Session::has("admin"))
-<div class="form-group">
-    <input type="submit" class="form-control btn btn-primary" value="Set preferences"/>
+<div class="form-group text-center">
+    <input type="submit" class="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/b4c54fc8/public/js/gateway.js
----------------------------------------------------------------------
diff --git a/public/js/gateway.js b/public/js/gateway.js
index 9f14209..1a53f85 100644
--- a/public/js/gateway.js
+++ b/public/js/gateway.js
@@ -29,7 +29,8 @@ $(document).ready(function () {
 
 	    //remove Compute Resource
 	    $("body").on("click", ".remove-cr", function(){
-			$(this).parent().remove();
+			$(this).parent().parent().parent().remove();
+			$(this).parent().parent().parent().find(".pref-space").html("");
 		});
 
 


Mime
View raw message