cloudStack - IP Address page - take "firewallRuleUiEnabled" from listcapabilitiesresponse to determine to show/hide network tab.

This commit is contained in:
Jessica Wang 2011-08-11 13:42:05 -07:00
parent 9083bbcb47
commit a73c6edcb9
3 changed files with 16 additions and 10 deletions

View File

@ -596,6 +596,7 @@ $(document).ready(function() {
g_timezoneoffset = null;
g_timezone = null;
g_supportELB = null;
g_firewallRuleUiEnabled = null;
$.cookie('JSESSIONID', null);
$.cookie('sessionKey', null);
@ -607,6 +608,7 @@ $(document).ready(function() {
$.cookie('timezoneoffset', null);
$.cookie('timezone', null);
$.cookie('supportELB', null);
$.cookie('firewallRuleUiEnabled', null);
$("body").stopTime();
@ -706,7 +708,10 @@ $(document).ready(function() {
*/
g_supportELB = json.listcapabilitiesresponse.capability.supportELB;
$.cookie('supportELB', g_supportELB, { expires: 1});
g_firewallRuleUiEnabled = json.listcapabilitiesresponse.capability.firewallRuleUiEnabled;
$.cookie('firewallRuleUiEnabled', g_firewallRuleUiEnabled, { expires: 1});
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
g_userPublicTemplateEnabled = ""+json.listcapabilitiesresponse.capability.userpublictemplateenabled;
$.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, { expires: 1});
@ -803,6 +808,9 @@ $(document).ready(function() {
if(g_supportELB == null)
g_supportELB = $.cookie("supportELB");
if(g_firewallRuleUiEnabled == null)
g_firewallRuleUiEnabled = $.cookie("firewallRuleUiEnabled");
$.ajax({
data: createURL("command=listCapabilities"),

View File

@ -65,7 +65,6 @@ function ipGetSearchParams() {
return moreCriteria.join("");
}
var firewallTabIsShownInAdvancedZone = true;
function afterLoadIpJSP() {
//***** switch between different tabs (begin) ********************************************************************
var tabArray = [$("#tab_details"), $("#tab_firewall"), $("#tab_port_range"), $("#tab_port_forwarding"), $("#tab_load_balancer"), $("#tab_vpn")];
@ -463,7 +462,7 @@ function afterLoadIpJSP() {
array1.push("&endPort="+endPort);
array1.push("&protocol="+protocol);
if(firewallTabIsShownInAdvancedZone == true)
if(g_firewallRuleUiEnabled == true)
array1.push("&openfirewall=false");
$.ajax({
@ -604,7 +603,7 @@ function afterLoadIpJSP() {
var virtualMachineId = $createPortForwardingRow.find("#vm").val();
array1.push("&virtualmachineid=" + virtualMachineId);
if(firewallTabIsShownInAdvancedZone == true)
if(g_firewallRuleUiEnabled == true)
array1.push("&openfirewall=false");
$.ajax({
@ -710,7 +709,7 @@ function afterLoadIpJSP() {
var algorithm = createLoadBalancerRow.find("#algorithm_select").val();
array1.push("&algorithm="+algorithm);
if(firewallTabIsShownInAdvancedZone == true)
if(g_firewallRuleUiEnabled == true)
array1.push("&openfirewall=false");
$.ajax({
@ -838,7 +837,7 @@ function ipToRightPanel($midmenuItem1) {
$("#tab_details").click();
if(ipObj.isstaticnat == true) {
if(firewallTabIsShownInAdvancedZone == true) {
if(g_firewallRuleUiEnabled == true) {
$("#tab_port_range").hide();
}
else {
@ -850,7 +849,7 @@ function ipToRightPanel($midmenuItem1) {
$("#tab_port_range").hide();
if(ipObj.forvirtualnetwork == true) { //(public network)
if(isIpManageable(ipObj.domainid, ipObj.account) == true) {
if(firewallTabIsShownInAdvancedZone == true)
if(g_firewallRuleUiEnabled == true)
$("#tab_firewall").show();
else
$("#tab_firewall").hide();
@ -1167,7 +1166,7 @@ function showEnableVPNDialog($thisTab) {
array1.push("&account="+ipObj.account);
array1.push("&domainid="+ipObj.domainid);
array1.push("&zoneid="+ipObj.zoneid);
if(firewallTabIsShownInAdvancedZone == true)
if(g_firewallRuleUiEnabled == true)
array1.push("&openfirewall=true");
$.ajax({

View File

@ -1527,6 +1527,7 @@ var g_enableLogging = false;
var g_timezoneoffset = null;
var g_timezone = null;
var g_supportELB = null;
var g_firewallRuleUiEnabled = null; //true or false
// capabilities
var g_directAttachSecurityGroupsEnabled = "false";
@ -1535,8 +1536,6 @@ function getDirectAttachSecurityGroupsEnabled() { return g_directAttachSecurityG
var g_userPublicTemplateEnabled = "true";
function getUserPublicTemplateEnabled() { return g_userPublicTemplateEnabled; }
var g_supportELB = null;
//keyboard keycode
var keycode_Enter = 13;