airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [31/50] [abbrv] airavata-php-gateway git commit: fixing cannot delete storage resource preferences
Date Thu, 14 Jan 2016 15:43:27 GMT
fixing cannot delete storage resource 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/58eb7bee
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/58eb7bee
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/58eb7bee

Branch: refs/heads/develop
Commit: 58eb7bee3ba8c9a03a3bc463225bc67c1a5c1433
Parents: be57aed
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Thu Jan 7 16:34:34 2016 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Thu Jan 7 16:34:34 2016 -0500

----------------------------------------------------------------------
 app/libraries/CRUtilities.php            | 12 ++++++++
 app/routes.php                           |  2 ++
 app/views/admin/manage-gateway.blade.php | 43 ++++++++++++++++++++++-----
 public/js/gateway.js                     |  7 ++++-
 4 files changed, 56 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/58eb7bee/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index 2e21829..0054d5a 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -509,6 +509,18 @@ class CRUtilities
         return Airavata::deleteGatewayComputeResourcePreference(Session::get('authz-token'),
$inputs["gpId"], $inputs["rem-crId"]);
     }
 
+    public static function deleteSR($inputs)
+    {
+        if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+            $id = $inputs["rem-srId"];
+            if (Cache::has('SR-' . $id)) {
+                Cache::forget('SR-' . $id);
+            }
+        }
+
+        return Airavata::deleteGatewayStoragePreference(Session::get('authz-token'), $inputs["gpId"],
$inputs["rem-srId"]);
+    }
+
     /**
      * Get the ComputeResourceDescription with the given ID
      * @param $id

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/58eb7bee/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 988cd1c..63e0df0 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -192,6 +192,8 @@ Route::post("gp/add-dsp", "GatewayprofileController@modifyDSP");
 
 Route::post("gp/update-dsp", "GatewayprofileController@modifyDSP");
 
+Route::post("gp/remove-sr", "GatewayprofileController@delete");
+
 Route::post("gp/credential-store-token-change", "GatewayprofileController@cstChange");
 
 //Management Dashboard

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/58eb7bee/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 438c063..222f2d5 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -163,9 +163,9 @@
                                                             </a>
                                                             @if(Session::has("admin"))
                                                             <div class="pull-right col-md-2
gateway-options fade">
-                                                                <span class="glyphicon
glyphicon-remove remove-resource"
+                                                                <span class="glyphicon
glyphicon-remove remove-compute-resource"
                                                                       style="cursor:pointer;"
data-toggle="modal"
-                                                                      data-target="#remove-resource-block"
+                                                                      data-target="#remove-compute-resource-block"
                                                                       data-cr-name="{{$crp->crDetails->hostName}}"
                                                                       data-cr-id="{{$crp->computeResourceId}}"
                                                                       data-gp-id="{{ $gp->gatewayId
}}"></span>
@@ -223,7 +223,7 @@
                                                                       data-target="#remove-storage-resource-block"
                                                                       data-sr-name="{{$srp->srDetails->hostName}}"
                                                                       data-sr-id="{{$srp->storageResourceId}}"
-                                                                      data-sr-id="{{ $gp->gatewayId
}}"></span>
+                                                                      data-gp-id="{{ $gp->gatewayId
}}"></span>
                                                             </div>
                                                             @endif
                                                         </h4>
@@ -283,9 +283,9 @@
                                                             </a>
                                                             @if(Session::has("admin"))
                                                             <div class="pull-right col-md-2
gateway-options fade">
-                                                                <span class="glyphicon
glyphicon-remove remove-resource"
+                                                                <span class="glyphicon
glyphicon-remove remove-storage-resource"
                                                                       style="cursor:pointer;"
data-toggle="modal"
-                                                                      data-target="#remove-resource-block"
+                                                                      data-target="#remove-storage-resource-block"
                                                                       data-dsp-id="{{$ds->computeResourceId}}"
                                                                       data-gp-id="{{ $gp->gatewayId
}}"></span>
                                                             </div>
@@ -376,7 +376,7 @@
 </div>
 
 <!-- Remove a Compute Resource from a Gateway -->
-<div class="modal fade" id="remove-resource-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+<div class="modal fade" id="remove-compute-resource-block" tabindex="-1" role="dialog"
aria-labelledby="add-modal"
      aria-hidden="true">
     <div class="modal-dialog">
 
@@ -389,7 +389,36 @@
                     <input type="hidden" class="form-control remove-crId" name="rem-crId"/>
                     <input type="hidden" class="form-control cr-gpId" name="gpId"/>
 
-                    Do you really want to remove the Compute Resource, <span class="remove-cr-name">
</span>from the
+                    Do you really want to remove the Compute Resource, <span class="remove-cr-name">
</span> from the
+                    selected Gateway?
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="submit" class="btn btn-danger" value="Remove"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal"
value="Cancel"/>
+                    </div>
+                </div>
+            </div>
+
+        </form>
+    </div>
+</div>
+
+<!-- Remove a Storage Resource from a Gateway -->
+<div class="modal fade" id="remove-storage-resource-block" tabindex="-1" role="dialog"
aria-labelledby="add-modal"
+     aria-hidden="true">
+    <div class="modal-dialog">
+
+        <form action="{{URL::to('/')}}/gp/remove-sr" method="POST">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h3 class="text-center">Remove Storage Resource Confirmation</h3>
+                </div>
+                <div class="modal-body">
+                    <input type="hidden" class="form-control remove-srId" name="rem-srId"/>
+                    <input type="hidden" class="form-control sr-gpId" name="gpId"/>
+
+                    Do you really want to remove the Storage Resource, <span class="remove-sr-name">
</span> from the
                     selected Gateway?
                 </div>
                 <div class="modal-footer">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/58eb7bee/public/js/gateway.js
----------------------------------------------------------------------
diff --git a/public/js/gateway.js b/public/js/gateway.js
index b8876c6..9f14209 100644
--- a/public/js/gateway.js
+++ b/public/js/gateway.js
@@ -70,10 +70,15 @@ $(document).ready(function () {
 			$(".delete-gpId").val( $(this).data("gp-id") );
 		});
 
-		$(".remove-resource").click( function(){
+		$(".remove-compute-resource").click( function(){
 			$(".remove-cr-name").html( $(this).data("cr-name") );
 			$(".remove-crId").val( $(this).data("cr-id") );
 			$(".cr-gpId").val( $(this).data("gp-id") );
 		});
 
+		$(".remove-storage-resource").click( function(){
+			$(".remove-sr-name").html( $(this).data("sr-name") );
+			$(".remove-srId").val( $(this).data("sr-id") );
+			$(".sr-gpId").val( $(this).data("gp-id") );
+		});
 });
\ No newline at end of file


Mime
View raw message