Repository: incubator-stratos
Updated Branches:
  refs/heads/master 5111de280 -> a627251a1


applying patch for STRATOS-472


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/a627251a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/a627251a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/a627251a

Branch: refs/heads/master
Commit: a627251a1bcd56d4c406b7e106e9b074a4b8a536
Parents: 5111de2
Author: rekathiru <[email protected]>
Authored: Tue Feb 25 17:51:43 2014 +0530
Committer: rekathiru <[email protected]>
Committed: Tue Feb 25 17:51:43 2014 +0530

----------------------------------------------------------------------
 .../partials/configure_stratos_wizard.hbs       |  2 +-
 .../themes/theme1/partials/mycartridges.hbs     |  2 +-
 .../themes/theme1/partials/tenant_new.hbs       |  8 ++--
 .../console/themes/theme1/ui/css/main.css       |  5 ++-
 .../console/themes/theme1/ui/js/mycartridges.js |  2 +-
 .../console/themes/theme1/ui/js/popup.js        |  1 +
 .../console/util/utility.jag                    | 41 ++++++++++++++++++++
 7 files changed, 53 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a627251a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/configure_stratos_wizard.hbs
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/configure_stratos_wizard.hbs
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/configure_stratos_wizard.hbs
index 788e912..b4d2dc5 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/configure_stratos_wizard.hbs
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/configure_stratos_wizard.hbs
@@ -48,7 +48,7 @@
         <div class="container" id="addItemSection">
             <div class="row">
                 <div class="col-md-12">
-                        <a href="{{url "/configure_stratos.jag"}}">Go to 
configuration page.</a>
+                        <a href="{{url "/cartridges.jag"}}">Subscribe to 
cartridges.</a>
                 </div>
             </div>
         </div>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a627251a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/mycartridges.hbs
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/mycartridges.hbs
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/mycartridges.hbs
index bf15e02..ada00c8 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/mycartridges.hbs
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/mycartridges.hbs
@@ -22,7 +22,7 @@
                     </div>
                     <div class="col-lg-9">
                         {{#unless loadBalancer}}
-                            <div class="un-subscribe-container"><a 
class="un-subscribe" id="unsubscribeBtn" 
data-alias="{{cartridgeAlias}}">Un-subscribe <i class="fa 
fa-times-circle-o"></i></a></div>
+                            <div class="un-subscribe-container"><a 
class="un-subscribe un-subscribe-btn" 
data-alias="{{cartridgeAlias}}">Un-subscribe <i class="fa 
fa-times-circle-o"></i></a></div>
                         {{/unless}}
                         <a href="{{url 
"/cartridge_info.jag?alias="}}{{cartridgeAlias}}"><h3>{{cartridgeAlias}}-<span>({{displayName}}
 - {{version}})</span></h3></a>
                         <div 
class="cartridge-description">{{description}}</div>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a627251a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs
index 58981e3..7130b11 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs
@@ -50,11 +50,12 @@
                 <div class="clearfix"></div>
                 <label class="required">Email:</label>
                 <input class="required" name="email" type="text"/>
-
+<!--
                 <label class="required">Are you human?</label>
                 <div style="padding-bottom:10px;"><i class="icons-help 
icons-small-size"></i> Type the characters you see in the picture below.</div>
                 <div class="clearfix"></div>
-                <input type="text"/>
+                <input type="text"/>-->
+<!--
 
                 <div class="h2-wrapper"><h2>Terms of Use</h2></div>
                 <div class="terms-of-use">Lorem ipsum dolor sit amet, 
consectetur adipiscing elit. Maecenas condimentum eros nec risus pretium, at 
lobortis nulla vulputate. Duis et cursus justo, vel fermentum neque. Praesent 
bibendum turpis vel tincidunt sollicitudin. Integer nibh est, pretium nec nunc 
vitae, auctor pharetra elit. Fusce at ornare sapien.</div>
@@ -63,9 +64,10 @@
                     <input type="checkbox" class="checkbox" id="terms_of_use" 
name="terms_of_use" required minlength="1">
                     I agree
                 </label>
+-->
 
 
-
+                <div class="clearfix"></div>
                 <button class="btn btn-primary" type="submit">Add new 
Tenant</button>
             </form>
 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a627251a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/css/main.css
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/css/main.css
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/css/main.css
index 4c4ebcb..0c92afe 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/css/main.css
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/css/main.css
@@ -229,8 +229,7 @@ h2{
     background: transparent url(../img/gray.png) repeat-x left 30px;
 }
 h3{
-    padding: 15px 0 0 0;
-    margin: 0;
+    margin: 15px 0 0 0;
 }
 h3 span{
     color:#999;
@@ -560,6 +559,8 @@ label.error{
     width:100%;
     text-align: right;
     padding-right:30px;
+    z-index: 100;
+    margin-top: -5px;
 }
 .un-subscribe-container a.un-subscribe{
     color:red;

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a627251a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/mycartridges.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/mycartridges.js
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/mycartridges.js
index e3614e8..8a40cf4 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/mycartridges.js
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/mycartridges.js
@@ -1,5 +1,5 @@
 $(function () {
-    $('#unsubscribeBtn').click(function () {
+    $('.un-subscribe-btn').click(function () {
         $('#alias').val($(this).attr('data-alias'));
         popbox.message({content: '<div>Un-subscribe will delete all your 
instances.</div><div>Are you sure you want to un-subscribe?</div>', type: 
'confirm',
             okCallback: function () {

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a627251a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/popup.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/popup.js
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/popup.js
index b326551..9c1afac 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/popup.js
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/popup.js
@@ -11,6 +11,7 @@ popbox.messageDisplay = function (params) {
     $('#messageModal div.modal-body').html(params.content);
     if(params.buttons != undefined){
         $('#messageModal a.btn-primary').hide();
+        $('#messageModal div.modal-footer').html('');
         for(var i=0;i<params.buttons.length;i++){
             $('#messageModal div.modal-footer').append($('<a class="btn 
'+params.buttons[i].cssClass+'">'+params.buttons[i].name+'</a>').click(params.buttons[i].cbk));
         }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a627251a/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 00f22ed..527f2f8 100644
--- a/components/org.apache.stratos.manager.console/console/util/utility.jag
+++ b/components/org.apache.stratos.manager.console/console/util/utility.jag
@@ -98,7 +98,9 @@ consoleAppUtil = new function(){
     };
 
     this.deployCartridgeDefinition = function(cartridgeDefinition){
+        log.info("inside the cartridge call");
         return 
this.send("POST","/cartridge/definition",cartridgeDefinition).data;
+        log.info("end of the call ");
     };
 
     this.deployServiceDefinition = function(serviceDefinition){
@@ -190,6 +192,12 @@ consoleAppUtil = new function(){
     this.getCartridgeInfo = function(alias){
         return this.sendReceive("GET","/cartridge/info/"+alias,{}).data;
     };
+    this.validateCaptcha = function(captchaText){
+        return this.sendReceive("POST","/captcha",captchaText).data;
+    };
+    this.getCaptcha = function(){
+        return this.sendReceiveImage("Get","/simpleImg",{});
+    };
     this.getConfigStatus = function(){
         var configStatus = {};
 
@@ -271,6 +279,35 @@ consoleAppUtil = new function(){
         return response;
     };
 
+    // refactor sendRecive and send method. duplicate code...
+    this.sendReceiveImage = function(httpMethod,urlPostFix,data){
+        var config = require('/config/console.js').config();
+        var backendServerURL = config.backendServerConfiguration.url;
+        // getting the access token from the session.
+        var endpoint = backendServerURL + urlPostFix;
+        var headers = this.getRequestHeaders(config.ssoConfiguration.enabled);
+        var type = "   image/png"; // response format
+        var response;
+        switch (httpMethod){
+            case  "GET":
+                response = get(endpoint,{},headers);
+                break;
+            case   "POST":
+                response = post(endpoint,stringify(data),headers,type);
+                break;
+            case    "PUT":
+                response = put(endpoint,stringify(data),headers,type);
+                break;
+            case    "DELETE":
+                response = del(endpoint,stringify(data),headers,type);
+                break;
+            default :
+                log.error("Error in the programme flow.");
+        }
+
+        return response;
+    };
+
     this.send = function(httpMethod,urlPostFix,data){
         var config = require('/config/console.js').config();
         var backendServerURL = config.backendServerConfiguration.url;
@@ -279,12 +316,15 @@ consoleAppUtil = new function(){
         var headers = this.getRequestHeaders(config.ssoConfiguration.enabled);
         var type = "json"; // response format
         var response;
+        log.info("8888888888888888888888");
+        log.info(data);
         switch (httpMethod){
             case  "GET":
                 response = get(endpoint,{},headers, 'json');
                 break;
             case   "POST":
                 response = post(endpoint,data,headers, 'json');
+                log.info(response);
                 break;
             case    "PUT":
                 response = put(endpoint,data,headers, 'json');
@@ -295,6 +335,7 @@ consoleAppUtil = new function(){
             default :
                 log.error("Error in the programme flow.");
         }
+        log.info("999999999999999");
         if(response.data.stratosAdminResponse) {
             session.put("deploy-status", "succeeded");
         } else if (response.data.Error) {

Reply via email to