cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke4...@apache.org
Subject [33/50] [abbrv] git commit: updated refs/heads/4.5 to 50ee981
Date Mon, 13 Oct 2014 04:41:50 GMT
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.

(cherry picked from commit 925f30a41b0dc5c4eddf6061852d9e73e9623d99)


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

Branch: refs/heads/4.5
Commit: 1916bd25d17f959c701647c58199045b2e800a1a
Parents: 9714ecb
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Oct 7 16:06:15 2014 -0700
Committer: David Nalley <david@gnsa.us>
Committed: Mon Oct 13 00:34:38 2014 -0400

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1916bd25/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