[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm
raeburn
raeburn at source.lon-capa.org
Tue Aug 9 08:16:41 EDT 2011
raeburn Tue Aug 9 12:16:41 2011 EDT
Modified files:
/loncom/interface domainprefs.pm
Log:
- Bug 6371. Corrections to javascript in Domain Configuration screen for
setting Load Balancing.
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.150 loncom/interface/domainprefs.pm:1.151
--- loncom/interface/domainprefs.pm:1.150 Tue Aug 9 01:35:18 2011
+++ loncom/interface/domainprefs.pm Tue Aug 9 12:16:41 2011
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.150 2011/08/09 01:35:18 raeburn Exp $
+# $Id: domainprefs.pm,v 1.151 2011/08/09 12:16:41 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -7533,8 +7533,8 @@
}
foreach my $sparetype (@sparestypes) {
my @targets = &Apache::loncommon::get_env_multiple('form.loadbalancing_target_'.$sparetype);
+ my @offloadto;
foreach my $target (@targets) {
- my @offloadto;
if (($servers{$target}) && ($target ne $balancer)) {
if ($sparetype eq 'default') {
if (ref($defaultshash{'loadbalancing'}{'targets'}{'primary'}) eq 'ARRAY') {
@@ -7871,42 +7871,45 @@
function showSpares(balancer,ishomedom) {
var alltargets = new Array('$alltargets');
var insttypes = new Array('$allinsttypes');
+ var offloadtypes = new Array('primary','default');
+
document.getElementById('loadbalancing_targets').style.display='block';
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++) {
- if ((insttypes[j] == '_LC_external') || (insttypes[j] == '_LC_internetdom')) {
+ for (var k=0; k<insttypes.length; k++) {
+ if ((insttypes[k] == '_LC_external') || (insttypes[k] == '_LC_internetdom')) {
if (ishomedom == 1) {
- document.getElementById('balanceruletitle_'+insttypes[j]).style.display='block';
- document.getElementById('balancerule_'+insttypes[j]).style.display='block';
+ document.getElementById('balanceruletitle_'+insttypes[k]).style.display='block';
+ document.getElementById('balancerule_'+insttypes[k]).style.display='block';
} else {
- document.getElementById('balanceruletitle_'+insttypes[j]).style.display='none';
- document.getElementById('balancerule_'+insttypes[j]).style.display='none';
+ document.getElementById('balanceruletitle_'+insttypes[k]).style.display='none';
+ document.getElementById('balancerule_'+insttypes[k]).style.display='none';
}
} else {
- document.getElementById('balanceruletitle_'+insttypes[j]).style.display='block';
- document.getElementById('balancerule_'+insttypes[j]).style.display='block';
+ document.getElementById('balanceruletitle_'+insttypes[k]).style.display='block';
+ document.getElementById('balancerule_'+insttypes[k]).style.display='block';
}
- if ((insttypes[j] != '_LC_external') &&
- ((insttypes[j] != '_LC_internetdom') ||
- ((insttypes[j] == '_LC_internetdom') && (homedom == 1)))) {
- document.getElementById('loadbalancing_singleserver_'+insttypes[j]).options[0] = new Option("","",true,true);
- for (var k=0; k<alltargets.length; k++) {
- var idx = k+1;
- if (alltargets[k] != balancer) {
- document.getElementById('loadbalancing_singleserver_'+insttypes[j]).options[idx] = new Option(alltargets[k],alltargets[k],false,false);
+ if ((insttypes[k] != '_LC_external') &&
+ ((insttypes[k] != '_LC_internetdom') ||
+ ((insttypes[k] == '_LC_internetdom') && (ishomedom == 1)))) {
+ document.getElementById('loadbalancing_singleserver_'+insttypes[k]).options[0] = new Option("","",true,true);
+ for (var m=0; m<alltargets.length; m++) {
+ var idx = m+1;
+ if (alltargets[m] != balancer) {
+ document.getElementById('loadbalancing_singleserver_'+insttypes[k]).options[idx] = new Option(alltargets[m],alltargets[m],false,false);
}
}
}
@@ -7928,13 +7931,14 @@
document.getElementById('loadbalancing_target_'+offloadtypes[i]+'_'+j).checked = false;
document.getElementById('loadbalancing_target_'+offloadtypes[i]+'_'+j).value = '';
document.getElementById('loadbalancing_targettxt_'+offloadtypes[i]+'_'+j).innerHTML = '';
+ }
}
for (var k=0; k<insttypes.length; k++) {
- document.getElementById('balanceruletitle_'+insttypes[j]).style.display='none';
- document.getElementById('balancerule_'+insttypes[j]).style.display='none';
- if (insttypes[j] != '_LC_external') {
- document.getElementById('loadbalancing_singleserver_'+insttypes[j]).length = 0;
- document.getElementById('loadbalancing_singleserver_'+insttypes[j]).options[0] = new Option("","",true,true);
+ document.getElementById('balanceruletitle_'+insttypes[k]).style.display='none';
+ document.getElementById('balancerule_'+insttypes[k]).style.display='none';
+ if (insttypes[k] != '_LC_external') {
+ document.getElementById('loadbalancing_singleserver_'+insttypes[k]).length = 0;
+ document.getElementById('loadbalancing_singleserver_'+insttypes[k]).options[0] = new Option("","",true,true);
}
}
return;
@@ -7947,9 +7951,9 @@
var total = alltargets.length - 1;
var other;
if (type == offloadtypes[0]) {
- other = offoadtypes[1];
+ other = offloadtypes[1];
} else {
- other = offoadtypes[0];
+ other = offloadtypes[0];
}
for (var i=0; i<total; i++) {
var server = document.getElementById('loadbalancing_target_'+other+'_'+i).value;
More information about the LON-CAPA-cvs
mailing list