You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by we...@apache.org on 2013/06/10 19:26:57 UTC

[03/50] [abbrv] git commit: updated refs/heads/disk_io_throttling to 8b8a0d3

CLOUDSTACK-747: Internal LB detailView - Assigned VMs tab - Assign VMs action - Select VM view - refresh assignedVMs data by API call when popping up Select VM view.


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

Branch: refs/heads/disk_io_throttling
Commit: 554178582709e51ef934fa2684b281e83f3a3ed5
Parents: f61d61d
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jun 6 16:04:31 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Jun 6 16:07:49 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/55417858/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index a087baa..399699d 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -651,7 +651,21 @@
                       listView: $.extend(true, {}, cloudStack.sections.instances.listView, {
                         type: 'checkbox',
                         filters: false,
-                        dataProvider: function(args) {                         
+                        dataProvider: function(args) {       
+                          var assignedInstances;
+                          $.ajax({
+                            url: createURL('listLoadBalancers'),
+                            data: {
+                              id: args.context.internalLoadBalancers[0].id
+                            },
+                            async: false,
+                            success: function(json) {    
+                              assignedInstances = json.listloadbalancerssresponse.loadbalancer[0].loadbalancerinstance;         
+                              if(assignedInstances == null)
+                                assignedInstances = []; 
+                            }
+                          });                     
+                          
                           $.ajax({
                             url: createURL('listVirtualMachines'),
                             data: {
@@ -663,11 +677,9 @@
 
                               // 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;
+                                instance._isSelected = $.grep(assignedInstances,                                  
+                                  function(assignedInstance) {
+                                    return assignedInstance.id == instance.id;
                                   }
                                 ).length ? true : false;
                               });