Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 16AD118A6F for ; Wed, 24 Feb 2016 19:15:15 +0000 (UTC) Received: (qmail 99527 invoked by uid 500); 24 Feb 2016 19:15:05 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 99482 invoked by uid 500); 24 Feb 2016 19:15:05 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 99473 invoked by uid 99); 24 Feb 2016 19:15:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2016 19:15:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 26505E8EBD; Wed, 24 Feb 2016 19:15:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ndoshi@apache.org To: commits@airavata.apache.org Message-Id: <887f187d017e422e903f4dbc23c34400@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: airavata-php-gateway git commit: Gateway usage reporting feature added. Date: Wed, 24 Feb 2016 19:15:05 +0000 (UTC) Repository: airavata-php-gateway Updated Branches: refs/heads/develop 282e5b2c4 -> 0b2aa107e Gateway usage reporting feature 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/0b2aa107 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/0b2aa107 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/0b2aa107 Branch: refs/heads/develop Commit: 0b2aa107e6192a6d1a4d2ac8259cf6451d056401 Parents: 282e5b2 Author: Nipurn Doshi Authored: Wed Feb 24 14:14:26 2016 -0500 Committer: Nipurn Doshi Committed: Wed Feb 24 14:14:26 2016 -0500 ---------------------------------------------------------------------- app/controllers/ComputeResourceController.php | 18 ++++++++++ .../compute-resource-preferences.blade.php | 13 +++++++ app/views/resource/edit.blade.php | 38 +++++++++++++++++++- public/css/bootstrap.min.css | 6 +++- public/js/script.js | 16 +++++++++ 5 files changed, 89 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0b2aa107/app/controllers/ComputeResourceController.php ---------------------------------------------------------------------- diff --git a/app/controllers/ComputeResourceController.php b/app/controllers/ComputeResourceController.php index b930367..d258c2d 100755 --- a/app/controllers/ComputeResourceController.php +++ b/app/controllers/ComputeResourceController.php @@ -168,6 +168,24 @@ class ComputeResourceController extends BaseController $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true); return 1; //currently done by ajax. + } else if (Input::get("cr-edit") == "enableReporting") { + $inputs = Input::all(); + $computeDescription = CRUtilities::get_compute_resource(Input::get("crId")); + //var_dump( $computeDescription); exit; + if( isset( $inputs["gatewayUsageReporting"]) && $inputs["gatewayUsageReporting"] == 1){ + $computeDescription->gatewayUsageReporting = true; + $computeDescription->gatewayUsageModuleLoadCommand = $inputs["gatewayUsageModuleLoadCommand"]; + $computeDescription->gatewayUsageExecutable = $inputs["gatewayUsageExecutable"]; + + } + else{ + $computeDescription->gatewayUsageReporting = false; + $computeDescription->gatewayUsageModuleLoadCommand = null; + $computeDescription->gatewayUsageExecutable = null; + } + //var_dump( $computeDescription); exit; + $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true); + $tabName = "#tab-reporting"; } return Redirect::to("cr/edit?crId=" . Input::get("crId") . $tabName); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0b2aa107/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 b31cb25..63413c2 100644 --- a/app/views/partials/compute-resource-preferences.blade.php +++ b/app/views/partials/compute-resource-preferences.blade.php @@ -105,6 +105,19 @@ --> + +@if( isset( $computeResource->gatewayUsageReporting ) && $computeResource->gatewayUsageReporting == true) +
+ + +
+ + Enter Id of the Gateway using this resource if it requires reporting its usage back to the resource. +
+
+@endif + @if(Session::has("admin"))
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0b2aa107/app/views/resource/edit.blade.php ---------------------------------------------------------------------- diff --git a/app/views/resource/edit.blade.php b/app/views/resource/edit.blade.php index 1d44e3e..ee90041 100644 --- a/app/views/resource/edit.blade.php +++ b/app/views/resource/edit.blade.php @@ -14,7 +14,7 @@
-
+ @@ -510,6 +511,41 @@
+
+ +
+ + + +
+
+ gatewayUsageReporting == true) checked value="1" @else value="0" @endif> + +
+ +
+ +
+
+ + gatewayUsageReporting != true) disabled @endif/> +
+
+ + gatewayUsageReporting != true) disabled @endif/> +
+
+
+ +
+ +
+ +
+ +
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0b2aa107/public/css/bootstrap.min.css ---------------------------------------------------------------------- diff --git a/public/css/bootstrap.min.css b/public/css/bootstrap.min.css index 382fb66..9be6b94 100644 --- a/public/css/bootstrap.min.css +++ b/public/css/bootstrap.min.css @@ -58,4 +58,8 @@ body{ .navbar{ margin-bottom: 0; -} \ No newline at end of file +} + +.tab-content>.tab-pane { + margin-top: 10%; + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0b2aa107/public/js/script.js ---------------------------------------------------------------------- diff --git a/public/js/script.js b/public/js/script.js index 6f013df..d00547f 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -344,5 +344,21 @@ $(document).ready( function(){ }); + $(".enable-gateway-check").change( function(){ + var reportingCheckbox = this; + if( reportingCheckbox.checked ){ + $(reportingCheckbox).val(1); + $(".gateway-commands").find("input").each( function( i,e){ + $(e).removeAttr("disabled"); + $(e).removeAttr("readonly"); + }); + } + else{ + $(reportingCheckbox).val(0); + disableInputs( $(".gateway-commands")); + } + + }) + }); \ No newline at end of file