You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/06/06 01:20:30 UTC

[1/2] git commit: updated refs/heads/master to 21a6271

Updated Branches:
  refs/heads/master 5fa1ad518 -> 21a627191


List view widget: Support 'listView' selection for actions


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

Branch: refs/heads/master
Commit: 88a62ab890346c3fe5fe0963dcda92cca1560d47
Parents: 5fa1ad5
Author: Brian Federle <br...@citrix.com>
Authored: Wed Jun 5 16:20:05 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Jun 5 16:20:05 2013 -0700

----------------------------------------------------------------------
 ui/scripts/ui/widgets/listView.js |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/88a62ab8/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index d68f91f..ba4d288 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -25,6 +25,7 @@
       var messages = args.action ? args.action.messages : {};
       var preAction = args.action ? args.action.preAction : {};
       var action = args.action ? args.action.action : {};
+      var needsRefresh = args.action.needsRefresh;
       var section;
       var data = {
         id: $instanceRow.data('list-view-item-id'),
@@ -142,6 +143,12 @@
             $item: $instanceRow
           });
         } else {
+          if (needsRefresh) {
+            var $loading = $('<div>').addClass('loading-overlay');
+            
+            $listView.prepend($loading);
+          }
+          
           var actionArgs = {
             data: data,
             ref: options.ref,
@@ -206,6 +213,15 @@
                                                 $instanceRow.data('json-obj'),
                                                 actionFilter);
                         }
+
+                        if (needsRefresh) {
+                          if ($listView.closest('.detail-view').size()) {
+                            $('.detail-view:last .button.refresh').click();
+                          } else {                            
+                            $loading.remove();
+                            $listView.listView('refresh');
+                          }
+                        }
                       }
 
                       if (additional && additional.complete)
@@ -293,7 +309,8 @@
       if (!args.action.action.externalLink &&
           !args.action.createForm &&
           args.action.addRow != 'true' &&
-          !action.custom && !action.uiCustom) {
+          !action.custom && !action.uiCustom &&
+          !args.action.listView) {
         cloudStack.dialog.confirm({
           message: messages.confirm(messageArgs),
           action: function() {
@@ -306,6 +323,14 @@
         });
       } else if (action.custom || action.uiCustom) {
         performAction();
+      } else if (args.action.listView) {
+        cloudStack.dialog.listView({
+          context: context,
+          listView: args.action.listView,
+          after: function(args) {
+            performAction(null, { context: args.context });
+          }
+        });
       } else {
         var addRow = args.action.addRow == "false" ? false : true;
         var isHeader = args.action.isHeader;


[2/2] git commit: updated refs/heads/master to 21a6271

Posted by bf...@apache.org.
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/master
Commit: 21a62719140acea4d2ab02cd610bc00a38bdd6eb
Parents: 88a62ab
Author: Brian Federle <br...@citrix.com>
Authored: Wed Jun 5 16:20:21 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Jun 5 16:20:21 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js |   79 ++++++++++++++++++++++++++++++-----------------
 1 files 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] });
+                          });
+                        }
                       }
                     }
                   }