Updated Branches:
  refs/heads/master aada5d63e -> 627fea539

developed STRATOS-448


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

Branch: refs/heads/master
Commit: 627fea53984599f09f00bc2afc45b57cdb6a74de
Parents: aada5d6
Author: rekathiru <[email protected]>
Authored: Thu Feb 13 19:18:57 2014 +0530
Committer: rekathiru <[email protected]>
Committed: Thu Feb 13 19:18:57 2014 +0530

----------------------------------------------------------------------
 .../controllers/cartridgeDefintionSubmit.jag    |  5 ++++
 .../console/controllers/wizardSubmit.jag        |  9 ++++++-
 .../console/themes/theme1/partials/header.hbs   | 28 +++++++++++++++-----
 .../theme1/renderers/configure_stratos.js       | 27 +++++++++++++++++--
 .../renderers/configure_stratos_wizard.js       | 26 +++++++++++++++++-
 .../console/themes/theme1/ui/css/main.css       |  4 +++
 6 files changed, 88 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/627fea53/components/org.apache.stratos.manager.console/console/controllers/cartridgeDefintionSubmit.jag
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/controllers/cartridgeDefintionSubmit.jag
 
b/components/org.apache.stratos.manager.console/console/controllers/cartridgeDefintionSubmit.jag
index e283e23..2347507 100755
--- 
a/components/org.apache.stratos.manager.console/console/controllers/cartridgeDefintionSubmit.jag
+++ 
b/components/org.apache.stratos.manager.console/console/controllers/cartridgeDefintionSubmit.jag
@@ -5,5 +5,10 @@
     var cartridgeDefinition = 
request.getParameter("cartridge-definition").trim();
     var response = 
utils.consoleAppUtil.deployCartridgeDefinition(cartridgeDefinition);
     response.sendRedirect(request.getContextPath() + 
'/cartridge_deployments.jag');
+    if(response.data) {
+       session.put("Action successful");
+    } else {
+        session.put("Error occurred while deploying the cartidge");
+    }
 }());
 %>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/627fea53/components/org.apache.stratos.manager.console/console/controllers/wizardSubmit.jag
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/controllers/wizardSubmit.jag
 
b/components/org.apache.stratos.manager.console/console/controllers/wizardSubmit.jag
index 42e607e..9274df0 100755
--- 
a/components/org.apache.stratos.manager.console/console/controllers/wizardSubmit.jag
+++ 
b/components/org.apache.stratos.manager.console/console/controllers/wizardSubmit.jag
@@ -29,7 +29,14 @@
     }
 
     var configuring = session.get("configuring");
-    var url = request.getContextPath() + '/configure_stratos_wizard.jag?step=' 
+ nextStep;
+    var get_status = session.get("get-status");
+    var deploy_status = session.get("deploy-status");
+    var url = "";
+    if(get_status != "succeeded" || deploy_status != "succeeded") {
+       url = request.getContextPath() + '/configure_stratos_wizard.jag?step=' 
+ thisStep;
+    } else {
+       url = request.getContextPath() + '/configure_stratos_wizard.jag?step=' 
+ nextStep;
+   }
     if(configuring == "true"){
         url =  request.getContextPath() + '/configure_stratos.jag?step=' + 
thisStep;
     }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/627fea53/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 0806cd8..ffcd201 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
@@ -1,4 +1,3 @@
-
 {{#if login}}
         <div class="top-blue-strip"></div>
         <div class="login-logo-section"><a  href="{{url "/"}}"><img src="{{url 
"/themes/theme1/ui/img/logo-login.png"}}"/></a></div>
@@ -256,19 +255,34 @@
             </div>
         </div>
     </div>
-    {{#if config_status.not_complete}}
-    <div class="info-bar">
+
+    {{#if error}}
+    <div class="info-bar error">
         <div class="container">
             <div class="row">
-                <div class="col-lg-3">
-                </div>
-                <div class="col-lg-6">
-                    <i class="icon-exclamation"></i> Configure Stratos is not 
completed. <a href="{{url "/configure_stratos_wizard.jag"}}">Take the Wizard</a>
+                <div class="col-lg-12">
+                    <i class="icon-exclamation"></i>{{error_msg}}</a>
                 </div>
             </div>
         </div>
     </div>
+    {{else}}
+        {{#if config_status.not_complete}}
+            <div class="info-bar">
+                <div class="container">
+                    <div class="row">
+                        <div class="col-lg-3">
+                        </div>
+                        <div class="col-lg-6">
+                            <i class="icon-exclamation"></i> Configure Stratos 
is not completed. <a href="{{url "/configure_stratos_wizard.jag"}}">Take the 
Wizard</a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        {{/if}}
+
     {{/if}}
+
 </div>
 
 <form action="{{url "/controllers/manageTenants.jag"}}" id="manageTenantsForm">

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/627fea53/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 16dd728..b565260 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,6 +1,10 @@
 var render = function (theme, data, meta, require) {
     session.put("configuring","true");
     var title;
+    var deploy_status = session.get("deploy-status");
+    var list_status = session.get("get-status");
+    var err_message = "";
+    var isErr = false;
     var wizard_on_val = [];
     for(var i=0; i<6 ;i++){
         if(i <= data.wizard.step-1){
@@ -24,6 +28,22 @@ var render = function (theme, data, meta, require) {
         title = 'Multi-Tenant Service Deployment';
     }
 
+    if((deploy_status != null && deploy_status == "succeeded") && (list_status 
!= null && list_status == "succeeded")) {
+       isErr = false;
+    } else if((deploy_status != null && !(deploy_status == "succeeded")) && 
(list_status != null && !(list_status == "succeeded"))) {
+       isErr = true;
+       step_data = "[]";
+        err_message = deploy_status + " and " + list_status;
+    } else if((deploy_status != null && deploy_status == "succeeded") && 
(list_status != null && !(list_status == "succeeded"))) {
+        isErr = true;
+        err_message = list_status;
+        step_data = "[]";
+    } else if((deploy_status != null && !(deploy_status == "succeeded")) && 
(list_status != null &&  list_status == "succeeded")) {
+       isErr = true;
+       err_message = deploy_status;
+    }
+    session.remove("get-status");
+    session.remove("deploy-status");
 
     for(var i=0;i<step_data.length;i++){
         step_data[i].json_string = stringify(step_data[i]);
@@ -46,7 +66,8 @@ var render = function (theme, data, meta, require) {
                     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)
+                    data_string:stringify(data.step_data),
+                    configure_stratos:true
 
                 }
             }
@@ -73,7 +94,9 @@ var render = function (theme, data, meta, require) {
                     wizard_on_5:wizard_on_val[4],
                     wizard_on_6:wizard_on_val[5],
                     step:step,
-                    configure_stratos:true
+                    configure_stratos:true,
+                    error:isErr,
+                    error_msg:err_message
                 }
             }
         ],

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/627fea53/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 0834ba1..d2cbeb3 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,6 +1,10 @@
 var render = function (theme, data, meta, require) {
     session.put("configuring","false");
+    var deploy_status = session.get("deploy-status");
+    var list_status = session.get("get-status");
+    var err_message = "";
     var title;
+    var isErr = false;
     var wizard_on_val = [];
     for(var i=0; i<6 ;i++){
         if(i <= data.wizard.step-1){
@@ -9,6 +13,24 @@ var render = function (theme, data, meta, require) {
             wizard_on_val.push(false);
         }
     }
+    if((deploy_status != null && deploy_status == "succeeded") && (list_status 
!= null && list_status == "succeeded")) {
+       isErr = false;
+    } else if((deploy_status != null && !(deploy_status == "succeeded")) && 
(list_status != null && !(list_status == "succeeded"))) {
+       isErr = true;
+       step_data = "[]";
+        err_message = deploy_status + " and " + list_status;
+    } else if((deploy_status != null && deploy_status == "succeeded") && 
(list_status != null && !(list_status == "succeeded"))) {
+        isErr = true;
+        err_message = list_status;
+        step_data = "[]";
+    } else if((deploy_status != null && !(deploy_status == "succeeded")) && 
(list_status != null &&  list_status == "succeeded")) {
+       isErr = true;
+       err_message = deploy_status;
+    }
+
+    session.remove("get-status");
+    session.remove("deploy-status");
+
     var config_status = data.wizard;
     if( config_status.step == 1 ){
         title = 'Partition Deployment';
@@ -66,7 +88,9 @@ var render = function (theme, data, meta, require) {
                     wizard_on_5:wizard_on_val[4],
                     wizard_on_6:wizard_on_val[5],
                     step:step,
-                    configure_stratos:true
+                    configure_stratos:true,
+                    error:isErr,
+                    error_msg:err_message
                 }
             }
         ],

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/627fea53/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 4720872..c090a10 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
@@ -426,6 +426,10 @@ textarea.jsonEditor{
     width:100%;
     margin-top:-10px;
 }
+div.error{
+    background:#ff9998;
+    color:#444;
+}
 .color-a-full-icons{
     color:#ff9000;
     font-size:30px;

Reply via email to