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/2894964f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/2894964f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/2894964f
Branch: refs/heads/4.0
Commit: 2894964f690cb91d4d2d846295abf19d11285d52
Parents: 1ab26fb
Author: Brian Federle <[email protected]>
Authored: Thu Aug 9 11:43:01 2012 -0700
Committer: Alex Huang <[email protected]>
Committed: Wed Aug 15 14:07:29 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/2894964f/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));