You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2014/03/20 13:48:44 UTC

git commit: STRATOS-536

Repository: incubator-stratos
Updated Branches:
  refs/heads/master f0899ef3c -> ab0bbae31


STRATOS-536

Signed-off-by: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>


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

Branch: refs/heads/master
Commit: ab0bbae3151b696bda400227568d1986f4e6b1be
Parents: f0899ef
Author: Chanaka Jayasena <ch...@gmail.com>
Authored: Thu Mar 20 18:14:24 2014 +0530
Committer: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
Committed: Thu Mar 20 18:18:11 2014 +0530

----------------------------------------------------------------------
 .../console/cartridge_info.jag                  |   1 -
 .../partials/configure_stratos_wizard.hbs       |  14 +-
 .../theme1/renderers/configure_stratos.js       | 275 ++++++++-----------
 .../renderers/configure_stratos_wizard.js       | 266 ++++++++----------
 .../console/themes/theme1/renderers/login.js    |   8 +
 5 files changed, 255 insertions(+), 309 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ab0bbae3/components/org.apache.stratos.manager.console/console/cartridge_info.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/cartridge_info.jag b/components/org.apache.stratos.manager.console/console/cartridge_info.jag
index f6065d9..9554439 100644
--- a/components/org.apache.stratos.manager.console/console/cartridge_info.jag
+++ b/components/org.apache.stratos.manager.console/console/cartridge_info.jag
@@ -6,7 +6,6 @@ var utils = require('/util/utility.jag');
 var alias = request.getParameter("alias");
 var lbCluster = {};
 var cartridgeInfo = utils.consoleAppUtil.getCartridgeInfo(alias);
-log.info(cartridgeInfo);
 
 if(cartridgeInfo.Error != undefined){
     error.push(cartridgeInfo.Error);

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ab0bbae3/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 4faa94c..f47b88a 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
@@ -185,7 +185,7 @@
                                                       <div class="panel-heading">
                                                           <h4 class="panel-title">
                                                               <a data-toggle="collapse" data-parent="#accordion" href="#collapse{{cartridgeType}}">
-                                                                  {{cartridgeType}}
+                                                                  {{displayName}}
                                                               </a>
                                                           </h4>
                                                       </div>
@@ -206,7 +206,7 @@
                                                       <div class="panel-heading">
                                                           <h4 class="panel-title">
                                                               <a data-toggle="collapse" data-parent="#accordion" href="#collapse{{cartridgeType}}">
-                                                                  {{cartridgeType}}
+                                                                  {{displayName}}
                                                               </a>
                                                           </h4>
                                                       </div>
@@ -237,6 +237,16 @@
                                                   </div>
                                                {{/each}}
                                             {{/ifCond}}
+
+
+                                             {{#if step_data}}
+                                                 {{#each error}}
+                                                 <div class="alert alert-info alert-dismissable">
+                                                     <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+                                                     {{errorMessage}}
+                                                 </div>
+                                                 {{/each}}
+                                             {{/if}}
                                         </div>
                                     </div>
                                     {{#ifCond step "==" 1}}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ab0bbae3/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos.js b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos.js
index c3322ca..a15264e 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos.js
@@ -1,170 +1,135 @@
 var render = function (theme, data, meta, require) {
     session.put("configuring","true");
-    if(data.error.length == 0 ){
-        var title;
-        var header_type;
-        var deploy_status = session.get("deploy-status");
-        var list_status = session.get("get-status");
-        var err_message;
-        var isErrDeply = false;
-        var isErrGet = false;
-        var isErr = false;
-        var isSucceeded = false;
-        var wizard_on_val = [];
-        for(var i=0; i<6 ;i++){
-            if(i <= data.wizard.step-1){
-                wizard_on_val.push(true);
-            }else{
-                wizard_on_val.push(false);
-            }
-        }
-        var config_status = data.wizard;
-        if( config_status.step == 1 ){
-            title = 'Partition Deployment';
-        }else if( config_status.step == 2 ){
-            title = 'Auto scale Policy Deployment';
-        }else if( config_status.step == 3 ){
-            title = 'Deployment Policy Deployment';
-        }else if( config_status.step == 4 ){
-            title = 'Lb';
-        }else if( config_status.step == 5 ){
-            title = 'Cartridge Deployment';
-        }else if( config_status.step == 6 ){
-            title = 'Multi-Tenant Service Deployment';
-        }
 
-        if(deploy_status == "succeeded") {
-            isErrDeply = false;
-            isSucceeded = true;
-        } else if(deploy_status == null) {
-            isErrDeply = false;
-        } else {
-            isErrDeply = true;
-            err_message = deploy_status;
+    var title;
+    var header_type;
+    var deploy_status = session.get("deploy-status");
+    var list_status = session.get("get-status");
+    var err_message;
+    var isErrDeply = false;
+    var isErrGet = false;
+    var isErr = false;
+    var isSucceeded = false;
+    var wizard_on_val = [];
+    for(var i=0; i<6 ;i++){
+        if(i <= data.wizard.step-1){
+            wizard_on_val.push(true);
+        }else{
+            wizard_on_val.push(false);
         }
+    }
+    var config_status = data.wizard;
+    if( config_status.step == 1 ){
+        title = 'Partition Deployment';
+    }else if( config_status.step == 2 ){
+        title = 'Auto scale Policy Deployment';
+    }else if( config_status.step == 3 ){
+        title = 'Deployment Policy Deployment';
+    }else if( config_status.step == 4 ){
+        title = 'Lb';
+    }else if( config_status.step == 5 ){
+        title = 'Cartridge Deployment';
+    }else if( config_status.step == 6 ){
+        title = 'Multi-Tenant Service Deployment';
+    }
 
-        if(list_status == "succeeded") {
-            isErrGet = false;
-        } else if(list_status == null) {
-            isErrGet = false;
-        } else {
-            isErrGet = true;
-            if(err_message == undefined) {
-                       err_message = list_status;
-            } else {
-                err_message = err_message + ", " + list_status;
-            }
-            step_data = "[]";
-        }
+    if(deploy_status == "succeeded") {
+        isErrDeply = false;
+        isSucceeded = true;
+    } else if(deploy_status == null) {
+        isErrDeply = false;
+    } else {
+        isErrDeply = true;
+        err_message = deploy_status;
+    }
 
-        if(isErrDeply || isErrGet) {
-         isErr = true;
+    if(list_status == "succeeded") {
+        isErrGet = false;
+    } else if(list_status == null) {
+        isErrGet = false;
+    } else {
+        isErrGet = true;
+        if(err_message == undefined) {
+                   err_message = list_status;
+        } else {
+            err_message = err_message + ", " + list_status;
         }
+        step_data = "[]";
+    }
 
-        session.remove("get-status");
-        session.remove("deploy-status");
+    if(isErrDeply || isErrGet) {
+     isErr = true;
+    }
 
-        for(var i=0;i<step_data.length;i++){
-            step_data[i].json_string = stringify(step_data[i]);
-        }
+    session.remove("get-status");
+    session.remove("deploy-status");
 
-        theme('index', {
-            body: [
-                {
-                    partial: 'configure_stratos_wizard',
-                    context: {
-                        title:title,
-                        step_data:data.step_data,
-                        step:config_status.step,
-                        wizard_on:false,
-                        config_on:true,
-                        wizard_on_1:wizard_on_val[0],
-                        wizard_on_2:wizard_on_val[1],
-                        wizard_on_3:wizard_on_val[2],
-                        wizard_on_4:wizard_on_val[3],
-                        wizard_on_5:wizard_on_val[4],
-                        wizard_on_6:wizard_on_val[5],
-                        config_status:data.config_status,
-                        data_string:stringify(data.step_data),
-                        configure_stratos:true
+    for(var i=0;i<step_data.length;i++){
+        step_data[i].json_string = stringify(step_data[i]);
+    }
+    var log = new Log();
+    theme('index', {
+        body: [
+            {
+                partial: 'configure_stratos_wizard',
+                context: {
+                    title:title,
+                    step_data:data.step_data,
+                    step:config_status.step,
+                    wizard_on:false,
+                    config_on:true,
+                    wizard_on_1:wizard_on_val[0],
+                    wizard_on_2:wizard_on_val[1],
+                    wizard_on_3:wizard_on_val[2],
+                    wizard_on_4:wizard_on_val[3],
+                    wizard_on_5:wizard_on_val[4],
+                    wizard_on_6:wizard_on_val[5],
+                    config_status:data.config_status,
+                    data_string:stringify(data.step_data),
+                    configure_stratos:true,
+                    error:data.error
 
-                    }
-                }
-            ],
-            header: [
-                {
-                    partial: 'header',
-                    context:{
-                        title:'Configure Stratos',
-                        button:{
-                            link:'/',
-                            name:'Deploy New Cartridge',
-                            class_name:''
-                        },
-                        has_help:false,
-                        step_data:true,
-                        config_status:data.config_status,
-                        wizard_on:false,
-                        config_on:true,
-                        wizard_on_1:wizard_on_val[0],
-                        wizard_on_2:wizard_on_val[1],
-                        wizard_on_3:wizard_on_val[2],
-                        wizard_on_4:wizard_on_val[3],
-                        wizard_on_5:wizard_on_val[4],
-                        wizard_on_6:wizard_on_val[5],
-                        step:step,
-                        configure_stratos:true,
-                        error:isErr,
-                        deploy_status:isSucceeded,
-                        error_msg:err_message,
-                        type:title
-                    }
-                }
-            ],
-            title:[
-                {
-                    partial:'title',
-                    context:{
-                        title:title
-                    }
-                }
-            ]
-        });
-    }else{
-        theme('index', {
-            body: [
-                {
-                    partial: 'error_page',
-                    context: {
-                        title:'Error',
-                        error:data.error
-                    }
                 }
-            ],
-            header: [
-                {
-                    partial: 'header',
-                    context: {
-                        title: 'My Cartridges',
-                        my_cartridges: true,
-                        button: {
-                            link: '/cartridges.jag',
-                            name: 'Subscribe to Cartridge',
-                            class_name: 'btn-important'
-                        },
-                        has_help: true,
-                        help: 'Create cartridges like PHP, Python, Ruby etc.. Or create data cartridges with mySql, PostgreSQL. Directly install applications like Drupal, Wordpress etc..'
-                    }
+            }
+        ],
+        header: [
+            {
+                partial: 'header',
+                context:{
+                    title:'Configure Stratos',
+                    button:{
+                        link:'/',
+                        name:'Deploy New Cartridge',
+                        class_name:''
+                    },
+                    has_help:false,
+                    step_data:true,
+                    config_status:data.config_status,
+                    wizard_on:false,
+                    config_on:true,
+                    wizard_on_1:wizard_on_val[0],
+                    wizard_on_2:wizard_on_val[1],
+                    wizard_on_3:wizard_on_val[2],
+                    wizard_on_4:wizard_on_val[3],
+                    wizard_on_5:wizard_on_val[4],
+                    wizard_on_6:wizard_on_val[5],
+                    step:config_status.step,
+                    configure_stratos:true,
+                    error:isErr,
+                    deploy_status:isSucceeded,
+                    error_msg:err_message,
+                    type:title
                 }
-            ],
-            title: [
-                {
-                    partial: 'title',
-                    context: {
-                        title: "My Cartridges"
-                    }
+            }
+        ],
+        title:[
+            {
+                partial:'title',
+                context:{
+                    title:title
                 }
-            ]
-        });
-    }
+            }
+        ]
+    });
+
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ab0bbae3/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos_wizard.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos_wizard.js b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos_wizard.js
index adc404a..4d97dbe 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos_wizard.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/configure_stratos_wizard.js
@@ -1,165 +1,129 @@
 var render = function (theme, data, meta, require) {
     session.put("configuring","false");
-    if(data.error.length == 0 ){
-        var deploy_status = session.get("deploy-status");
-        var list_status = session.get("get-status");
-        var title;
-        var err_message;
-        var isErrDeply = false;
-        var isErrGet = false;
-        var isErr = false;
-        var isSucceeded = false;
-        var artifact_deploy = session.get("deploy_artifacts");
-        session.remove("deploy_artifacts");
-        var wizard_on_val = [];
-        for(var i=0; i<6 ;i++){
-            if(i <= data.wizard.step-1){
-                wizard_on_val.push(true);
-            }else{
-                wizard_on_val.push(false);
-            }
+    var deploy_status = session.get("deploy-status");
+    var list_status = session.get("get-status");
+    var title;
+    var err_message;
+    var isErrDeply = false;
+    var isErrGet = false;
+    var isErr = false;
+    var isSucceeded = false;
+    var artifact_deploy = session.get("deploy_artifacts");
+    session.remove("deploy_artifacts");
+    var wizard_on_val = [];
+    for(var i=0; i<6 ;i++){
+        if(i <= data.wizard.step-1){
+            wizard_on_val.push(true);
+        }else{
+            wizard_on_val.push(false);
         }
+    }
 
-        if(deploy_status == "succeeded") {
-            isErrDeply = false;
-            isSucceeded = true;
-        } else if(deploy_status == null) {
-            isErrDeply = false;
-        } else {
-            isErrDeply = true;
-            err_message = deploy_status;
-        }
+    if(deploy_status == "succeeded") {
+        isErrDeply = false;
+        isSucceeded = true;
+    } else if(deploy_status == null) {
+        isErrDeply = false;
+    } else {
+        isErrDeply = true;
+        err_message = deploy_status;
+    }
 
-        if(list_status == "succeeded") {
-            isErrGet = false;
-        } else if(list_status == null) {
-            isErrGet = false;
+    if(list_status == "succeeded") {
+        isErrGet = false;
+    } else if(list_status == null) {
+        isErrGet = false;
+    } else {
+        isErrGet = true;
+        if(err_message == undefined) {
+                   err_message = list_status;
         } else {
-            isErrGet = true;
-            if(err_message == undefined) {
-                       err_message = list_status;
-            } else {
-                err_message = err_message + ", " + list_status;
-            }
-            step_data = "[]";
+            err_message = err_message + ", " + list_status;
         }
+        step_data = "[]";
+    }
 
-        if(isErrDeply || isErrGet) {
-         isErr = true;
-        }
+    if(isErrDeply || isErrGet) {
+     isErr = true;
+    }
 
-        session.remove("get-status");
-        session.remove("deploy-status");
+    session.remove("get-status");
+    session.remove("deploy-status");
 
-        var config_status = data.wizard;
-        if( config_status.step == 1 ){
-            title = 'Partition Deployment';
-        }else if( config_status.step == 2 ){
-            title = 'Auto scale Policy Deployment';
-        }else if( config_status.step == 3 ){
-            title = 'Deployment Policy Deployment';
-        }else if( config_status.step == 4 ){
-            title = 'Lb';
-        }else if( config_status.step == 5 ){
-            title = 'Cartridge Deployment';
-        }else if( config_status.step == 6 ){
-            title = 'Multi-Tenant Service Deployment';
-        }
-        for(var i=0;i<step_data.length;i++){
-            step_data[i].json_string = stringify(step_data[i]);
-        }
-        theme('index', {
-            body: [
-                {
-                    partial: 'configure_stratos_wizard',
-                    context: {
-                        title:title,
-                        step_data:data.step_data,
-                        step:config_status.step,
-                        wizard_on:true,
-                        wizard_on_1:wizard_on_val[0],
-                        wizard_on_2:wizard_on_val[1],
-                        wizard_on_3:wizard_on_val[2],
-                        wizard_on_4:wizard_on_val[3],
-                        wizard_on_5:wizard_on_val[4],
-                        wizard_on_6:wizard_on_val[5],
-                        data_string:stringify(data.step_data)
-                    }
-                }
-            ],
-            header: [
-                {
-                    partial: 'header',
-                    context:{
-                        title:'Configure Stratos',
-                        button:{
-                            link:'/',
-                            name:'Deploy New Cartridge',
-                            class_name:''
-                        },
-                        has_help:false,
-                        step_data:true,
-                        config_status:data.config_status,
-                        wizard_on:true,
-                        wizard_on_1:wizard_on_val[0],
-                        wizard_on_2:wizard_on_val[1],
-                        wizard_on_3:wizard_on_val[2],
-                        wizard_on_4:wizard_on_val[3],
-                        wizard_on_5:wizard_on_val[4],
-                        wizard_on_6:wizard_on_val[5],
-                        step:step,
-                        configure_stratos:true,
-                        error:isErr,
-                        deploy_status:isSucceeded,
-                        error_msg:err_message,
-                        type:artifact_deploy
-                    }
-                }
-            ],
-            title:[
-                {
-                    partial:'title',
-                    context:{
-                        title:title
-                    }
-                }
-            ]
-        });
-    }else{
-        theme('index', {
-            body: [
-                {
-                    partial: 'error_page',
-                    context: {
-                        title:'Error',
-                        error:data.error
-                    }
+    var config_status = data.wizard;
+    if( config_status.step == 1 ){
+        title = 'Partition Deployment';
+    }else if( config_status.step == 2 ){
+        title = 'Auto scale Policy Deployment';
+    }else if( config_status.step == 3 ){
+        title = 'Deployment Policy Deployment';
+    }else if( config_status.step == 4 ){
+        title = 'Lb';
+    }else if( config_status.step == 5 ){
+        title = 'Cartridge Deployment';
+    }else if( config_status.step == 6 ){
+        title = 'Multi-Tenant Service Deployment';
+    }
+    for(var i=0;i<step_data.length;i++){
+        step_data[i].json_string = stringify(step_data[i]);
+    }
+    theme('index', {
+        body: [
+            {
+                partial: 'configure_stratos_wizard',
+                context: {
+                    title:title,
+                    step_data:data.step_data,
+                    step:config_status.step,
+                    wizard_on:true,
+                    wizard_on_1:wizard_on_val[0],
+                    wizard_on_2:wizard_on_val[1],
+                    wizard_on_3:wizard_on_val[2],
+                    wizard_on_4:wizard_on_val[3],
+                    wizard_on_5:wizard_on_val[4],
+                    wizard_on_6:wizard_on_val[5],
+                    data_string:stringify(data.step_data),
+                    error:data.error
                 }
-            ],
-            header: [
-                {
-                    partial: 'header',
-                    context: {
-                        title: 'My Cartridges',
-                        my_cartridges: true,
-                        button: {
-                            link: '/cartridges.jag',
-                            name: 'Subscribe to Cartridge',
-                            class_name: 'btn-important'
-                        },
-                        has_help: true,
-                        help: 'Create cartridges like PHP, Python, Ruby etc.. Or create data cartridges with mySql, PostgreSQL. Directly install applications like Drupal, Wordpress etc..'
-                    }
+            }
+        ],
+        header: [
+            {
+                partial: 'header',
+                context:{
+                    title:'Configure Stratos',
+                    button:{
+                        link:'/',
+                        name:'Deploy New Cartridge',
+                        class_name:''
+                    },
+                    has_help:false,
+                    step_data:true,
+                    config_status:data.config_status,
+                    wizard_on:true,
+                    wizard_on_1:wizard_on_val[0],
+                    wizard_on_2:wizard_on_val[1],
+                    wizard_on_3:wizard_on_val[2],
+                    wizard_on_4:wizard_on_val[3],
+                    wizard_on_5:wizard_on_val[4],
+                    wizard_on_6:wizard_on_val[5],
+                    step:step,
+                    configure_stratos:true,
+                    error:isErr,
+                    deploy_status:isSucceeded,
+                    error_msg:err_message,
+                    type:artifact_deploy
                 }
-            ],
-            title: [
-                {
-                    partial: 'title',
-                    context: {
-                        title: "My Cartridges"
-                    }
+            }
+        ],
+        title:[
+            {
+                partial:'title',
+                context:{
+                    title:title
                 }
-            ]
-        });
-    }
+            }
+        ]
+    });
+
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ab0bbae3/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/login.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/login.js b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/login.js
index f0c17cf..77c1c6e 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/login.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/login.js
@@ -24,6 +24,14 @@ var render = function (theme, data, meta, require) {
                             ]
                 }
             }
+        ],
+        title: [
+            {
+                partial: 'title',
+                context: {
+                    title: "Apache Stratos Login"
+                }
+            }
         ]
     });
 };
\ No newline at end of file