From 29dda3f41a2670ddd3de34527aece204c764cf0a Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 2 Nov 2012 14:08:47 -0700 Subject: [PATCH] CS-16599: cloudstack UI - guest network page - fix a bug that networkdomain didn't show in a shared network. --- ui/scripts/network.js | 3 ++- ui/scripts/sharedFunctions.js | 23 +++++++++++++++++++++++ ui/scripts/system.js | 22 ---------------------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index ef6eaa043d8..a149bfa82a0 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -956,7 +956,8 @@ dataType: "json", async: true, success: function(json) { - var jsonObj = json.listnetworksresponse.network[0]; + var jsonObj = json.listnetworksresponse.network[0]; + addExtraPropertiesToGuestNetworkObject(jsonObj); args.response.success( { actionFilter: cloudStack.actionFilter.guestNetwork, diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 28b3bb9550f..b6b3ef817f6 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -454,6 +454,29 @@ function listViewDataProvider(args, data) { }); } +//used by infrastruct page and network page +var addExtraPropertiesToGuestNetworkObject = function(jsonObj) { + jsonObj.networkdomaintext = jsonObj.networkdomain; + jsonObj.networkofferingidText = jsonObj.networkofferingid; + + if(jsonObj.acltype == "Domain") { + if(jsonObj.domainid == rootAccountId) + jsonObj.scope = "All"; + else + jsonObj.scope = "Domain (" + jsonObj.domain + ")"; + } + else if (jsonObj.acltype == "Account"){ + if(jsonObj.project != null) + jsonObj.scope = "Account (" + jsonObj.domain + ", " + jsonObj.project + ")"; + else + jsonObj.scope = "Account (" + jsonObj.domain + ", " + jsonObj.account + ")"; + } + + if(jsonObj.vlan == null && jsonObj.broadcasturi != null) { + jsonObj.vlan = jsonObj.broadcasturi.replace("vlan://", ""); + } +} + //find service object in network object function ipFindNetworkServiceByName(pName, networkObj) { if(networkObj == null) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index d27abcccf80..7d3f1b9f3c9 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -10406,28 +10406,6 @@ } } - var addExtraPropertiesToGuestNetworkObject = function(jsonObj) { - jsonObj.networkdomaintext = jsonObj.networkdomain; - jsonObj.networkofferingidText = jsonObj.networkofferingid; - - if(jsonObj.acltype == "Domain") { - if(jsonObj.domainid == rootAccountId) - jsonObj.scope = "All"; - else - jsonObj.scope = "Domain (" + jsonObj.domain + ")"; - } - else if (jsonObj.acltype == "Account"){ - if(jsonObj.project != null) - jsonObj.scope = "Account (" + jsonObj.domain + ", " + jsonObj.project + ")"; - else - jsonObj.scope = "Account (" + jsonObj.domain + ", " + jsonObj.account + ")"; - } - - if(jsonObj.vlan == null && jsonObj.broadcasturi != null) { - jsonObj.vlan = jsonObj.broadcasturi.replace("vlan://", ""); - } - } - var addExtraPropertiesToRouterInstanceObject = function(jsonObj) { if(jsonObj.isredundantrouter == true) jsonObj["redundantRouterState"] = jsonObj.redundantstate;