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 2012/08/14 21:36:56 UTC

[2/2] git commit: CS-15916: Show network name in IP details

CS-15916: Show network name in IP details

Conflicts:
	ui/scripts/network.js


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

Branch: refs/heads/master
Commit: e986d03fc91a54df3966eb184b0992663706b865
Parents: 1fd771f
Author: Brian Federle <br...@citrix.com>
Authored: Thu Aug 9 11:43:01 2012 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Tue Aug 14 12:35:33 2012 -0700

----------------------------------------------------------------------
 ui/scripts/network.js |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e986d03f/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 803ca1f..20fee4f 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1658,7 +1658,8 @@
                     ipaddress: { label: 'IP' }
                   },
                   {
-                    id: { label: 'label.id' },    
+                    id: { label: 'label.id' },
+                    networkname: { label: 'label.network.name' },
                     networkid: { label: 'label.network.id' },
                     associatednetworkid: { label: 'label.associated.network.id' },
                     state: { label: 'label.state' },
@@ -1688,14 +1689,23 @@
                     },
                     dataType: "json",
                     async: true,
-                    success: function(json) {										  
-                      var ipObj = json.listpublicipaddressesresponse.publicipaddress[0];	                      									
-											getExtaPropertiesForIpObj(ipObj, args);	
-								
+                    success: function(json) {
+                      var ipObj = json.listpublicipaddressesresponse.publicipaddress[0];
+                      getExtaPropertiesForIpObj(ipObj, args);
+                      
+                      var network = $.grep(
+                        args.context.vpc ?
+                          args.context.vpc[0].network : args.context.networks,
+                        function(network) {
+                          return network.id = ipObj.networkid;
+                        })[0];
+
                       args.response.success({
-												actionFilter: actionFilters.ipAddress,
-												data: ipObj
-											});													
+                        actionFilter: actionFilters.ipAddress,
+                        data: $.extend(ipObj, {
+                          networkname: network.name
+                        })
+                      });
                     },
                     error: function(data) {
                       args.response.error(parseXMLHttpResponse(data));