version 1.150, 2011/08/09 01:35:18
|
version 1.151, 2011/08/09 12:16:41
|
Line 7533 sub modify_loadbalancing {
|
Line 7533 sub modify_loadbalancing {
|
} |
} |
foreach my $sparetype (@sparestypes) { |
foreach my $sparetype (@sparestypes) { |
my @targets = &Apache::loncommon::get_env_multiple('form.loadbalancing_target_'.$sparetype); |
my @targets = &Apache::loncommon::get_env_multiple('form.loadbalancing_target_'.$sparetype); |
|
my @offloadto; |
foreach my $target (@targets) { |
foreach my $target (@targets) { |
my @offloadto; |
|
if (($servers{$target}) && ($target ne $balancer)) { |
if (($servers{$target}) && ($target ne $balancer)) { |
if ($sparetype eq 'default') { |
if ($sparetype eq 'default') { |
if (ref($defaultshash{'loadbalancing'}{'targets'}{'primary'}) eq 'ARRAY') { |
if (ref($defaultshash{'loadbalancing'}{'targets'}{'primary'}) eq 'ARRAY') { |
Line 7871 function toggleTargets() {
|
Line 7871 function toggleTargets() {
|
function showSpares(balancer,ishomedom) { |
function showSpares(balancer,ishomedom) { |
var alltargets = new Array('$alltargets'); |
var alltargets = new Array('$alltargets'); |
var insttypes = new Array('$allinsttypes'); |
var insttypes = new Array('$allinsttypes'); |
|
var offloadtypes = new Array('primary','default'); |
|
|
document.getElementById('loadbalancing_targets').style.display='block'; |
document.getElementById('loadbalancing_targets').style.display='block'; |
document.getElementById('loadbalancing_disabled').style.display='none'; |
document.getElementById('loadbalancing_disabled').style.display='none'; |
var count = 0; |
|
for (var i=0; i<alltargets.length; i++) { |
|
if (alltargets[i] != balancer) { |
|
|
|
document.getElementById('loadbalancing_target_'+count).value = alltargets[i]; |
|
document.getElementById('loadbalancing_targettxt_'+count).style.textAlign='left'; |
|
document.getElementById('loadbalancing_targettxt_'+count).style.textFace='normal'; |
|
document.getElementById('loadbalancing_targettxt_'+count).innerHTML = alltargets[i]; |
|
|
|
count ++; |
for (var i=0; i<offloadtypes.length; i++) { |
|
var count = 0; |
|
for (var j=0; j<alltargets.length; j++) { |
|
if (alltargets[j] != balancer) { |
|
document.getElementById('loadbalancing_target_'+offloadtypes[i]+'_'+count).value = alltargets[j]; |
|
document.getElementById('loadbalancing_targettxt_'+offloadtypes[i]+'_'+count).style.textAlign='left'; |
|
document.getElementById('loadbalancing_targettxt_'+offloadtypes[i]+'_'+count).style.textFace='normal'; |
|
document.getElementById('loadbalancing_targettxt_'+offloadtypes[i]+'_'+count).innerHTML = alltargets[j]; |
|
count ++; |
|
} |
} |
} |
} |
} |
for (var j=0; j<insttypes.length; j++) { |
for (var k=0; k<insttypes.length; k++) { |
if ((insttypes[j] == '_LC_external') || (insttypes[j] == '_LC_internetdom')) { |
if ((insttypes[k] == '_LC_external') || (insttypes[k] == '_LC_internetdom')) { |
if (ishomedom == 1) { |
if (ishomedom == 1) { |
document.getElementById('balanceruletitle_'+insttypes[j]).style.display='block'; |
document.getElementById('balanceruletitle_'+insttypes[k]).style.display='block'; |
document.getElementById('balancerule_'+insttypes[j]).style.display='block'; |
document.getElementById('balancerule_'+insttypes[k]).style.display='block'; |
} else { |
} else { |
document.getElementById('balanceruletitle_'+insttypes[j]).style.display='none'; |
document.getElementById('balanceruletitle_'+insttypes[k]).style.display='none'; |
document.getElementById('balancerule_'+insttypes[j]).style.display='none'; |
document.getElementById('balancerule_'+insttypes[k]).style.display='none'; |
|
|
} |
} |
} else { |
} else { |
document.getElementById('balanceruletitle_'+insttypes[j]).style.display='block'; |
document.getElementById('balanceruletitle_'+insttypes[k]).style.display='block'; |
document.getElementById('balancerule_'+insttypes[j]).style.display='block'; |
document.getElementById('balancerule_'+insttypes[k]).style.display='block'; |
} |
} |
if ((insttypes[j] != '_LC_external') && |
if ((insttypes[k] != '_LC_external') && |
((insttypes[j] != '_LC_internetdom') || |
((insttypes[k] != '_LC_internetdom') || |
((insttypes[j] == '_LC_internetdom') && (homedom == 1)))) { |
((insttypes[k] == '_LC_internetdom') && (ishomedom == 1)))) { |
document.getElementById('loadbalancing_singleserver_'+insttypes[j]).options[0] = new Option("","",true,true); |
document.getElementById('loadbalancing_singleserver_'+insttypes[k]).options[0] = new Option("","",true,true); |
for (var k=0; k<alltargets.length; k++) { |
for (var m=0; m<alltargets.length; m++) { |
var idx = k+1; |
var idx = m+1; |
if (alltargets[k] != balancer) { |
if (alltargets[m] != balancer) { |
document.getElementById('loadbalancing_singleserver_'+insttypes[j]).options[idx] = new Option(alltargets[k],alltargets[k],false,false); |
document.getElementById('loadbalancing_singleserver_'+insttypes[k]).options[idx] = new Option(alltargets[m],alltargets[m],false,false); |
} |
} |
} |
} |
} |
} |
Line 7928 function hideSpares() {
|
Line 7931 function hideSpares() {
|
document.getElementById('loadbalancing_target_'+offloadtypes[i]+'_'+j).checked = false; |
document.getElementById('loadbalancing_target_'+offloadtypes[i]+'_'+j).checked = false; |
document.getElementById('loadbalancing_target_'+offloadtypes[i]+'_'+j).value = ''; |
document.getElementById('loadbalancing_target_'+offloadtypes[i]+'_'+j).value = ''; |
document.getElementById('loadbalancing_targettxt_'+offloadtypes[i]+'_'+j).innerHTML = ''; |
document.getElementById('loadbalancing_targettxt_'+offloadtypes[i]+'_'+j).innerHTML = ''; |
|
} |
} |
} |
for (var k=0; k<insttypes.length; k++) { |
for (var k=0; k<insttypes.length; k++) { |
document.getElementById('balanceruletitle_'+insttypes[j]).style.display='none'; |
document.getElementById('balanceruletitle_'+insttypes[k]).style.display='none'; |
document.getElementById('balancerule_'+insttypes[j]).style.display='none'; |
document.getElementById('balancerule_'+insttypes[k]).style.display='none'; |
if (insttypes[j] != '_LC_external') { |
if (insttypes[k] != '_LC_external') { |
document.getElementById('loadbalancing_singleserver_'+insttypes[j]).length = 0; |
document.getElementById('loadbalancing_singleserver_'+insttypes[k]).length = 0; |
document.getElementById('loadbalancing_singleserver_'+insttypes[j]).options[0] = new Option("","",true,true); |
document.getElementById('loadbalancing_singleserver_'+insttypes[k]).options[0] = new Option("","",true,true); |
} |
} |
} |
} |
return; |
return; |
Line 7947 function checkOffloads(item,type) {
|
Line 7951 function checkOffloads(item,type) {
|
var total = alltargets.length - 1; |
var total = alltargets.length - 1; |
var other; |
var other; |
if (type == offloadtypes[0]) { |
if (type == offloadtypes[0]) { |
other = offoadtypes[1]; |
other = offloadtypes[1]; |
} else { |
} else { |
other = offoadtypes[0]; |
other = offloadtypes[0]; |
} |
} |
for (var i=0; i<total; i++) { |
for (var i=0; i<total; i++) { |
var server = document.getElementById('loadbalancing_target_'+other+'_'+i).value; |
var server = document.getElementById('loadbalancing_target_'+other+'_'+i).value; |