cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [26/50] [abbrv] git commit: updated refs/heads/object_store to 18aeef3
Date Wed, 12 Jun 2013 18:22:35 GMT
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/object_store
Commit: 554178582709e51ef934fa2684b281e83f3a3ed5
Parents: f61d61d
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu Jun 6 16:04:31 2013 -0700
Committer: Jessica Wang <jessicawang@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;
                               });


Mime
View raw message