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 2013/02/07 22:28:46 UTC
git commit: refs/heads/4.1 - CLOUDSTACK-537: cloudstack UI -
Infrastructure menu - create network dialog - Advanced sg-enabled zone - (1)
account-specific network doesn't work at backend. Therefore,
remove "account" option from scope dropdown. (2) zone-w
Updated Branches:
refs/heads/4.1 368d5a1ea -> e56cb26f5
CLOUDSTACK-537: cloudstack UI - Infrastructure menu - create network dialog - Advanced sg-enabled zone - (1) account-specific network doesn't work at backend. Therefore, remove "account" option from scope dropdown. (2) zone-wide network: list only sg network offerings.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e56cb26f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e56cb26f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e56cb26f
Branch: refs/heads/4.1
Commit: e56cb26f5c93a22acf1d9326f68d391d19c58614
Parents: 368d5a1
Author: Jessica Wang <je...@citrix.com>
Authored: Thu Feb 7 13:28:01 2013 -0800
Committer: Jessica Wang <je...@citrix.com>
Committed: Thu Feb 7 13:28:01 2013 -0800
----------------------------------------------------------------------
ui/scripts/system.js | 46 ++++++++++++++++++--------------------------
1 files changed, 19 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e56cb26f/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 2ce7672..cb09a85 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -1144,8 +1144,7 @@
docID: 'helpGuestNetworkZoneScope',
select: function(args) {
var array1 = [];
- if(args.context.zones[0].networktype == "Advanced" && args.context.zones[0].securitygroupsenabled == true) {
- array1.push({id: 'account-specific', description: 'Account'});
+ if(args.context.zones[0].networktype == "Advanced" && args.context.zones[0].securitygroupsenabled == true) {
array1.push({id: 'zone-wide', description: 'All'});
}
else {
@@ -1312,38 +1311,31 @@
}
var networkOfferingArray = [];
+
$.ajax({
url: createURL(apiCmd + array1.join("")),
dataType: "json",
async: false,
- success: function(json) {
+ success: function(json) {
networkOfferingObjs = json.listnetworkofferingsresponse.networkoffering;
if (networkOfferingObjs != null && networkOfferingObjs.length > 0) {
- for (var i = 0; i < networkOfferingObjs.length; i++) {
-
- if(args.scope=="account-specific" && args.context.zones[0].securitygroupsenabled == true) { //BUG - CLOUDSTACK-1063
- var serviceObjArray = networkOfferingObjs[i].name;
- if(serviceObjArray == "DefaultSharedNetworkOfferingWithSGService"){
- continue;
- }
- }
-
- //comment out the following 12 lines because of CS-16718
- /*
- if(args.scope == "account-specific" || args.scope == "project-specific") { //if args.scope == "account-specific" or "project-specific", exclude Isolated network offerings with SourceNat service (bug 12869)
- var includingSourceNat = false;
- var serviceObjArray = networkOfferingObjs[i].service;
- for(var k = 0; k < serviceObjArray.length; k++) {
- if(serviceObjArray[k].name == "SourceNat") {
- includingSourceNat = true;
- break;
- }
- }
- if(includingSourceNat == true)
- continue; //skip to next network offering
+ for (var i = 0; i < networkOfferingObjs.length; i++) {
+ //for zone-wide network in Advanced SG-enabled zone, list only SG network offerings
+ if(args.context.zones[0].networktype == 'Advanced' && args.context.zones[0].securitygroupsenabled == true) {
+ if(args.scope == "zone-wide") {
+ var includingSecurityGroup = false;
+ var serviceObjArray = networkOfferingObjs[i].service;
+ for(var k = 0; k < serviceObjArray.length; k++) {
+ if(serviceObjArray[k].name == "SecurityGroup") {
+ includingSecurityGroup = true;
+ break;
+ }
+ }
+ if(includingSecurityGroup == false)
+ continue; //skip to next network offering
+ }
}
- */
-
+
networkOfferingArray.push({id: networkOfferingObjs[i].id, description: networkOfferingObjs[i].displaytext});
}
}