Updated Branches:
  refs/heads/health-Check [created] bbdc2e45c

AWS health Check UI development


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

Branch: refs/heads/health-Check
Commit: bbdc2e45cb0d1d442b357a1c1730647d817f9f64
Parents: 9c5c475
Author: Pranav Saxena <[email protected]>
Authored: Wed Mar 6 00:28:04 2013 +0530
Committer: Pranav Saxena <[email protected]>
Committed: Wed Mar 6 00:28:04 2013 +0530

----------------------------------------------------------------------
 ui/index.jsp                        |    1 +
 ui/scripts/network.js               |   11 +++
 ui/scripts/ui-custom/healthCheck.js |  136 ++++++++++++++++++++++++++++++
 3 files changed, 148 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/bbdc2e45/ui/index.jsp
----------------------------------------------------------------------
diff --git a/ui/index.jsp b/ui/index.jsp
index d1e6bfa..9520d67 100644
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@ -1646,6 +1646,7 @@ under the License.
     <script type="text/javascript" 
src="scripts/lbStickyPolicy.js?t=<%=now%>"></script>
     <script type="text/javascript" 
src="scripts/ui-custom/autoscaler.js?t=<%=now%>"></script>
     <script type="text/javascript" 
src="scripts/autoscaler.js?t=<%=now%>"></script>
+    <script type="text/javascript" 
src="scripts/ui-custom/healthCheck.js?t=<%=now%>"></script>
     <script type="text/javascript" 
src="scripts/ui-custom/zoneChart.js?t=<%=now%>"></script>
     <script type="text/javascript" 
src="scripts/ui-custom/dashboard.js?t=<%=now%>"></script>
     <script type="text/javascript" 
src="scripts/installWizard.js?t=<%=now%>"></script>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/bbdc2e45/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 6fcd460..b64925d 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1323,6 +1323,17 @@
                             action: cloudStack.lbStickyPolicy.dialog()
                           }
                         },
+
+                         'health-check':{
+                          label:'Health Check',
+                          custom:{
+                             buttonLabel:'Configure',
+                             action:cloudStack.uiCustom.healthCheck()
+
+                           }
+                        },
+
+
                         'autoScale': {
                           label: 'AutoScale',
                           custom: {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/bbdc2e45/ui/scripts/ui-custom/healthCheck.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/healthCheck.js 
b/ui/scripts/ui-custom/healthCheck.js
new file mode 100644
index 0000000..5e65bc5
--- /dev/null
+++ b/ui/scripts/ui-custom/healthCheck.js
@@ -0,0 +1,136 @@
+// Copyright 2012 Citrix Systems, Inc. Licensed under the
+// Apache License, Version 2.0 (the "License"); you may not use this
+// file except in compliance with the License.  Citrix Systems, Inc.
+// reserves all rights not expressly granted by the License.
+// You may obtain a copy of the License at 
http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+(function($, cloudStack) {
+
+  cloudStack.uiCustom.healthCheck = function(args) {
+
+    // Place outer args here as local variables
+    // i.e, -- var dataProvider = args.dataProvider
+
+    return function(args){
+   
+     var context = args.context;
+     var formData = args.formData;
+     var forms = $.extend(true, {}, args.forms);
+     var topFieldForm, bottomFieldForm , $topFieldForm , $bottomFieldForm;
+     var topfields = forms.topFields; 
+
+     var $healthCheckDesc = $('<div>Your load balancer will automatically 
perform health checks on your cloudstack instances and only route traffic to 
instances that pass the health check 
</div>').addClass('health-check-description');
+     var $healthCheckConfigTitle = $('<div><br><br>Configuration Options 
:</div>').addClass('health-check-config-title');
+     var $healthCheckAdvancedTitle = $('<div><br><br> Advanced Options : 
</div>').addClass('health-check-advanced-title');
+    
+     var $healthCheckDialog = $('<div>').addClass('health-check');
+       
+    
+      $healthCheckDialog.append($healthCheckDesc);
+      $healthCheckDialog.append($healthCheckConfigTitle);
+    
+
+      topFieldForm = cloudStack.dialog.createForm({
+          context: context,
+          noDialog: true, // Don't render a dialog, just return $formContainer
+          form: {
+            title: '',
+            fields:{
+               protocol: { label: 'Ping Protocol' , 
docID:'helpAccountUsername', validation :{required:true}, defaultValue: 'HTTP'},
+               port : {label: 'Ping Port ', docID:'helpAccountUsername', 
validation: {required:true}, defaultValue: '80'},
+               pingpath: {label: 'Ping Path', docID:'helpAccountUsername' , 
validation: {required: true}, defaultValue: '/' }
+             }
+          }
+        });
+
+       $topFieldForm = topFieldForm.$formContainer;
+       $topFieldForm.appendTo($healthCheckDialog);
+
+       $healthCheckDialog.append($healthCheckAdvancedTitle);
+
+
+        bottomFieldForm = cloudStack.dialog.createForm ({
+              context:context,
+              noDialog:true,
+              form:{
+                title:'',
+                fields:{
+                   responsetimeout: {label: 'Response Timeout (in sec)' , 
validation:{required:false},defaultValue:'5'},
+                   healthinterval: {label: 'Health Check Interval (in min)',  
validation:{required:false}, defaultValue :'1'},
+                   unhealthythreshold: {label: 'Unhealthy Threshold' , 
validation: { required:false}, defaultValue:'2'},
+                   healthythreshold:  {label: 'Healthy Threshold', validation: 
{required:false} ,defaultValue:'10'}
+
+                 }
+             }
+       });
+
+       $bottomFieldForm = bottomFieldForm.$formContainer;
+       $bottomFieldForm.appendTo($healthCheckDialog);
+
+
+      //var $loading = 
$('<div>').addClass('loading-overlay').appendTo($healthCheckDialog);
+      $healthCheckDialog.dialog({
+        title: 'Health Check Wizard',
+        width: 600,
+        height: 600,
+        draggable: true,
+        closeonEscape: false,
+        overflow:'auto',
+        open:function() {
+          $("button").each(function(){
+            $(this).attr("style", "left: 400px; position: relative; 
margin-right: 5px; ");
+          });
+        },
+        buttons: [
+          {
+            text: _l('label.cancel'),
+            'class': 'cancel',
+            click: function() {
+              $healthCheckDialog.dialog('destroy');
+               $('.overlay').remove();
+            }
+          },
+          {
+            text: _l('Apply'),
+            'class': 'ok',
+            click: function() {
+            //  var data = cloudStack.serializeForm($('.ui-dialog .healthCheck 
form'));
+
+              $loading.appendTo($healthCheckDialog);
+          /*    cloudStack.autoscaler.actions.apply({
+                formData: formData,
+                context: context,
+                data: data,
+                response: {
+                  success: function() {
+                    $loading.remove();
+                    $autoscalerDialog.dialog('destroy');
+                    $autoscalerDialog.closest(':ui-dialog').remove();
+                    $('.overlay').remove();
+                    cloudStack.dialog.notice({
+                      message: 'Autoscale configured successfully.'
+                    });
+                  },
+                  error: function(message) {
+                    cloudStack.dialog.notice({ message: message });
+                    $loading.remove();
+                  }
+                }
+              });*/
+ 
+              }
+          }
+        ]
+      }).closest('.ui-dialog').overlay();
+
+
+    }
+  }
+ }(jQuery, cloudStack));
+
+

Reply via email to