cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [03/50] [abbrv] git commit: updated refs/heads/vmsync to aaa16af
Date Mon, 10 Jun 2013 00:53:52 GMT
VPC UI, internal LB: Fix assignedVMs actions


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

Branch: refs/heads/vmsync
Commit: 21a62719140acea4d2ab02cd610bc00a38bdd6eb
Parents: 88a62ab
Author: Brian Federle <brian.federle@citrix.com>
Authored: Wed Jun 5 16:20:21 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Wed Jun 5 16:20:21 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js | 79 ++++++++++++++++++++++++++++++++------------------
 1 file changed, 50 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/21a62719/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 18fb5c1..03a85d8 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -605,7 +605,6 @@
               
               assignedVms: {
                 title: 'Assigned VMs',
-                multiple: true,
                 listView: {  
                   id: 'assignedVms',
                   fields: {
@@ -625,11 +624,12 @@
                     }); 
                   },
                   actions: {
-                    add: {                      
+                    add: {
                       label: 'Assign VMs',
-                      messages: {                       
+                      messages: {
                         notification: function(args) { return 'Assign VMs'; }
                       },
+                      needsRefresh: true,
                       listView: $.extend(true, {}, cloudStack.sections.instances.listView,
{
                         type: 'checkbox',
                         filters: false,
@@ -688,36 +688,57 @@
                       notification: {
                         poll: pollAsyncJobResult
                       }                      
-                    },
-                    
-                    remove: {
-                      label: 'remove VM from load balancer',
-                      addRow: 'false',
-                      messages: {
-                        confirm: function(args) {
-                          return 'Please confirm you want to remove VM from load balancer';
+                    }
+                  },
+                  detailView: {
+                    actions: {
+                      remove: {
+                        label: 'remove VM from load balancer',
+                        addRow: 'false',
+                        messages: {
+                          confirm: function(args) {
+                            return 'Please confirm you want to remove VM from load balancer';
+                          },
+                          notification: function(args) {
+                            return 'remove VM from load balancer';
+                          }
+                        },
+                        action: function(args) {                        
+                          $.ajax({
+                            url: createURL('removeFromLoadBalancerRule'),
+                            data: {   
+                              id: args.context.internalLoadBalancers[0].id,
+                              virtualmachineids: args.context.assignedVms[0].id
+                            },
+                            success: function(json) {                            
+                              var jid = json.removefromloadbalancerruleresponse.jobid;
+                              args.response.success({
+                                _custom: { jobId: jid }
+                              });                            
+                            }
+                          });
                         },
-                        notification: function(args) {
-                          return 'remove VM from load balancer';
+                        notificaton: {
+                          poll: pollAsyncJobResult
                         }
-                      },
-                      action: function(args) {                        
-                        $.ajax({
-                          url: createURL('removeFromLoadBalancerRule'),
-                          data: {   
-                            id: args.context.internalLoadBalancers[0].id,
-                            virtualmachineids: args.context.assignedVms[0].id
+                      }
+                    },
+                    tabs: {
+                      details: {
+                        title: 'label.details',
+                        fields: [
+                          {
+                            name: { label: 'label.name' }
                           },
-                          success: function(json) {                            
-                            var jid = json.removefromloadbalancerruleresponse.jobid;
-                            args.response.success({
-                              _custom: { jobId: jid }
-                            });                            
+                          {
+                            ipaddress: { label: 'label.ip.address' }
                           }
-                        });
-                      },
-                      notificaton: {
-                        poll: pollAsyncJobResult
+                        ],
+                        dataProvider: function(args) {
+                          setTimeout(function() {
+                            args.response.success({ data: args.context.assignedVms[0] });
+                          });
+                        }
                       }
                     }
                   }


Mime
View raw message