--- loncom/interface/domainprefs.pm 2014/10/04 02:41:44 1.252
+++ loncom/interface/domainprefs.pm 2014/10/05 13:34:01 1.253
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.252 2014/10/04 02:41:44 raeburn Exp $
+# $Id: domainprefs.pm,v 1.253 2014/10/05 13:34:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3661,9 +3661,10 @@ sub print_loadbalancing {
$disabled = ' disabled="disabled"';
}
$targettable .=
- '
| ';
+ '';
my $rem = $i%($numinrow);
if ($rem == 0) {
if (($i > 0) && ($i < $numspares-1)) {
@@ -3753,7 +3754,7 @@ sub loadbalancing_rules {
if (ref($currrules) eq 'HASH') {
$current = $currrules->{$type};
}
- if (($type eq '_LC_external') || ($type eq '_LC_internetdom') || ($type eq '_LC_ipchange')) {
+ if (($type eq '_LC_external') || ($type eq '_LC_internetdom')) {
if ($dom ne &Apache::lonnet::host_domain($lonhost)) {
$current = '';
}
@@ -3816,7 +3817,7 @@ sub loadbalance_rule_row {
push(@rulenames,'none');
}
my $style = $targets_div_style;
- if (($type eq '_LC_external') || ($type eq '_LC_internetdom') || ($type eq '_LC_ipchange')) {
+ if (($type eq '_LC_external') || ($type eq '_LC_internetdom')) {
$style = $homedom_div_style;
}
my $space;
@@ -10680,6 +10681,7 @@ sub modify_loadbalancing {
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($dom);
my %servers = &Apache::lonnet::internet_dom_servers($dom);
+ my %libraryservers = &Apache::lonnet::get_servers($dom,'library');
my @sparestypes = ('primary','default');
my %typetitles = &sparestype_titles();
my $resulttext;
@@ -10808,6 +10810,7 @@ sub modify_loadbalancing {
}
if (ref($changes{'curr'}) eq 'HASH') {
foreach my $balancer (sort(keys(%{$changes{'curr'}}))) {
+ $toupdate{$balancer} = 1;
if (ref($changes{'curr'}{$balancer}) eq 'HASH') {
if ($changes{'curr'}{$balancer}{'targets'}) {
my %offloadstr;
@@ -10852,6 +10855,19 @@ sub modify_loadbalancing {
map { $toupdate{$_} = 1; } (@{$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}});
}
}
+ foreach my $item (@{$alltypes}) {
+ next if ($item =~ /^_LC_ipchange/);
+ my $hasrule = $defaultshash{'loadbalancing'}{$balancer}{'rules'}{$item};
+ if ($hasrule eq 'homeserver') {
+ map { $toupdate{$_} = 1; } (keys(%libraryservers));
+ } else {
+ unless (($hasrule eq 'default') || ($hasrule eq 'none') || ($hasrule eq 'externalbalancer')) {
+ if ($servers{$hasrule}) {
+ $toupdate{$hasrule} = 1;
+ }
+ }
+ }
+ }
}
} else {
$balancetext = &mt('offload to [_1]',$defaultshash{'loadbalancing'}{$balancer}{'rules'}{$type});