cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pran...@apache.org
Subject [30/50] git commit: updated refs/heads/master to b03e419
Date Tue, 28 May 2013 07:59:15 GMT
Internal LB: Pre-select existing VMs on LB rule


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

Branch: refs/heads/master
Commit: b11c44f91d418d498c994f7fbf2b4791fe89dcab
Parents: 8acdd6f
Author: Brian Federle <bfederle@gmail.com>
Authored: Wed May 22 11:11:29 2013 -0700
Committer: Brian Federle <bfederle@gmail.com>
Committed: Wed May 22 11:11:33 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b11c44f9/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index a3dadaa..be7fdd7 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -444,7 +444,34 @@
                     },
                     listView: $.extend(true, {}, cloudStack.sections.instances.listView,
{
                       type: 'checkbox',
-                      filters: false
+                      filters: false,
+                      dataProvider: function(args) {
+                        $.ajax({
+                          url: createURL('listVirtualMachines'),
+                          data: {
+                            networkid: args.context.networks[0].id,
+                            listAll: true
+                          },
+                          success: function(json) {
+                            var instances = json.listvirtualmachinesresponse.virtualmachine;
+
+                            // Pre-select existing instances in LB rule
+                            $(instances).map(function(index, instance) {
+                              instance._isSelected = $.grep(
+                                args.context.internalLoadBalancers[0].loadbalancerinstance,
+                                
+                                function(lbInstance) {
+                                  return lbInstance.id == instance.id;
+                                }
+                              ).length ? true : false;
+                            });
+                            
+                            args.response.success({
+                              data: instances
+                            });
+                          }
+                        });
+                      }
                     }),
                     action: function(args) {                      
                       var vms = args.context.instances;


Mime
View raw message