airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject [09/18] airavata-php-gateway git commit: AIRAVATA-2152 Only show unselected compute resources
Date Fri, 28 Oct 2016 20:04:55 GMT
AIRAVATA-2152 Only show unselected compute resources


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

Branch: refs/heads/develop
Commit: d7cffc616d271dc61c21a73954a7f8c0927e647a
Parents: 18a98fd
Author: Marcus Christie <machrist@iu.edu>
Authored: Wed Oct 19 17:06:00 2016 -0400
Committer: Marcus Christie <machrist@iu.edu>
Committed: Fri Oct 28 15:04:30 2016 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d7cffc61/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index bf069db..8e88e90 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -537,7 +537,9 @@ class AccountController extends BaseController
     }
 
     public function getComputeResources(){
+
         $userResourceProfile = URPUtilities::get_or_create_user_resource_profile();
+
         $allCRs = CRUtilities::getAllCRObjects();
         foreach( $allCRs as $index => $crObject)
         {
@@ -546,16 +548,20 @@ class AccountController extends BaseController
         // Add crDetails to each UserComputeResourcePreference
         foreach ($userResourceProfile->userComputeResourcePreferences as $index =>
$userCompResPref) {
             $userCompResPref->crDetails = $allCRsById[$userCompResPref->computeResourceId];
+            // To figure out the unselectedCRs, remove this compute resource from allCRsById
+            unset($allCRsById[$userCompResPref->computeResourceId]);
         }
+        $unselectedCRs = array_values($allCRsById);
+
         // TODO: actually get all of the user's credential store tokens, including description
         $tokens = array(
             $userResourceProfile->credentialStoreToken => "Default SSH Key"
         );
+
         return View::make("account/user-compute-resources", array(
             "userResourceProfile" => $userResourceProfile,
             "computeResources" => $allCRs,
-            // TODO: only show compute resources that user hasn't already configured with
an account
-            "unselectedCRs" => $allCRs,
+            "unselectedCRs" => $unselectedCRs,
             "tokens" => $tokens
         ));
     }


Mime
View raw message