You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by nd...@apache.org on 2016/02/23 19:53:41 UTC
[1/2] airavata-php-gateway git commit: Cloning Application Interface
ability added.
Repository: airavata-php-gateway
Updated Branches:
refs/heads/master d2f6dd598 -> c047e65f5
Cloning Application Interface ability added.
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/5cbf2ec5
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/5cbf2ec5
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/5cbf2ec5
Branch: refs/heads/master
Commit: 5cbf2ec523ad4c8b384a03f8c8b8dcec3bf14427
Parents: d2f6dd5
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Tue Feb 23 13:49:54 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Tue Feb 23 13:49:54 2016 -0500
----------------------------------------------------------------------
app/controllers/ApplicationController.php | 12 +++++-
app/libraries/AppUtilities.php | 6 +++
app/routes.php | 7 ++++
app/views/application/interface.blade.php | 55 +++++++++++++++++++++++++-
public/js/interface.js | 10 +++++
5 files changed, 88 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5cbf2ec5/app/controllers/ApplicationController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ApplicationController.php b/app/controllers/ApplicationController.php
index 438ab15..7b33de0 100644
--- a/app/controllers/ApplicationController.php
+++ b/app/controllers/ApplicationController.php
@@ -81,7 +81,17 @@ class ApplicationController extends BaseController {
//var_dump( $appInterfaceValues); exit;
AppUtilities::create_or_update_appInterface( $appInterfaceValues);
- return Redirect::to( "app/interface")->with("message","Application Interface has been created");
+ return Redirect::to( "app/interface")->with("message","Application Interface <strong>" . $appInterfaceValues["applicationName"] . "</strong> has been created.");
+ }
+
+ public function cloneAppInterfaceSubmit()
+ {
+ $this->beforeFilter('verifyeditadmin');
+ $appInterfaceValues = Input::all();
+
+ AppUtilities::clone_appInterface( $appInterfaceValues);
+
+ return Redirect::to( "app/interface")->with("message","Clone Application Interface <strong>" . $appInterfaceValues["applicationName"] . "</strong> has been created.");
}
public function editAppInterfaceSubmit()
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5cbf2ec5/app/libraries/AppUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AppUtilities.php b/app/libraries/AppUtilities.php
index f4cd6c4..64a0d82 100644
--- a/app/libraries/AppUtilities.php
+++ b/app/libraries/AppUtilities.php
@@ -110,6 +110,12 @@ class AppUtilities
//print_r( "App interface has been created.");
}
+
+ public static function clone_appInterface($appInterfaceValues)
+ {
+ return Airavata::cloneApplicationInterface( Session::get("authz-token"), $appInterfaceValues["applicationInterfaceId"], $appInterfaceValues["applicationName"], Session::get("gateway_id") );
+ }
+
public static function deleteAppInterface($appInterfaceId)
{
if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5cbf2ec5/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 4a6b6ee..b419c61 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -43,6 +43,11 @@ Route::post("confirm-user-registration", "AccountController@confirmAccountCreati
Route::get("setUserTimezone", function () {
Session::set("user_timezone", Input::get("timezone"));
});
+
+Route::get("allocation-request", "AccountController@allocationRequestView");
+
+Route::post("allocation-request", "AccountController@allocationRequestSubmit");
+
/*
* The following routes will not work without logging in.
*
@@ -172,6 +177,8 @@ Route::get("app/interface", "ApplicationController@showAppInterfaceView");
Route::post("app/interface-create", "ApplicationController@createAppInterfaceSubmit");
+Route::post("app/interface-clone", "ApplicationController@cloneAppInterfaceSubmit");
+
Route::post("app/interface-edit", "ApplicationController@editAppInterfaceSubmit");
Route::post("app/interface-delete", "ApplicationController@deleteAppInterface");
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5cbf2ec5/app/views/application/interface.blade.php
----------------------------------------------------------------------
diff --git a/app/views/application/interface.blade.php b/app/views/application/interface.blade.php
index a78c523..2173300 100644
--- a/app/views/application/interface.blade.php
+++ b/app/views/application/interface.blade.php
@@ -51,12 +51,25 @@
<small>{{ $interface->applicationInterfaceId }}</small>
@if(Session::has("admin"))
<div class="pull-right col-md-2 interface-options fade">
+
<span class="glyphicon glyphicon-pencil edit-app-interface" style="cursor:pointer;"
data-toggle="modal" data-target="#edit-app-interface-block"
data-interface-id="{{ $interface->applicationInterfaceId }}"></span>
+
+ <span class="glyphicon glyphicon-file clone-app-interface" style="cursor:pointer;"
+ data-toggle="modal" data-target="#clone-app-interface-block"
+ data-interface-id="{{ $interface->applicationInterfaceId }}"></span>
+
+ <span class="glyphicon glyphicon-file clone-app-interface" style="cursor:pointer; position:relative; top:-2px; left:-10%;"
+ data-toggle="modal" data-target="#clone-app-interface-block"
+ data-interface-id="{{ $interface->applicationInterfaceId }}"
+ data-interface-name="{{ $interface->applicationName }}"></span>
+
<span class="glyphicon glyphicon-trash delete-app-interface" style="cursor:pointer;"
data-toggle="modal" data-target="#delete-app-interface-block"
- data-interface-id="{{ $interface->applicationInterfaceId }}"></span>
+ data-interface-id="{{ $interface->applicationInterfaceId }}"
+ data-interface-name="{{ $interface->applicationName }}"></span>
+
</div>
@endif
</h4>
@@ -154,6 +167,46 @@
</div>
</div>
+
+<div class="modal fade" id="clone-app-interface-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+ aria-hidden="true" data-backdrop="static">
+ <div class="modal-dialog">
+ <form action="{{URL::to('/')}}/app/interface-clone" method="POST" id="clone-app-interface-form">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
+ aria-hidden="true">×</span></button>
+ <h3 class="text-center">Clone Application Interface</h3>
+ </div>
+ <div class="modal-body row">
+ <div class="col-md-12">
+ <div class="clone-app-interface-block">
+ <div class="cloneAppInterfaceInputs">
+ <div class="form-group required">
+ <label class="control-label interface-name">Application Name</label>
+ <input type="text" class="form-control" name="applicationName" required placeholder="Cloned Application Interface Name" value=""/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Application chosen to be cloned</label>
+ <input type="text" disabled class="form-control" id="cloneAppName" value=""/>
+ <input type="hidden" class="form-control" id="cloneAppId" name="applicationInterfaceId" value=""/>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <div class="form-group">
+ <input type="submit" class="btn btn-primary submit-clone-app-interface-form" value="Clone"/>
+ <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+ </div>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+
<div class="modal fade" id="delete-app-interface-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
aria-hidden="true">
<div class="modal-dialog">
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5cbf2ec5/public/js/interface.js
----------------------------------------------------------------------
diff --git a/public/js/interface.js b/public/js/interface.js
index f99a4b9..9de1c21 100644
--- a/public/js/interface.js
+++ b/public/js/interface.js
@@ -80,6 +80,16 @@ $(document).ready( function(){
});
+ $(".clone-app-interface").click( function(){
+ clearInputs( $(".clone-app-interface-block"));
+ //$("#create-app-interface-block").modal("show");
+ //checking if app module select option exist and if not add one.
+ var interfaceId = $(this).data("interface-id");
+ var interfaceName = $(this).data("interface-name");
+ $("#cloneAppId").val( interfaceId);
+ $("#cloneAppName").val( interfaceName);
+ });
+
$(".submit-create-app-interface-form").click( function(){
//check if app interface contains atleast one app module selected.
if( $(this).parent().parent().parent().find(".app-module-select").length)
[2/2] airavata-php-gateway git commit: Committing Hackathon code for
Allocation Request.
Posted by nd...@apache.org.
Committing Hackathon code for Allocation Request.
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/c047e65f
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/c047e65f
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/c047e65f
Branch: refs/heads/master
Commit: c047e65f5a9873ba6f50f3ad9e35facb8771ec0a
Parents: 5cbf2ec
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Tue Feb 23 13:53:02 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Tue Feb 23 13:53:02 2016 -0500
----------------------------------------------------------------------
app/controllers/AccountController.php | 8 ++++++++
app/controllers/AdminController.php | 4 ++++
app/views/account/dashboard.blade.php | 10 ++++++++++
3 files changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c047e65f/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 2b16190..48ccf9e 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -432,4 +432,12 @@ class AccountController extends BaseController
return Redirect::to('home');
}
+ public function allocationRequestView(){
+ return View::make("account/request-allocation");
+ }
+
+ public function allocationRequestSubmit(){
+ return 'result';
+ }
+
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c047e65f/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index 0123ee5..a014a88 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -302,4 +302,8 @@ class AdminController extends BaseController {
$storageResource->enabled = false;
SRUtilities::register_or_update_storage_resource($storageResource, true);
}
+
+ public function viewAllocationRequests(){
+ return 'result';
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c047e65f/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php
index 9fc4b7a..0e1b3c6 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -216,6 +216,16 @@
</div>
</div>
@endif
+
+ <!--
+ Hidden until completed.
+ <div class="col-md-12 text-center">
+ <a href="{{URL::to('/')}}/allocation-request">
+ <button class="btn btn-default ">Request an allocation</button>
+ </a>
+ </div>
+ -->
+
</div>
@stop
\ No newline at end of file