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 2015/12/11 19:31:05 UTC
[3/6] airavata-php-gateway git commit: Add gateway functionality
added for super admin Edit gateway ui commented until backend added
Add gateway functionality added for super admin
Edit gateway ui commented until backend 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/7a9ad93e
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/7a9ad93e
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/7a9ad93e
Branch: refs/heads/master
Commit: 7a9ad93e0693321873f2273f7c4efbdad8289803
Parents: 2460196
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Fri Dec 11 12:30:13 2015 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Fri Dec 11 12:30:13 2015 -0500
----------------------------------------------------------------------
app/views/admin/manage-gateway.blade.php | 148 ++++++++++++++--------
app/views/partials/dashboard-block.blade.php | 4 +-
2 files changed, 98 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7a9ad93e/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 621ac4e..380e76b 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -31,10 +31,57 @@
<h3>Gateway Preferences</h3>
</div>
@if( Session::has("scigap_admin"))
- <div class="col-md-6" style="margin-top:3.5%">
+ <div class="col-md-6" style="margin-top:2%">
<input type="text" class="col-md-12 filterinput" placeholder="Search by Gateway Name"/>
</div>
- @endif
+ <form id="add-tenant-form" action="{{ URL::to("/") }}/admin/add-gateway">
+ <div class="col-md-12">
+ <button type="button" class="btn btn-default toggle-add-tenant"><span
+ class="glyphicon glyphicon-plus"></span>Add a new gateway
+ </button>
+ </div>
+ <div class="add-tenant col-md-6">
+ <div class="form-group required">
+ <label class="control-label">Enter Domain Name</label>
+ <input type="text" name="domain" class="form-control" required="required"/>
+ </div>
+ <div class="form-group required">
+ <label class="control-label">Enter Desired Gateway Name</label>
+ <input type="text" name="gatewayName" class="form-control" required="required"/>
+ </div>
+ <div class="form-group required">
+ <label class="control-label">Enter Admin Email Address</label>
+ <input type="text" name="admin-email" class="form-control" required="required"/>
+ </div>
+ <div class="form-group required">
+ <label class="control-label">Enter Admin First Name</label>
+ <input type="text" name="admin-firstname" class="form-control" required="required"/>
+ </div>
+ <div class="form-group required">
+ <label class="control-label">Enter Admin Last Name</label>
+ <input type="text" name="admin-lastname" class="form-control" required="required"/>
+ </div>
+ <div class="form-group required">
+ <label class="control-label">Enter Admin Username</label>
+ <input type="text" name="admin-username" class="form-control" required="required"/>
+ </div>
+ <div class="form-group required">
+ <label class="control-label">Enter Admin Password</label>
+ <input type="password" name="admin-password" class="form-control" required="required"/>
+ </div>
+ <div class="form-group required">
+ <label class="control-label">Re-enter Admin Password</label>
+ <input type="password" name="admin-password-confirm" class="form-control" required="required"/>
+ </div>
+ <div class="form-group required">
+ <input type="submit" class="col-md-2 form-control btn btn-primary" value="Register"/>
+ </div>
+ </div>
+ <div class="col-md-6 loading-gif hide"><img src='{{URL::to('/')}}/assets/ajax-loader.gif'/></div>
+ <div class="col-md-6 alert alert-danger gateway-error hide"></div>
+ <div class="col-md-6 alert alert-success gateway-success hide"></div>
+ </form>
+ @endif
</div>
<div class="panel-group" id="accordion2">
@foreach( $gateways as $indexGP => $gp )
@@ -46,11 +93,14 @@
{{ $gp->gatewayName }}
</a>
@if(Session::has("admin"))
+ <!-- Backend needs to be added for this
+
<div class="pull-right col-md-2 gateway-options fade">
<span class="glyphicon glyphicon-pencil edit-gateway" style="cursor:pointer;"
data-toggle="modal" data-target="#edit-gateway-block"
data-gp-id="{{ $gp->gatewayId }}" data-gp-name="{{ $gp->gatewayName }}"></span>
</div>
+ -->
@endif
</h4>
</div>
@@ -233,56 +283,8 @@
</div>
</div>
</div>
- </div>
@endforeach
- @if( Session::has("scigap_admin"))
- <form id="add-tenant-form" action="{{ URL::to("/") }}/admin/add-gateway">
- <div class="col-md-12">
- <button type="button" class="btn btn-default toggle-add-tenant"><span
- class="glyphicon glyphicon-plus"></span>Add a new gateway
- </button>
- </div>
- <div class="add-tenant col-md-6">
- <div class="form-group required">
- <label class="control-label">Enter Domain Name</label>
- <input type="text" name="domain" class="form-control" required="required"/>
- </div>
- <div class="form-group required">
- <label class="control-label">Enter Desired Gateway Name</label>
- <input type="text" name="gatewayName" class="form-control" required="required"/>
- </div>
- <div class="form-group required">
- <label class="control-label">Enter Admin Email Address</label>
- <input type="text" name="admin-email" class="form-control" required="required"/>
- </div>
- <div class="form-group required">
- <label class="control-label">Enter Admin First Name</label>
- <input type="text" name="admin-firstname" class="form-control" required="required"/>
- </div>
- <div class="form-group required">
- <label class="control-label">Enter Admin Last Name</label>
- <input type="text" name="admin-lastname" class="form-control" required="required"/>
- </div>
- <div class="form-group required">
- <label class="control-label">Enter Admin Username</label>
- <input type="text" name="admin-username" class="form-control" required="required"/>
- </div>
- <div class="form-group required">
- <label class="control-label">Enter Admin Password</label>
- <input type="password" name="admin-password" class="form-control" required="required"/>
- </div>
- <div class="form-group required">
- <label class="control-label">Re-enter Admin Password</label>
- <input type="password" name="admin-password-confirm" class="form-control" required="required"/>
- </div>
- <div class="form-group required">
- <input type="submit" class="col-md-2 form-control btn btn-primary" value="Register"/>
- </div>
- </div>
- <div class="col-md-6 alert alert-danger gateway-error hide">
- </div>
- </form>
- @endif
+ </div>
</div>
</div>
<!-- /.container-fluid -->
@@ -342,6 +344,22 @@
</div>
</div>
+<!-- Add a Gateway -->
+<div class="modal fade" id="add-gateway-loading" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+ aria-hidden="true" data-backdrop="static">
+<div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h3 class="text-center">Registering the gateway</h3>
+ </div>
+ <div class="modal-body text-center">
+ <h5>Please DO NOT reload the page. This can take a couple of minutes.</h5>
+ <img src="{{URL::to('/')}}/assets/ajax-loader.gif"/>
+ </div>
+ </div>
+ </div>
+</div>
+
<!-- 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))
@@ -357,7 +375,7 @@
<script>
//make first tab of accordion open by default.
//temporary fix
- $("#accordion2").children(".panel").children(".collapse").addClass("in");
+ $("#accordion2 #collapse-gateway-0").addClass("in");
$(".credential-store-token-change > form").submit( function(e){
$(this).prepend( "<img id='loading-gif' src='{{URL::to('/')}}/assets/ajax-loader.gif'/>");
@@ -387,5 +405,31 @@
$(".add-tenant").slideDown();
});
+ $("#add-tenant-form").submit(function (event) {
+ event.preventDefault();
+ event.stopPropagation();
+ var formData = $("#add-tenant-form").serialize();
+ $("#add-gateway-loading").modal("show");
+ $(".loading-gif").removeClass("hide");
+ $.ajax({
+ type: "POST",
+ data: formData,
+ url: '{{ URL::to("/") }}/admin/add-gateway',
+ success: function (data) {
+ $(".gateway-success").html("Gateway has been added. The page will be reloaded in a moment.").removeClass("hide");
+ setTimeout( function(){
+ location.reload();
+ }, 2000);
+ },
+ error: function( data){
+ var error = $.parseJSON( data.responseText);
+ $(".gateway-error").html(error.error.message).removeClass("hide");
+ }
+ }).complete(function () {
+ $("#add-gateway-loading").modal("hide");
+ $(".loading-gif").addClass("hide");
+ });
+ });
+
</script>
@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7a9ad93e/app/views/partials/dashboard-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/dashboard-block.blade.php b/app/views/partials/dashboard-block.blade.php
index 07c2f23..5b8c818 100644
--- a/app/views/partials/dashboard-block.blade.php
+++ b/app/views/partials/dashboard-block.blade.php
@@ -78,8 +78,8 @@
<li
@if( Session::has("admin-nav") && Session::get("admin-nav") == "gateway-prefs") class="active" @endif>
- <a class="dashboard-link" href="{{ URL::to('/')}}/admin/dashboard/gateway"><span class="glyphicon glyphicon-sort"></span> @if(
- Session::has("scigap_admin"))Gateways @else Gateway Preferences @endif</a>
+ <a class="dashboard-link" href="{{ URL::to('/')}}/admin/dashboard/gateway"><span class="glyphicon glyphicon-sort"></span>
+ Gateway Preferences</a>
</li>
<li