Updated Branches:
  refs/heads/ui-vpc-redesign f985e11c2 -> a4fc86ece

Tier LB rules: Add load balancing multi-edit


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

Branch: refs/heads/ui-vpc-redesign
Commit: a4fc86ece9fd7c97d308a44b517ccef74053a624
Parents: f985e11
Author: Brian Federle <bfede...@gmail.com>
Authored: Wed May 15 14:28:41 2013 -0700
Committer: Brian Federle <bfede...@gmail.com>
Committed: Wed May 15 14:28:54 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js |  116 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 116 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4fc86ec/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index c54535d..eb3a4b6 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -297,6 +297,7 @@
       // Internal load balancers
       tierLoadBalancers: {
         listView: {
+          id: 'ipAddresses',
           fields: {
             ipaddress: { label: 'label.ip.address' },
             type: { label: 'label.type' }
@@ -349,6 +350,121 @@
                 }
               }
             }
+          },
+          detailView: {
+            isMaximized: true,
+            tabs: {
+              loadBalancing: {
+                title: 'label.load.balancing',
+                custom: function(args) {
+                  var context = args.context;
+                  var $multi = $('<div>').addClass('loadBalancer');
+
+                  $multi.multiEdit({
+                    context: context,
+                    listView: $.extend(true, {}, 
cloudStack.sections.instances, {
+                      listView: {
+                        fields: {
+                          name: { label: 'label.name' },
+                          displayname: { label: 'label.display.name' },
+                          zonename: { label: 'label.zone.name' },
+                          state: {
+                            label: 'label.state',
+                            indicator: {
+                              'Running': 'on',
+                              'Stopped': 'off',
+                              'Destroyed': 'off',
+                              'Error': 'off'
+                            }
+                          }
+                        },
+                        filters: false,
+                        dataProvider: function(args) {
+                          args.response.success({ data: [] });
+                        }
+                      }
+                    }),
+                    
+                    multipleAdd: true,
+
+                    fields: {
+                      'name': { edit: true, label: 'label.name', isEditable: 
true },
+                      'publicport': { edit: true, label: 'label.public.port' },
+                      'privateport': { edit: true, label: 'label.private.port' 
},
+                      'algorithm': {
+                        label: 'label.algorithm',
+                        isEditable: true,
+                        select: function(args) {
+                          args.response.success({
+                            data: [
+                              { id: 'roundrobin', name: 'roundrobin', 
description: _l('label.round.robin') },
+                              { id: 'leastconn', name: 'leastconn', 
description: _l('label.least.connections') },
+                              { id: 'source', name: 'source', description: 
_l('label.source') }
+                            ]
+                          });
+                        }
+                      },
+
+                      'sticky': {
+                        label: 'label.stickiness',
+                        custom: {
+                          buttonLabel: 'label.configure',
+                          action: cloudStack.lbStickyPolicy.dialog()
+                        }
+                      },
+
+                      'add-vm': {
+                        label: 'label.add.vms',
+                        addButton: true
+                      }
+                    },
+
+                    tags: cloudStack.api.tags({ resourceType: 'LoadBalancer', 
contextId: 'multiRule' }),
+
+                    add: {
+                      label: 'label.add.vms',
+                      action: function(args) {                                 
                                                          
+                        args.response.success();
+                      }
+                    },
+                    actions: {
+                      edit: {
+                        label: 'label.edit',
+                        action: function(args) {
+                          args.response.success();
+                        }
+                      },
+                      destroy:  {
+                        label: 'label.action.delete.load.balancer',
+                        action: function(args) {
+                          args.response.success();
+                        }
+                      }
+                    },
+                    
+                    itemActions: {
+                      add: {
+                        label: 'label.add.vms.to.lb',
+                        action: function(args) {
+                          args.response.success();
+                        }
+                      },
+                      destroy: {
+                        label: 'label.remove.vm.from.lb',
+                        action: function(args) {
+                          args.response.success();
+                        }
+                      }
+                    },
+                    dataProvider: function(args) {
+                      args.respons.success({ data: [] });
+                    }
+                  });
+
+                  return $multi;
+                }
+              }
+            }
           }
         }
       },

Reply via email to