You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by re...@apache.org on 2014/02/07 08:45:22 UTC
[1/2] git commit: fixing tenant activation and deletion
Updated Branches:
refs/heads/master 06181bc12 -> cede5e05b
fixing tenant activation and deletion
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/5b2fa4d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/5b2fa4d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/5b2fa4d9
Branch: refs/heads/master
Commit: 5b2fa4d9b9a36b51c64197b7461c46c5892c2aec
Parents: d6e4501
Author: rekathiru <rt...@gmail.com>
Authored: Fri Feb 7 13:09:40 2014 +0530
Committer: rekathiru <rt...@gmail.com>
Committed: Fri Feb 7 13:09:40 2014 +0530
----------------------------------------------------------------------
.../console/controllers/manageTenants.jag | 36 +++++++++++++++++---
.../console/themes/theme1/partials/header.hbs | 5 +++
.../themes/theme1/ui/js/tenant_management.js | 24 +++++++++----
.../console/util/utility.jag | 3 ++
4 files changed, 56 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5b2fa4d9/components/org.apache.stratos.manager.console/console/controllers/manageTenants.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/manageTenants.jag b/components/org.apache.stratos.manager.console/console/controllers/manageTenants.jag
index 64f4fca..ff4a7a0 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/manageTenants.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/manageTenants.jag
@@ -4,14 +4,40 @@
var utils = require('/util/utility.jag');
var tenantDomain = request.getParameter("foo").trim();
var state = request.getParameter("state").trim();
- //log.info("tenant domain: " + tenantDomain + " state is: " + state);
- if(state == "activate") {
- utils.consoleAppUtil.activateTenant(tenantDomain);
+ log.info("tenant domain: " + tenantDomain + " state is: " + state);
+
+ if(tenantDomain.indexOf("-") != -1) {
+ var array = new Array();
+ array = tenantDomain.split("-");
+ log.info(tenantDomain);
+
+ for(domain in array) {
+ if(state == "activate") {
+ utils.consoleAppUtil.activateTenant(array[domain].trim());
+ } else if(state == "deactivate") {
+ utils.consoleAppUtil.deactivateTenant(array[domain].trim());
+ } else if(state == "delete") {
+ utils.consoleAppUtil.deleteTenant(array[domain].trim());
+ }
+ }
response.sendRedirect(request.getContextPath() + '/tenant_management.jag');
- } else if(state == "deactivate") {
- utils.consoleAppUtil.deactivateTenant(tenantDomain);
+
+ } else {
+ log.info("not array: " + tenantDomain);
+
+ if(state == "activate") {
+ utils.consoleAppUtil.activateTenant(tenantDomain);
response.sendRedirect(request.getContextPath() + '/tenant_management.jag');
+ } else if(state == "deactivate") {
+ utils.consoleAppUtil.deactivateTenant(tenantDomain);
+ response.sendRedirect(request.getContextPath() + '/tenant_management.jag');
+ } else if(state == "delete") {
+ utils.consoleAppUtil.deleteTenant(tenantDomain);
+ response.sendRedirect(request.getContextPath() + '/tenant_management.jag');
+ }
}
+
+
}());
%>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5b2fa4d9/components/org.apache.stratos.manager.console/console/themes/theme1/partials/header.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/header.hbs b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/header.hbs
index 45ad5a8..5b7699f 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/header.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/header.hbs
@@ -319,5 +319,10 @@
{{/if}}
</div>
+<form action="{{url "/controllers/manageTenants.jag"}}" id="manageTenantsForm">
+<input type="hidden" value="" id="foo" name="foo" />
+<input type="hidden" value="" id="state" name="state" />
+</form>
+
{{/unless}}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5b2fa4d9/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/tenant_management.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/tenant_management.js b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/tenant_management.js
index aab3f8b..f3b8457 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/tenant_management.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/tenant_management.js
@@ -14,20 +14,30 @@ function manage_selected(action){
checked += " - ";
});
if(action == "activate"){
- alert('activate-' + checked);
- }else if(action == "deactivate"){
- alert('deactivate-' + checked);
- }else if(action == "delete"){
- alert('delete-' + checked);
+ $('#foo').val(checked);
+ $('#state').val(action);
+ $('#manageTenantsForm').submit();
+ //alert('activate-' + checked);
+ } else if(action == "deactivate"){
+ $('#foo').val(checked);
+ $('#state').val(action);
+ $('#manageTenantsForm').submit();
+ //alert('deactivate-' + checked);
+ } else if(action == "delete"){
+ $('#foo').val(checked);
+ $('#state').val(action);
+ $('#manageTenantsForm').submit();
+ //alert('delete-' + checked);
}
}
function manage_one(action,obj){
+
if(action == "activate"){
+ //alert('activate-' + $(obj).attr('data-domain'));
$('#foo').val($(obj).attr('data-domain'));
$('#state').val(action);
$('#manageTenantsForm').submit();
- //alert('activate-' + $(obj).attr('data-domain'));
- }else if(action == "deactivate"){
+ } else if(action == "deactivate"){
//alert('deactivate-' + $(obj).attr('data-domain'));
$('#foo').val($(obj).attr('data-domain'));
$('#state').val(action);
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5b2fa4d9/components/org.apache.stratos.manager.console/console/util/utility.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/util/utility.jag b/components/org.apache.stratos.manager.console/console/util/utility.jag
index 240f223..aa42396 100644
--- a/components/org.apache.stratos.manager.console/console/util/utility.jag
+++ b/components/org.apache.stratos.manager.console/console/util/utility.jag
@@ -109,6 +109,9 @@ consoleAppUtil = new function(){
return this.send("POST","/tenant/deactivate/" + tenantDomain,{}).data;
};
+ this.deleteTenant = function(tenantDomain){
+ return this.send("DELETE","/tenant/" + tenantDomain,{}).data;
+ };
this.deployPartitionDefinition = function(partitionDefinition){
return this.send("POST","/policy/deployment/partition",partitionDefinition).data;
[2/2] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-stratos
Posted by re...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/cede5e05
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/cede5e05
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/cede5e05
Branch: refs/heads/master
Commit: cede5e05be543165271a57f0d887cfd521eeb6c3
Parents: 5b2fa4d 06181bc
Author: rekathiru <rt...@gmail.com>
Authored: Fri Feb 7 13:14:17 2014 +0530
Committer: rekathiru <rt...@gmail.com>
Committed: Fri Feb 7 13:14:17 2014 +0530
----------------------------------------------------------------------
.../statistics/notifier/LoadBalancerStatisticsNotifier.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------