Updated Branches:
  refs/heads/master 68bfd33bb -> cfc6a2165

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cfc6a216/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/partition_deployments.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/partition_deployments.js
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/partition_deployments.js
index 955e0e3..77b8ae5 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/partition_deployments.js
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/partition_deployments.js
@@ -1,7 +1,5 @@
 var render = function (theme, data, meta, require) {
-    for(var i=0;i<data.partition_deployments.length;i++){
-        data.partition_deployments[i].key = 
data.partition_deployments[i].name.replace(/ /g,'');
-    }
+
     var create_btn_class = 'btn-important js_handle_click';
     var title = 'Configure Stratos - Partition Deployments';
     if(data.config_status.first_use){
@@ -31,6 +29,7 @@ var render = function (theme, data, meta, require) {
                     },
                     has_help:false,
                     partition_deployments:true,
+                    configure_stratos:true,
                     config_status:data.config_status
                 }
             }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cfc6a216/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/policy_deployments.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/policy_deployments.js
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/policy_deployments.js
index 3b7777b..f87f250 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/policy_deployments.js
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/policy_deployments.js
@@ -1,8 +1,5 @@
 var render = function (theme, data, meta, require) {
-    for(var i=0;i<data.policy_deployments.length;i++){
-        data.policy_deployments[i].key = 
data.policy_deployments[i].name.replace(/ /g,'');
-    }
-    var create_btn_class = 'btn-important js_handle_click';
+    var create_btn_class = 'btn-important';
     var title = 'Configure Stratos - Policy Deployments';
     if(data.config_status.first_use){
         create_btn_class = "btn-default js_handle_click";
@@ -15,6 +12,7 @@ var render = function (theme, data, meta, require) {
                 context: {
                     title:title,
                     policy_deployments:data.policy_deployments,
+                    policy_autoscale:data.policy_autoscale,
                     config_status:data.config_status
                 }
             }
@@ -31,6 +29,7 @@ var render = function (theme, data, meta, require) {
                     },
                     has_help:false,
                     policy_deployments:true,
+                    configure_stratos:true,
                     config_status:data.config_status
                 }
             }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cfc6a216/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 0f7863c..8dad3c2 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
@@ -321,8 +321,8 @@ h4{
     height: 55px;
 }
 .sub-menu li.active a{
-    background: #ffae00;
-    color:#3d3d3d;
+    background: #f45b00;
+    color:#fff;
 }
 .sub-menu li span{
     display:block;
@@ -356,6 +356,14 @@ h4{
     background: #ffae00;
     color:#fff;
 }
+.sub-menu-wizard li a{
+    background: #444444;
+    color:#fff;
+}
+.non-wizard li a{
+    border-left:solid 1px #444;
+    border-right:solid 1px #efefef;
+}
 .sub-menu-wizard li span{
     display:block;
     padding:15px 10px;
@@ -474,4 +482,8 @@ li.dropdown ul.dropdown-menu li a i{
     .sub-menu{
             font-size: 11px;
         }
+}
+label.error{
+    color: #be0000;
+    padding-bottom: 10px;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cfc6a216/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/configure_stratos.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/configure_stratos.js
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/configure_stratos.js
index 3a277a6..70bb4c7 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/configure_stratos.js
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/configure_stratos.js
@@ -1,4 +1,5 @@
 $(function () {
+    $('#jsonForm').validate();
     $('pre').each(function () {
         var jsonStr = $(this).html();
         jsonStr = jsonStr.replace(/\'/g, '\"');
@@ -7,32 +8,4 @@ $(function () {
         $('textarea', $(this).parent()).val(jsonStr);
         $(this).html(syntaxHighlight(jsonStr));
     });
-    $('.js_jsonEdit').click(function () {
-        var $container = $(this).parent();
-        $(this).hide();
-        var preHeight = $('pre', $container).height();
-        $('.js_jsonEdit', $container).hide();
-        $('pre', $container).hide();
-        $('textarea', $container).show().height(preHeight);
-        $('.js_jsonCancel', $container).show();
-        $('.js_jsonSave', $container).show();
-    });
-    $('.js_jsonSave').click(function () {
-        alert('save - ' + $('textarea', $(this).parent()).val())
-    });
-    $('.js_jsonCancel').click(function () {
-        var $container = $(this).parent();
-        $('.js_jsonEdit', $container).show();
-        $('pre', $container).show();
-        $('textarea', $container).hide();
-        $('.js_jsonCancel', $container).hide();
-        $('.js_jsonSave', $container).hide();
-    });
-    $('.js_handle_click').click(function(event){
-        event.preventDefault();
-        $('#addItemSection').show('fast');
-    });
-    $('#deployPolicy').click(function(){
-        alert('saving ' + $('#policy').val());
-    });
 });

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cfc6a216/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/wizard.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/wizard.js
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/wizard.js
index 34735bc..822ff37 100644
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/wizard.js
+++ 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/wizard.js
@@ -1,12 +1,49 @@
 $(function () {
     $('#wizardNext').click(function () {
         var newStep = parseInt($(this).attr('data-step')) + 1;
-        location.href = '?step='+newStep;
+        $('#nextStep').val(newStep);
+        if(isValidForm()){
+            $('#jsonForm').submit();
+        }
     });
+
+    $('#wizardFinish').click(function () {
+        var newStep = parseInt($(this).attr('data-step')) + 1;
+        $('#nextStep').val(newStep);
+        if(isValidForm()){
+            $('#jsonForm').submit();
+        }
+    });
+
+
     $('#wizardBack').click(function () {
         var newStep = parseInt($(this).attr('data-step')) - 1;
-        location.href = '?step='+newStep;
+        $('#nextStep').val(newStep);
+        if(isValidForm()){
+            $('#jsonForm').submit();
+        }
+    });
+
+    $('#policy').keydown(function(){
+        isValidForm();
     });
+
+    var isValidForm = function(){
+        if(parseInt($('#items').val()) == 0){
+            if($('#policy').val() == ""){
+                $('#policy').addClass('error').focus();
+                $('#policyError').show();
+                return false;
+            }else{
+                $('#policy').removeClass('error');
+                $('#policyError').hide();
+                return true;
+            }
+        }else{
+            return true;
+        }
+
+    };
     $('pre').each(function () {
         var jsonStr = $(this).html();
         jsonStr = jsonStr.replace(/\'/g, '\"');

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cfc6a216/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 87384e1..43e8f7e 100644
--- a/components/org.apache.stratos.manager.console/console/util/utility.jag
+++ b/components/org.apache.stratos.manager.console/console/util/utility.jag
@@ -116,20 +116,50 @@ consoleAppUtil = new function(){
 
     this.subscribeToCartridge = function(cartridgeBeanInfo){
         return this.sendReceive("POST","/cartridge/subscribe", 
cartridgeBeanInfo).data;
-    }
+    };
 
     this.addTenant = function(tenantInfoBean){
         return this.sendReceive("POST","/tenant",tenantInfoBean).data;
-    }
+    };
 
     this.getAutoScalePolicies = function(){
         return this.sendReceive("GET","/policy/autoscale",{}).data;
-    }
+    };
 
     this.getDeploymentPolicies = function(){
         return this.sendReceive("GET","/policy/deployment",{}).data;
-    }
+    };
+
+    this.getPartitions = function(){
+        return this.sendReceive("GET","/partition",{}).data;
+    };
+
+    this.getPolicyAutoScale = function(){
+        return this.sendReceive("GET","/policy/autoscale",{}).data;
+    };
+
+    this.getPolicyDeployment = function(){
+        return this.sendReceive("GET","/policy/deployment",{}).data;
+    };
 
+    this.getCartridges = function(){
+        return this.sendReceive("GET","/cartridge/list",{}).data;
+    };
+    this.getConfigStatus = function(){
+        var configStatus = {};
+        if(this.sendReceive("GET","/partition",{}).data.partition.length == 0){
+            configStatus.first_use = true;
+        }else{
+            
if(this.sendReceive("GET","/cartridge/list",{}).data.cartridge.length == 0){
+                configStatus.first_use = false;
+                configStatus.not_complete = true;
+            }else{
+                configStatus.not_complete = false;
+                configStatus.first_use = false;
+            }
+        }
+        return configStatus;
+    };
     // refactor sendRecive and send method. duplicate code...
     this.sendReceive = function(httpMethod,urlPostFix,data){
         var config = require('/config/console.js').config();
@@ -220,6 +250,7 @@ consoleAppUtil = new function(){
     this.getAccessTokenFromSession = function(){
         return session.get("access_token");
     };
+
 };
 
 

Reply via email to