incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: CS-16407: cloudstack UI - Infrastructure page - zone - Physical network - Guest - network tab - make 2 API calls to get guest networks. The first one is to get guest networks under all projects. The 2nd one is to get guest networks that are n
Date Thu, 27 Sep 2012 18:53:02 GMT
Updated Branches:
  refs/heads/master 7e1c3ec3c -> d7508a4ce


CS-16407: cloudstack UI - Infrastructure page - zone - Physical network - Guest - network
tab - make 2 API calls to get guest networks. The first one is to get guest networks under
all projects. The 2nd one is to get guest networks that are not under any project.


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

Branch: refs/heads/master
Commit: d7508a4cea12d15e2f0b1d569101fb8d33a9160d
Parents: 7e1c3ec
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Thu Sep 27 11:48:11 2012 -0700
Committer: Jessica Wang <jessica.wang@citrix.com>
Committed: Thu Sep 27 11:52:32 2012 -0700

----------------------------------------------------------------------
 ui/scripts/system.js |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d7508a4c/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index e5d53e2..3759229 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -1446,8 +1446,9 @@
 
 										//need to make 2 listNetworks API call to get all guest networks from one physical
network in Advanced zone
 										var items = [];
+										//"listNetworks&projectid=-1": list guest networks under all projects (no matter
who the owner is)
 										$.ajax({
-                      url: createURL("listNetworks&listAll=true&trafficType=Guest&zoneId="
+ selectedZoneObj.id + "&physicalnetworkid=" + selectedPhysicalNetworkObj.id + "&page="
+ args.page + "&pagesize=" + pageSize + array1.join("")),
+                      url: createURL("listNetworks&projectid=-1&trafficType=Guest&zoneId="
+ selectedZoneObj.id + "&physicalnetworkid=" + selectedPhysicalNetworkObj.id + "&page="
+ args.page + "&pagesize=" + pageSize + array1.join("")),
                       dataType: "json",
 											async: false,
                       success: function(json) {
@@ -1461,6 +1462,7 @@
 										  networkCollectionMap[this.id] = this.name;
 										});
 
+										//"listNetworks&listAll=true: list guest networks that are not under any project
(no matter who the owner is)
 										$.ajax({
                       url: createURL("listNetworks&listAll=true&trafficType=Guest&zoneId="
+ selectedZoneObj.id + "&physicalnetworkid=" + selectedPhysicalNetworkObj.id + "&page="
+ args.page + "&pagesize=" + pageSize + array1.join("")),
                       dataType: "json",
@@ -1784,10 +1786,24 @@
 														project: { label: 'label.project' }
                           }
                         ],
-                        dataProvider: function(args) {			
+                        dataProvider: function(args) {	                         
+													var data = {
+													  id: args.context.networks[0].id
+													};
+													if(args.context.networks[0].projectid != null) {
+													  $.extend(data, {
+														  projectid: -1
+														});
+													}
+													else {
+													  $.extend(data, {
+														  listAll: true   //pass "&listAll=true" to "listNetworks&id=xxxxxxxx"
for now before API gets fixed.
+														});
+													}
+												
 													$.ajax({
-														url: createURL("listNetworks&id=" + args.context.networks[0].id + "&listAll=true"),
//pass "&listAll=true" to "listNetworks&id=xxxxxxxx" for now before API gets fixed.
-														dataType: "json",
+														url: createURL("listNetworks"), 
+														data: data,
 														async: false,
 														success: function(json) {														 
 															selectedGuestNetworkObj = json.listnetworksresponse.network[0];		


Mime
View raw message