cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to 925f30a
Date Tue, 07 Oct 2014 23:06:37 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 794ee6929 -> 925f30a41


CLOUDSTACK-3195: UI > IP Address > detailView > Configuration tab > Port Forwarding
> for regular-user, if underlying VM has been destroyed (i.e. listVirtualMachines API returns
nothing), compose vm object from limited vm data in port forwarding rule object. So, a vm
object (required in widget code) can be passed to widget code.


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

Branch: refs/heads/master
Commit: 925f30a41b0dc5c4eddf6061852d9e73e9623d99
Parents: 794ee69
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Oct 7 16:06:15 2014 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Tue Oct 7 16:06:15 2014 -0700

----------------------------------------------------------------------
 ui/scripts/network.js | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/925f30a4/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 8bbde6a..9d79d3f 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -4354,14 +4354,25 @@
                                                             },
                                                             success: function(data) {
                                                                 loadCurrent++;
+                                                                var vms = data.listvirtualmachinesresponse.virtualmachine;
+                                                                                        
                                       
+                                                                //if this VM is destroyed,
data.listvirtualmachinesresponse.virtualmachine will be undefined for regular-user (CLOUDSTACK-3195)
+                                                                if (vms == undefined) { 
                                                              	
+                                                                	vms = [{
+                                                                        "id": item.virtualmachineid,
+                                                                        "name": item.virtualmachinename,
+                                                                        "displayname": item.virtualmachinedisplayname
+                                                                	}];                    
                                           	
+                                                                }                       
                                       
+                                                                
                                                                 $.extend(item, {
-                                                                    _itemData: $.map(data.listvirtualmachinesresponse.virtualmachine,
function(vm) {
+                                                                    _itemData: $.map(vms,
function(vm) {
                                                                         return $.extend(vm,
{
                                                                             _displayName:
'<p>VM: ' + vm.name + '</p>' + '<p>IP: ' + item.vmguestip + '</p>'
// Also display attached IP
                                                                         });
                                                                     }),
                                                                     _context: {
-                                                                        instances: data.listvirtualmachinesresponse.virtualmachine
+                                                                        instances: vms
                                                                     }
                                                                 });
 


Mime
View raw message