You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2012/09/27 20:53:02 UTC
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
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 <je...@citrix.com>
Authored: Thu Sep 27 11:48:11 2012 -0700
Committer: Jessica Wang <je...@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];