|
982 | 982 | }, |
983 | 983 |
|
984 | 984 | tabFilter: function(args) { |
985 | | - var networkOfferingHavingELB = false; |
| 985 | + var networkHavingELB = false; |
986 | 986 | var hasNetworkACL = false; |
987 | 987 | var hasSRXFirewall = false; |
988 | 988 | var isVPC = false; |
989 | 989 | var isAdvancedSGZone = false; |
990 | 990 | var hiddenTabs = []; |
991 | 991 | var isSharedNetwork; |
| 992 | + |
| 993 | + var thisNetwork = args.context.networks[0]; |
| 994 | + if (thisNetwork.vpcid != null) { |
| 995 | + isVPC = true; |
| 996 | + } |
| 997 | + if (thisNetwork.type == 'Shared') { |
| 998 | + isSharedNetwork = true; |
| 999 | + } |
992 | 1000 |
|
993 | | - // Get network offering data |
994 | | - $.ajax({ |
995 | | - url: createURL("listNetworkOfferings&id=" + args.context.networks[0].networkofferingid), |
996 | | - dataType: "json", |
997 | | - async: false, |
998 | | - success: function(json) { |
999 | | - var networkoffering = json.listnetworkofferingsresponse.networkoffering[0]; |
1000 | | - |
1001 | | - if (networkoffering.forvpc) { |
1002 | | - isVPC = true; |
1003 | | - } |
1004 | | - |
1005 | | - if (networkoffering.guestiptype == 'Shared') { |
1006 | | - isSharedNetwork = true; |
1007 | | - } |
1008 | | - |
1009 | | - $(networkoffering.service).each(function() { |
1010 | | - var thisService = this; |
| 1001 | + $(thisNetwork.service).each(function() { |
| 1002 | + var thisService = this; |
1011 | 1003 |
|
1012 | | - if (thisService.name == 'NetworkACL') { |
1013 | | - hasNetworkACL = true; |
1014 | | - } else if (thisService.name == "Lb") { |
1015 | | - $(thisService.capability).each(function() { |
1016 | | - if (this.name == "ElasticLb" && this.value == "true") { |
1017 | | - networkOfferingHavingELB = true; |
1018 | | - } |
1019 | | - }); |
| 1004 | + if (thisService.name == 'NetworkACL') { |
| 1005 | + hasNetworkACL = true; |
| 1006 | + } else if (thisService.name == "Lb") { |
| 1007 | + $(thisService.capability).each(function() { |
| 1008 | + if (this.name == "ElasticLb" && this.value == "true") { |
| 1009 | + networkHavingELB = true; |
1020 | 1010 | } |
| 1011 | + }); |
| 1012 | + } |
1021 | 1013 |
|
1022 | | - if (thisService.name == 'Firewall') { |
1023 | | - $(thisService.provider).each(function() { |
1024 | | - if (this.name == 'JuniperSRX') { |
1025 | | - hasSRXFirewall = true; |
1026 | | - |
1027 | | - return false; |
1028 | | - } |
| 1014 | + if (thisService.name == 'Firewall') { |
| 1015 | + $(thisService.provider).each(function() { |
| 1016 | + if (this.name == 'JuniperSRX') { |
| 1017 | + hasSRXFirewall = true; |
1029 | 1018 |
|
1030 | | - return true; |
1031 | | - }); |
| 1019 | + return false; |
1032 | 1020 | } |
| 1021 | + |
| 1022 | + return true; |
1033 | 1023 | }); |
1034 | 1024 | } |
1035 | | - }); |
| 1025 | + }); |
1036 | 1026 |
|
1037 | 1027 | // Get zone data |
1038 | 1028 | $.ajax({ |
|
1048 | 1038 | } |
1049 | 1039 | }); |
1050 | 1040 |
|
1051 | | - if (!networkOfferingHavingELB) { |
| 1041 | + if (!networkHavingELB) { |
1052 | 1042 | hiddenTabs.push("addloadBalancer"); |
1053 | 1043 | } |
1054 | 1044 |
|
|
0 commit comments